Skip to content

Commit

Permalink
Merge pull request #247 from QuantEcon/skl-params
Browse files Browse the repository at this point in the history
Skl params
  • Loading branch information
doctor-phil authored May 29, 2024
2 parents 3194953 + b0a6ce6 commit 298f67f
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

2 comments on commit 298f67f

@github-actions
Copy link

Choose a reason for hiding this comment

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

@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.