handson-ml3 icon indicating copy to clipboard operation
handson-ml3 copied to clipboard

[BUG] OneHotEncoder error

Open lookbusy1344 opened this issue 1 year ago • 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)

lookbusy1344 avatar Jul 05 '23 11:07 lookbusy1344