Rename sparse to sparse_output in OneHotEncoder
parent
c919a818f5
commit
9b2c0e81c8
|
@ -3146,6 +3146,13 @@
|
||||||
"from sklearn.preprocessing import OrdinalEncoder, OneHotEncoder"
|
"from sklearn.preprocessing import OrdinalEncoder, OneHotEncoder"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "markdown",
|
||||||
|
"metadata": {},
|
||||||
|
"source": [
|
||||||
|
"Note: the `sparse` hyperparameter below was renamed to `sparse_output`."
|
||||||
|
]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"cell_type": "code",
|
"cell_type": "code",
|
||||||
"execution_count": 116,
|
"execution_count": 116,
|
||||||
|
@ -3155,7 +3162,7 @@
|
||||||
"cat_pipeline = Pipeline([\n",
|
"cat_pipeline = Pipeline([\n",
|
||||||
" (\"ordinal_encoder\", OrdinalEncoder()), \n",
|
" (\"ordinal_encoder\", OrdinalEncoder()), \n",
|
||||||
" (\"imputer\", SimpleImputer(strategy=\"most_frequent\")),\n",
|
" (\"imputer\", SimpleImputer(strategy=\"most_frequent\")),\n",
|
||||||
" (\"cat_encoder\", OneHotEncoder(sparse=False)),\n",
|
" (\"cat_encoder\", OneHotEncoder(sparse_output=False)),\n",
|
||||||
" ])"
|
" ])"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
@ -4570,7 +4577,7 @@
|
||||||
],
|
],
|
||||||
"metadata": {
|
"metadata": {
|
||||||
"kernelspec": {
|
"kernelspec": {
|
||||||
"display_name": "Python 3",
|
"display_name": "Python 3 (ipykernel)",
|
||||||
"language": "python",
|
"language": "python",
|
||||||
"name": "python3"
|
"name": "python3"
|
||||||
},
|
},
|
||||||
|
@ -4584,7 +4591,7 @@
|
||||||
"name": "python",
|
"name": "python",
|
||||||
"nbconvert_exporter": "python",
|
"nbconvert_exporter": "python",
|
||||||
"pygments_lexer": "ipython3",
|
"pygments_lexer": "ipython3",
|
||||||
"version": "3.10.6"
|
"version": "3.10.13"
|
||||||
},
|
},
|
||||||
"nav_menu": {},
|
"nav_menu": {},
|
||||||
"toc": {
|
"toc": {
|
||||||
|
|
Loading…
Reference in New Issue