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

Feature/nearestmeanresponse update #281

Merged
merged 5 commits into from
Jul 19, 2024
Merged

Conversation

Chip2916
Copy link
Collaborator

Linked to this issue.

Brought nearest mean response tests in line with new framework. Had to make very small change to minimal_dataframe_lookup function in conftest as NMI transformer requires a dataframe where columns have some nans in order to pass generic tests.

Also added in minor error handling step in the imputer script itself, as the default value for the y parameter is None which falls over immediately as one of the first steps in fit is 'y.isna()' and None has no 'isna' attribute.

Also overwrote 'test_fit_not_changing_data' in generic tests in the NMI specific tests scripts as base test for 'test_fit_not_changing_data' is set up without a y value being called in fit, which works fine for other transformers but not for NMI.

@Chip2916 Chip2916 linked an issue Jul 19, 2024 that may be closed by this pull request
tests/imputers/test_NearestMeanResponseImputer.py Outdated Show resolved Hide resolved
msg="Check nulls filled correctly in transform",
)

def test_learnt_values_not_modified(self):
Copy link
Contributor

Choose a reason for hiding this comment

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

Q: do we not need this one?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Hey Liam - is this not covered by the 'test_impute_value_unchanged' test in the 'test_BaseImputer' script?

tubular/imputers.py Show resolved Hide resolved
@Chip2916 Chip2916 merged commit 254a78a into main Jul 19, 2024
12 checks passed
@Chip2916 Chip2916 deleted the feature/nearestmeanresponse_update branch July 19, 2024 15:27
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.

Bring NearestMeanResponseImputer in line with new testing setup
2 participants