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

Bring MeanResponseTransformer in line with new test set up #262

Merged
merged 16 commits into from
Aug 7, 2024

Conversation

davidhopkinson26
Copy link
Contributor

@davidhopkinson26 davidhopkinson26 commented Jun 27, 2024

Bringing MeanResponseTransformer in line with the new testing set up.

Have noticed during this update that WeightColumnFitMixinTests and WeightColumnInitMixinTests might not be being used in other transformers we have already refactored so might be worth a quick audit.

… some tests still failing due to tests in base_tests.y not giving a y argument to fit
…ged affected tests in base_tests.GenericFirTests and GenericTransformTests to refer to df[a] for target
@davidhopkinson26 davidhopkinson26 marked this pull request as ready for review July 15, 2024 11:05
@limlam96
Copy link
Contributor

fyi CI is failing, but happy to approve otherwise!

@davidhopkinson26
Copy link
Contributor Author

fyi CI is failing, but happy to approve otherwise!

Bit strange, an error seems to have appeared with NearestMeanResponseImputer. Will investigate.

@davidhopkinson26
Copy link
Contributor Author

davidhopkinson26 commented Jul 24, 2024

Had to reconfigure a few things in Imputer tests to make some shared generic tests compatible with this transformer.

  • convention now is that the target is column 'a' in the default dataframes.
  • generic tests specify a y argument for fit rather than calling transformer.fit(df)
  • removed "unexpected type for y, should be a pd.Series" error handling from NearestMeanResponseImputer as this is handled in BaseTransformer.fit already and the inconistency was causing incompatibility with a lot of tests.
  • removed the option to set y = None for NearestMeanResponseImputer since it will not work in those circumstances!
  • removed some duplicate tests

I'm wondering if it might be best to separate out GenericFitTests for the limited subset of cases where y is a compulsory argument (this and NearestMeanResponse imputer). Quite a few of the generic tests before this PR did not specify a y argument. I think it is better that they do even though most can take y=None (and in fact default to it) as they will mostly be called in a pipeline where y will be specified so we need to assert they work in those circumstances. Arguably a test checking those which can accept None work in those circumstances should be created.

@Chip2916
Copy link
Collaborator

Chip2916 commented Aug 7, 2024

Hi David - picking up this review as Liam is on AL. On your comment regarding transformers where y is not a compulsory argument and a test to confirm they work when None is passed should be created, is there a ticket for this? If not can we get one down :)

@Chip2916
Copy link
Collaborator

Chip2916 commented Aug 7, 2024

Reviewed scripts, no further comments on Liam's additional review. Agree with the changes made to standardise things across the imputer test scripts

@davidhopkinson26
Copy link
Contributor Author

Reviewed scripts, no further comments on Liam's additional review. Agree with the changes made to standardise things across the imputer test scripts

#287

Copy link
Collaborator

@Chip2916 Chip2916 left a comment

Choose a reason for hiding this comment

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

Happy to approve based on mine and Liam's reviews.

@Chip2916 Chip2916 merged commit e952c11 into main Aug 7, 2024
12 checks passed
@Chip2916 Chip2916 deleted the mre_test_refactor branch August 7, 2024 12:09
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.

4 participants