From 8c0ab41ed96b2862af9f675f774882cccb14830f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20Geron?= Date: Tue, 14 Nov 2023 16:34:39 +1300 Subject: [PATCH] Add a note about the fact that KMeans init changed in Scikit-Learn 1.3 so results will differ --- 02_end_to_end_machine_learning_project.ipynb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/02_end_to_end_machine_learning_project.ipynb b/02_end_to_end_machine_learning_project.ipynb index 34c45e7..b3d2320 100644 --- a/02_end_to_end_machine_learning_project.ipynb +++ b/02_end_to_end_machine_learning_project.ipynb @@ -3322,7 +3322,9 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "Note: The default value for the `n_init` hyperparameter above will change from 10 to `\"auto\"` in Scikit-Learn 1.4, so I'm setting it explicitly to 10 to keep this notebook stable." + "**Warning**:\n", + "* There was a change in Scikit-Learn 1.3.0 which affected the random number generator for `KMeans` initialization. Therefore the results will be different than in the book if you use Scikit-Learn ≥ 1.3. That's not a problem as long as you don't expect the outputs to be perfectly identical.\n", + "* Throughout this notebook, when `n_init` was not set when creating a `KMeans` estimator, I explicitly set it to `n_init=10` to avoid a warning about the fact that the default value for this hyperparameter will change from 10 to `\"auto\"` in Scikit-Learn 1.4." ] }, {