ageron/handson-mlp

[bug] ordinal encoder example code incorrect?

オープン

#32 opened on 2026/03/06

 (2 件のコメント) (0 件のリアクション) (1 人の担当者)Jupyter Notebook (592 件のフォーク)github user discovery
bughelp wanted

Repository metrics

Stars
 (1,827 個のスター)
PR merge metrics
 (30d に merged PR はありません)

説明

Enter the chapter number

2

Enter the page number

encoding example within sklearn section

What is the cell's number in the notebook

na

Enter the environment you are using to run the notebook

Jupyter on Windows

Describe your issue

the following code: from sklearn.preprocessing import OrdinalEncoder

ordinal_encoder = OrdinalEncoder() housing_cat_encoded = ordinal_encoder.fit_transform(housing_cat)

seems like, instead of using housing_cat, the var used should be housing_full[["ocean_proximity"]]

Enter what you expected to happen

No response

If you found a workaround, describe it here

No response

コントリビューターガイド