Skip to content

Commit

Permalink
Updating categorical imputer tests to reference new methods
Browse files Browse the repository at this point in the history
  • Loading branch information
Brendan Herger committed Aug 9, 2018
1 parent 6339ccd commit c2ea5d5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion sklearn_pandas/categorical_imputer.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class CategoricalImputer(BaseEstimator, TransformerMixin):
- If "constant", then replace missing values with fill_value. Can be
used with strings or numeric data.
replacement : string, optional (default='?')
fill_value : string, optional (default='?')
The value that all instances of `missing_values` are replaced
with if `strategy` is set to `constant`. This is useful if
you don't want to impute with the mode, or if there are multiple
Expand Down
6 changes: 3 additions & 3 deletions tests/test_categorical_imputer.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ def test_custom_replacement(replacement_value, input_type):
Xc = X.copy()

Xt = CategoricalImputer(
strategy='fixed_value',
strategy='constant',
fill_value=replacement_value
).fit_transform(X)

Expand All @@ -158,10 +158,10 @@ def test_custom_replacement(replacement_value, input_type):

def test_missing_replacement():
"""
Raise error if no replacement value specified and strategy='fixed_value'
Raise error if no replacement value specified and strategy='constant'
"""
with pytest.raises(ValueError):
CategoricalImputer(strategy="fixed_value")
CategoricalImputer(strategy="constant")


def test_invalid_strategy():
Expand Down

0 comments on commit c2ea5d5

Please sign in to comment.