-
-
Notifications
You must be signed in to change notification settings - Fork 25.9k
SVC: Do not enforce that input data is of type np.float64 #10713
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
Comments
This also happens when I try to call scikit-learn/sklearn/metrics/pairwise.py Line 1104 in 0a85111
|
I agree that it is absurd if we do not accommodate unstructured data for
kernel methods. A fix is welcome.
In the meantime, I hope you are able to use precomputed kernels
|
We could just fix this specific case, or somehow create a common tests that if an estimator can fit with metric/affinity/kernel=some_function for numeric input that it will also allow text input and some basic text kernel (#common characters) or metric (? edit distance) |
Can I take this if any one else is not working on it? |
Since |
Good point. Sigh. Though if we use dtype=None, then they'll still get a
numeric array (except if the input is decimal strings, but that's a weird
case), but not certainly float64.
|
So I think if X has a numeric dtype, we can cast it to float64.
…On 27 February 2018 at 16:17, Joel Nothman ***@***.***> wrote:
Good point. Sigh. Though if we use dtype=None, then they'll still get a
numeric array (except if the input is decimal strings, but that's a weird
case), but not certainly float64.
|
Yes, that is it. But for the decimal strings case, It's unlikely used by many users and not in the documents. Not sure we should ignore this case (just leave all text input unchanged) or do something else. |
I'm happy to ignore the decimal numbers case. This is a bigger issue.
|
I am writing a text classification algorithm that uses an SVM based on tree kernels. I have the following code:
where
X_train
contains some text columns. Unfortunately this is erroring out at the following line:scikit-learn/sklearn/svm/base.py
Line 147 in 49da6c8
Please fix so that if a callable is passed for the
kernel
argument, this restriction is not enforced.The text was updated successfully, but these errors were encountered: