lemma-osu / sknnr

scikit-learn compatible estimators for various kNN imputation methods
https://sknnr.readthedocs.io
0 stars 1 forks source link

Fix broken warning and reduce complexity of feature validation #35 #36

Closed aazuspan closed 1 year ago

aazuspan commented 1 year ago

This closes #35 and simplifies feature validation. This comment and this commit go into more depth on the changes here, but the bullet points are:

  1. Remove set_temp_output because we no longer need transformers to pass dataframes into transformed estimators since we can get feature names from the transformer.
  2. Remove the warning logic from TransformedKNeighborsMixin._check_feature_names. That is now handled by calling transform_._validate_data. This method now just serves to override the internal check that would incorrectly fail when our estimator is fit with transformed features that mismatch the feature_names_in_ from the transformer.
  3. Update tests to make sure we can fit with a dataframe with no feature names without getting a warning.
  4. Parametrize a few related test cases just to improve error reporting.