Skip to content

Commit

Permalink
Update sklearn imputer (#43)
Browse files Browse the repository at this point in the history
* Update sklearn imputer

* Add CatBoost Regressor

* Revert "Add CatBoost Regressor"

This reverts commit f4b0ad5.
  • Loading branch information
victor-ab authored and caique-lima committed Apr 24, 2019
1 parent 4728cd4 commit 06475b6
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/fklearn/training/imputation.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from typing import Any, List

import pandas as pd
from sklearn.preprocessing import Imputer
from sklearn.impute import SimpleImputer
from toolz import curry

from fklearn.common_docstrings import learner_return_docstring, learner_pred_fn_docstring
Expand Down Expand Up @@ -34,7 +34,7 @@ def imputer(df: pd.DataFrame,
- If "most_frequent", then replace missing using the most frequent value along the axis.
"""

imp = Imputer(strategy=impute_strategy)
imp = SimpleImputer(strategy=impute_strategy)

imp.fit(df[columns_to_impute].values)

Expand All @@ -53,7 +53,7 @@ def p(new_data_set: pd.DataFrame) -> pd.DataFrame:
return p, p(df), log


imputer.__doc__ += learner_return_docstring("Imputer")
imputer.__doc__ += learner_return_docstring("SimpleImputer")


@curry
Expand Down Expand Up @@ -95,4 +95,4 @@ def p(new_data_set: pd.DataFrame) -> pd.DataFrame:
return p, p(df), log


placeholder_imputer.__doc__ += learner_return_docstring("Placeholder Imputer")
placeholder_imputer.__doc__ += learner_return_docstring("Placeholder SimpleImputer")

0 comments on commit 06475b6

Please sign in to comment.