ageron/handson-ml3

[BUG] OneHotEncoder error

lookbusy1344 opened this issue · 0 comments

in 02_end_to_end these lines give an error:

cat_encoder = OneHotEncoder()
housing_cat_1hot = cat_encoder.fit_transform(housing_cat)

"Pandas output does not support sparse data."

The fix seems to be:

cat_encoder = OneHotEncoder(sparse_output=False)