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

update notebook, sklearn parameter rename #465

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion learntools/ml_intermediate/ex3.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ class OneHot(CodingProblem):
"`X_valid[low_cardinality_cols]`, respectively.")
_solution = CS(
"""# Apply one-hot encoder to each column with categorical data
OH_encoder = OneHotEncoder(handle_unknown='ignore', sparse=False)
OH_encoder = OneHotEncoder(handle_unknown='ignore', sparse_output=False)
OH_cols_train = pd.DataFrame(OH_encoder.fit_transform(X_train[low_cardinality_cols]))
OH_cols_valid = pd.DataFrame(OH_encoder.transform(X_valid[low_cardinality_cols]))

Expand Down
4 changes: 2 additions & 2 deletions learntools/time_series/ex3.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ class Q4(EqualityCheckProblem): # Create holiday features
```python
from sklearn.preprocessing import OneHotEncoder

ohe = OneHotEncoder(sparse=False)
ohe = OneHotEncoder(sparse_output=False)

X_holidays = pd.DataFrame(
____,
Expand All @@ -134,7 +134,7 @@ class Q4(EqualityCheckProblem): # Create holiday features
# Scikit-learn solution
from sklearn.preprocessing import OneHotEncoder

ohe = OneHotEncoder(sparse=False)
ohe = OneHotEncoder(sparse_output=False)

X_holidays = pd.DataFrame(
ohe.fit_transform(holidays),
Expand Down
2 changes: 1 addition & 1 deletion notebooks/deep_learning_intro/raw/ex3.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
"preprocessor = make_column_transformer(\n",
" (StandardScaler(),\n",
" make_column_selector(dtype_include=np.number)),\n",
" (OneHotEncoder(sparse=False),\n",
" (OneHotEncoder(sparse_output=False),\n",
" make_column_selector(dtype_include=object)),\n",
")\n",
"\n",
Expand Down
2 changes: 1 addition & 1 deletion notebooks/ml_intermediate/raw/ex3.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -538,7 +538,7 @@
"source": [
"#%%RM_IF(PROD)%%\n",
"# Apply one-hot encoder to each column with categorical data\n",
"OH_encoder = OneHotEncoder(handle_unknown='ignore', sparse=False)\n",
"OH_encoder = OneHotEncoder(handle_unknown='ignore', sparse_output=False)\n",
"OH_cols_train = pd.DataFrame(OH_encoder.fit_transform(X_train[low_cardinality_cols]))\n",
"OH_cols_valid = pd.DataFrame(OH_encoder.transform(X_valid[low_cardinality_cols]))\n",
"\n",
Expand Down
2 changes: 1 addition & 1 deletion notebooks/ml_intermediate/raw/tut3.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@
"from sklearn.preprocessing import OneHotEncoder\n",
"\n",
"# Apply one-hot encoder to each column with categorical data\n",
"OH_encoder = OneHotEncoder(handle_unknown='ignore', sparse=False)\n",
"OH_encoder = OneHotEncoder(handle_unknown='ignore', sparse_output=False)\n",
"OH_cols_train = pd.DataFrame(OH_encoder.fit_transform(X_train[object_cols]))\n",
"OH_cols_valid = pd.DataFrame(OH_encoder.transform(X_valid[object_cols]))\n",
"\n",
Expand Down
2 changes: 1 addition & 1 deletion notebooks/time_series/raw/ex3.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -513,7 +513,7 @@
"# Scikit-learn solution\n",
"from sklearn.preprocessing import OneHotEncoder\n",
"\n",
"ohe = OneHotEncoder(sparse=False)\n",
"ohe = OneHotEncoder(sparse_output=False)\n",
"\n",
"X_holidays = pd.DataFrame(\n",
" ohe.fit_transform(holidays),\n",
Expand Down