ageron / ageron/handson-ml3

[BUG] OneHotEncoder error

Open
#87 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Jupyter Notebook
Stars
14.1k
Forks
5.3k
PR merge metrics
No merged PRs in 30d

Description

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)
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.