[Exercise: Categorical Variables] FutureWarning: Feature names only support names that are all strings
- Dominant language
- Jupyter Notebook
- Stars
- 514
- Forks
- 274
- PR merge metrics
- No merged PRs in 30d
Description
In the last code cell
```py
print("MAE from Approach 3 (One-Hot Encoding):")
print(score_dataset(OH_X_train, OH_X_valid, y_train, y_valid))
```
This shows
```
MAE from Approach 3 (One-Hot Encoding):
/opt/conda/lib/python3.7/site-packages/sklearn/utils/validation.py:1692: FutureWarning: Feature names only support names that are all strings. Got feature names with dtypes: ['int', 'str']. An error will be raised in 1.2.
FutureWarning,
17525.345719178084
/opt/conda/lib/python3.7/site-packages/sklearn/utils/validation.py:1692: FutureWarning: Feature names only support names that are all strings. Got feature names with dtypes: ['int', 'str']. An error will be raised in 1.2.
FutureWarning,
```
Adding these to step4 can fix
```py
OH_cols_train.columns = list(map(str, OH_cols_train.columns))
OH_cols_valid.columns = list(map(str, OH_cols_valid.columns))
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.