-
Notifications
You must be signed in to change notification settings - Fork 35
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
Code in Readme.md does not work. #90
Comments
@kazucmpt Thanks for reporting. It looks to me that you have mixed the README.md example code with some MLJ code?? The LIBSVM package does not have a The train/prediction code on the README looks like this: # Train SVM on half of the data using default parameters. See documentation
# of svmtrain for options
model = svmtrain(Xtrain, ytrain)
# Test model on the other half of the data.
ŷ, decision_values = svmpredict(model, Xtest);
# Compute accuracy
@printf "Accuracy: %.2f%%\n" mean(ŷ .== ytest) * 100 Are you wanting to train this model in MLJ? I could provide guidance if you want. |
Thank you for your quick reply. https://stackoverflow.com/questions/62594396/how-should-i-train-a-svm-using-julia/70838091#70838091 |
@iblis17 Perhaps this should be re-opened. I haven't checked, but it seems from the thread cited in the previous comment that there is a problem (and the same thread proposes a correction). |
Thanks for the confirmation, @till-m ! |
It would be very useful/helpful to provide some example code to use it via MLJ, let's say on the iris dataset as an example. ta! |
using MLJ
SVC = @load SVC pkg=LIBSVM # load code defining model type
model = SVC() # model instance
# split data
y, X = unpack(iris, ==(:class))
# fit data
mach = machine(model, X, y) |> fit!
# predict
julia> predict(mach, X)[1]
CategoricalArrays.CategoricalValue{String, UInt32} "Iris-setosa" |
I use
julia 1.6.1
I installed LIBSVM.jl in Ubuntu as
] add LIBSVM
After that, I run the following source code in README.md.
But I get the following error.
The text was updated successfully, but these errors were encountered: