Skip to content

MiniBatchKMeans partial_fit uninformative error message when number of features changes #12430

New issue

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

Closed
jeremiedbb opened this issue Oct 22, 2018 · 1 comment

Comments

@jeremiedbb
Copy link
Member

I find the error message, raised when the number of features changes between calls to partial_fit in MiniBatchKMeans, a bit uninformative. See

from sklearn.cluster import MiniBatchKMeans
import numpy as np

X = np.random.random_sample((100,10))
mbk = MiniBatchKMeans()

mbk.partial_fit(X)
mbk.partial_fit(X[:,:-1])

>>> "ValueError: Incompatible dimension for X and Y matrices: X.shape[1] == 9 while Y.shape[1] == 10"

I understand that the error comes from a shape mismatch somewhere but it could be more informative (what is Y here ?), or am I just being too picky ?

@ogrisel
Copy link
Member

ogrisel commented Jul 22, 2020

Closed by #13603.

@ogrisel ogrisel closed this as completed Jul 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants