Skip to content

Fixed strategy #168

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

Merged
merged 9 commits into from
Aug 23, 2018
Merged

Conversation

bjherger
Copy link

@bjherger bjherger commented Aug 9, 2018

Addressing #161 , bringing CategoricalImputer terminology to be consistent with SimpleInputer

  • Refactored so that terminology is consistent
  • Updated documentation to correctly reflect constant mode
  • Update default fill_value to '?', consistent with SimpleInputer

@devforfu
Copy link
Collaborator

devforfu commented Aug 14, 2018

@bjherger I think that everything is fine, though probably we could add an additional test to replace the excluded one, i.e., test_missing_replacement, to make sure that the constant strategy uses the ? symbol when fill_value is not provided. Something like:

def test_default_fill_value_for_constant_strategy():
    data = [None, 'b', 'c']
  
    imputer = CategoricalImputer(strategy='constant')
    Xt = imputer.fit_transform(X)
    
    assert imputer.fill_ == '?'
    assert (data == [imputer.fill_, 'b', 'c']).all()

@bjherger
Copy link
Author

@devforfu Great point! I've added another test, based on your suggested code and test_custom_replacement().

Please review and let me know your thoughts.

@devforfu
Copy link
Collaborator

@bjherger Ok, great! Yes, thank you for the PR, I think we can merge your changes into master.

@devforfu devforfu merged commit 0024cf7 into scikit-learn-contrib:master Aug 23, 2018
@bjherger bjherger deleted the fixed_strategy branch August 24, 2018 01:12
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.

2 participants