Replace random_state=n_clusters with random_state=42, fixes #366

main
Aurélien Geron 2021-02-19 17:52:10 +13:00
parent 97af3c635b
commit 0eb31f77c2
1 changed files with 2 additions and 2 deletions

View File

@ -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",