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