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
I get unexpected predictions from the SVM module.
This example is taken from the docs:
x = Nx.tensor([[1.0, 2.0], [3.0, 2.0], [4.0, 7.0]]) y = Nx.tensor([1, 0, 1]) model = Scholar.Linear.SVM.fit(x, y, num_classes: 2) Scholar.Linear.SVM.predict(model, x)
#Nx.Tensor< s32[3] [1, 1, 1] >
I expected to see [1, 0, 1].
[1, 0, 1]
Here is a livebook demonstrating the behaviour https://gist.github.com/aymanosman/aa20b3832148260d257cf43e2d497cc4.
The text was updated successfully, but these errors were encountered:
Why do you believe this behaviour is expected? Looking at Python, I get the same behaviour:
>>> x = [[1.0, 2.0], [3.0, 2.0], [4.0, 7.0]] >>> y = [1, 0, 1] >>> clf = svm.SVC() >>> clf.fit(x, y) SVC() >>> clf.predict(x) array([1, 1, 1])
I think the small sample size and the unbalanced classes are not being helpful to draw the correct planes.
Sorry, something went wrong.
Because I am a n00b.
Although...
from sklearn.linear_model import SGDClassifier x = [[1.0, 2.0], [3.0, 2.0], [4.0, 7.0]] y = [1, 0, 1] clf = SGDClassifier() clf.fit(x, y) print(clf.predict(x)) # => [1 0 1]
No branches or pull requests
I get unexpected predictions from the SVM module.
This example is taken from the docs:
I expected to see
[1, 0, 1]
.Here is a livebook demonstrating the behaviour https://gist.github.com/aymanosman/aa20b3832148260d257cf43e2d497cc4.
The text was updated successfully, but these errors were encountered: