-
-
Notifications
You must be signed in to change notification settings - Fork 25.2k
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
ValueError: Buffer dtype mismatch, expected 'DOUBLE' but got 'long long' #1709
Comments
X_train_scaled = scaler.fit_transform(X=X_train.astype(np.float)) should do it. Flagging this as a bug as first raising a warning and then crashing is weird. Also, I think this should do the conversion internally. |
Thanks, @amueller, that did the trick. I was thinking as well that this conversion should be done internally as the users cannot know about it, that's why I asked. But at least you now know that you might fix this in a later release. :) |
ping @GaelVaroquaux should we convert? I would prefer to warn and convert - I guess this is to much magic for you? |
for dense array it currently rounds btw. |
This looks like a useful pipeline scenario. If we don't convert automatically, there is no way to make this work in a pipeline without writing a converting transformer, which is awkward. |
Convert is fine: this is what we have been doing silently (and what numpy |
should I then also change the behavior for dense? that did not convert until now. It warned and rounded - which is not very helpful in a pipeline as @vene pointed out. |
"long long" is an integer right? I think that converting to flloat implicitly (and mentioning the change of behavior in the release notes) is good. |
ok, I'll do it. |
Thanks |
+1 as well. |
closed by #2271. Thanks for the report @pemistahl |
In scikit-learn 0.13.0, I'm trying to use the class
sklearn.preprocessing.StandardScaler
to scale my data for being used in an SVM classifier of classsklearn.svm.LinearSVC
. The essential parts of my code are the following:Unfortunately, an exception is raised by the line
X_train_scaled = scaler.fit_transform(X=X_train)
. This is the relevant part of the stacktrace:Do I have to change the
dtype
myself? If so, how do I do that? Thank youlThe text was updated successfully, but these errors were encountered: