From 9b2c0e81c823ae2d942583aab3d191030717239b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20Geron?= Date: Tue, 14 Nov 2023 13:55:13 +1300 Subject: [PATCH] Rename sparse to sparse_output in OneHotEncoder --- 03_classification.ipynb | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/03_classification.ipynb b/03_classification.ipynb index e3f8b6f..1e7c768 100644 --- a/03_classification.ipynb +++ b/03_classification.ipynb @@ -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": {