ageron/handson-mlp

[bug] ordinal encoder example code incorrect?

開放

#32 建立於 2026年3月6日

 (2 則留言) (0 個反應) (1 位負責人)Jupyter Notebook (592 個分叉)github user discovery
bughelp wanted

倉庫指標

星標
 (1,827 顆星)
PR 合併指標
 (30 天內沒有已合併 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

貢獻者指南