Skip to content

Commit

Permalink
Merge pull request #244 from odanoburu/patch-3
Browse files Browse the repository at this point in the history
Scikit-learn parameter renaming
  • Loading branch information
doctor-phil authored May 29, 2024
2 parents 3194953 + ac1b2ae commit b0a6ce6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lectures/applications/recidivism.md
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ sex_encoded = np.array([
Using `sklearn` it would be:

```{code-cell} python
ohe = preprocessing.OneHotEncoder(sparse=False)
ohe = preprocessing.OneHotEncoder(sparse_output=False)
sex_ohe = ohe.fit_transform(sex)
# This should shows 0s!
Expand All @@ -351,7 +351,7 @@ Finally, we split the data into training and validation (test) subsets.
```{code-cell} python
def prep_data(df, continuous_variables, categories, y_var, test_size=0.15):
ohe = preprocessing.OneHotEncoder(sparse=False)
ohe = preprocessing.OneHotEncoder(sparse_output=False)
y = df[y_var].values
X = np.zeros((y.size, 0))
Expand Down

1 comment on commit b0a6ce6

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.