We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
In notebook 03-unsupervised-learning
X_train, X_test, y_train, y_test = train_test_split( X_people, y_people, stratify=y_people, random_state=0) nmf = NMF(n_components=100, random_state=0) nmf.fit(X_train) pca = PCA(n_components=100, random_state=0) pca.fit(X_train) kmeans = KMeans(n_clusters=100, random_state=0) kmeans.fit(X_train) X_reconstructed_pca = pca.inverse_transform(pca.transform(X_test)) X_reconstructed_kmeans = kmeans.cluster_centers_[kmeans.predict(X_test)] X_reconstructed_nmf = np.dot(nmf.transform(X_test), nmf.components_)
Maybe we can change
X_reconstructed_nmf = np.dot(nmf.transform(X_test), nmf.components_)
to
X_reconstructed_nmf = nmf.inverse_transform(nmf.transform(X_test))
This will be more consistent with pca and I guess it's better to rely on scikit-learn API
The text was updated successfully, but these errors were encountered:
Yeah, good idea. I had opened the issue for adding this scikit-learn/scikit-learn#6118 as a reaction to writing this code ;)
So when I wrote this, the feature wasn't there, but now it can be fixed.
Sorry, something went wrong.
No branches or pull requests
In notebook 03-unsupervised-learning
Maybe we can change
to
This will be more consistent with pca and I guess it's better to rely on scikit-learn API
The text was updated successfully, but these errors were encountered: