Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix target leakage in MeanSegmentEncoderTransform #503

Merged
merged 5 commits into from
Nov 9, 2024
Merged

Conversation

egoriyaa
Copy link
Collaborator

@egoriyaa egoriyaa commented Nov 7, 2024

Before submitting (must do checklist)

  • Did you read the contribution guide?
  • Did you update the docs? We use Numpy format for all the methods and classes.
  • Did you write any new necessary tests?
  • Did you update the CHANGELOG?

Proposed Changes

Closing issues

closes #400

@egoriyaa egoriyaa changed the title Fix target leakage in MeanSegmentEncoderTransform Fix target leakage in MeanSegmentEncoderTransform Nov 7, 2024
@egoriyaa egoriyaa changed the title Fix target leakage in MeanSegmentEncoderTransform Fix target leakage in MeanSegmentEncoderTransform Nov 7, 2024
@egoriyaa egoriyaa self-assigned this Nov 7, 2024
pd.testing.assert_frame_equal(transformed_simple_df, transformed_df)


def test_subset_segments(simple_ts):
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have such type of tests in inference tests

Copy link

github-actions bot commented Nov 7, 2024

🚀 Deployed on https://deploy-preview-503--etna-docs.netlify.app

@github-actions github-actions bot temporarily deployed to pull request November 7, 2024 10:20 Inactive
Copy link

codecov bot commented Nov 7, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 90.51%. Comparing base (4a6e975) to head (7b8a5f7).
Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #503   +/-   ##
=======================================
  Coverage   90.51%   90.51%           
=======================================
  Files         247      247           
  Lines       16516    16508    -8     
=======================================
- Hits        14950    14943    -7     
+ Misses       1566     1565    -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

column = transformed_df.loc[:, pd.IndexSlice[segment, "segment_code"]]
assert column.dtype == "category", "Column type is not category"
assert np.all(column == column.iloc[0]), "Values are not the same for the whole column"
codes.add(column.iloc[0])
assert codes == {0, 1}, "Codes are not 0 and 1"


def test_subset_segments(simple_ts):
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The same as for MeanSegmentEncoder

@github-actions github-actions bot temporarily deployed to pull request November 7, 2024 11:54 Inactive
@github-actions github-actions bot temporarily deployed to pull request November 8, 2024 11:48 Inactive
@egoriyaa egoriyaa merged commit e65fa1b into master Nov 9, 2024
17 checks passed
@egoriyaa egoriyaa deleted the issue-400 branch November 9, 2024 05:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] Target leakage in MeanSegmentEncoderTransform
2 participants