Add a note about the fact that KMeans init changed in Scikit-Learn 1.3 so results will differ

main
Aurélien Geron 2023-11-14 16:34:39 +13:00
parent 1dd8dba21d
commit 8c0ab41ed9
1 changed files with 3 additions and 1 deletions

View File

@ -3322,7 +3322,9 @@
"cell_type": "markdown", "cell_type": "markdown",
"metadata": {}, "metadata": {},
"source": [ "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."
] ]
}, },
{ {