You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"for name, estimator, center in estimators:\n print(\"Extracting the top %d %s...\" % (n_components, name))\n t0 = time()\n data = faces\n if center:\n data = faces_centered\n estimator.fit(data)\n train_time = (time() - t0)\n print(\"done in %0.3fs\" % train_time)\n if hasattr(estimator, 'cluster_centers_'):\n components_ = estimator.cluster_centers_\n else:\n components_ = estimator.components_\n if hasattr(estimator, 'noise_variance_'):\n plot_gallery(\"Pixelwise variance\",\n estimator.noise_variance_.reshape(1, -1), n_col=1,\n n_row=1)\n plot_gallery('%s - Train time %.1fs' % (name, train_time),\n components_[:n_components])\n\nplt.show()"
110
+
"for name, estimator, center in estimators:\n print(\"Extracting the top %d %s...\" % (n_components, name))\n t0 = time()\n data = faces\n if center:\n data = faces_centered\n estimator.fit(data)\n train_time = (time() - t0)\n print(\"done in %0.3fs\" % train_time)\n if hasattr(estimator, 'cluster_centers_'):\n components_ = estimator.cluster_centers_\n else:\n components_ = estimator.components_\n\n # Plot an image representing the pixelwise variance provided by the\n # estimator e.g its noise_variance_ attribute. The Eigenfaces estimator,\n # via the PCA decomposition, also provides a scalar noise_variance_\n # (the mean of pixelwise variance) that cannot be displayed as an image\n # so we skip it.\n if (hasattr(estimator, 'noise_variance_') and\n estimator.noise_variance_.ndim > 0): # Skip the Eigenfaces case\n plot_gallery(\"Pixelwise variance\",\n estimator.noise_variance_.reshape(1, -1), n_col=1,\n n_row=1)\n plot_gallery('%s - Train time %.1fs' % (name, train_time),\n components_[:n_components])\n\nplt.show()"
0 commit comments