From 0eb31f77c2215cff11840c1e021aa37850d9c14f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20Geron?= Date: Fri, 19 Feb 2021 17:52:10 +1300 Subject: [PATCH] Replace random_state=n_clusters with random_state=42, fixes #366 --- 09_unsupervised_learning.ipynb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/09_unsupervised_learning.ipynb b/09_unsupervised_learning.ipynb index 67283b1..aedfa4b 100644 --- a/09_unsupervised_learning.ipynb +++ b/09_unsupervised_learning.ipynb @@ -3416,7 +3416,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "It looks like the best number of clusters is quite high, at 100. You might have expected it to be 40, since there are 40 different people on the pictures. However, the same person may look quite different on different pictures (e.g., with or without glasses, or simply shifted left or right)." + "It looks like the best number of clusters is quite high, at 120. You might have expected it to be 40, since there are 40 different people on the pictures. However, the same person may look quite different on different pictures (e.g., with or without glasses, or simply shifted left or right)." ] }, { @@ -3573,7 +3573,7 @@ "\n", "for n_clusters in k_range:\n", " pipeline = Pipeline([\n", - " (\"kmeans\", KMeans(n_clusters=n_clusters, random_state=n_clusters)),\n", + " (\"kmeans\", KMeans(n_clusters=n_clusters, random_state=42)),\n", " (\"forest_clf\", RandomForestClassifier(n_estimators=150, random_state=42))\n", " ])\n", " pipeline.fit(X_train_pca, y_train)\n",