-
Notifications
You must be signed in to change notification settings - Fork 27
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
add LIBSVM #19
add LIBSVM #19
Conversation
Thanks for that!!
No. You don't need to register to test. You have simply forgotten to add
I suggest you use names that are as consistent as possible with the LIBSVM docs. MLJ has no problem with duplicate model names. You just can't simultaneously load two models with the same name from different packages - you can load one or the other.
I expect we should regard this as unsupervised learning (unless there appears some dissent at JuliaAI/MLJ.jl#51 (comment)), so use mutable struct OneClassSVM <: MLJBase.Unsupervised instead of mutable struct OneClassSVM <: MLJBase.Deterministic And you should probably rename your output_scitype_union(::Type{OneClassSVM})) = MLJBase.Finite{2} (unsupervised learners have "outputs" rather than "targets"). Incidentally, the |
didn't quite understand why it didn't work before but works now
Brilliant!! Thanks for this contribution. It has been argued JuliaAI/MLJ.jl#51 (comment) that one-class classification is neither supervised or unsupervised and I am happy to concur with this opinion. So we will probably create a new category. For now, I think we can safely leave this as unsupervised. I will proceed with registering LIBSVM.jl with MLJRegistry, to make the new models findable by all MLJ users. This will also be our first opportunity to test loading model code for models with names duplicated in separate packages. Will close #19 when this testing is complete. Again many thanks. |
Now registered. Appears to work: julia> using MLJ
julia> models()["LIBSVM"]
6-element Array{Any,1}:
"EpsilonSVR"
"LinearSVC"
"NuSVR"
"NuSVC"
"SVC"
"OneClassSVM"
julia> @load SVC
import MLJModels ✔
import LIBSVM ✔
import MLJModels.LIBSVM_.SVC ✔
julia> mach = machine(SVC(), shuffle!(load_iris()))
Machine{SVC} @ 8…90
julia> evaluate!(mach)
┌ Info: Evaluating using cross-validation.
│ nfolds=6.
│ shuffle=false
│ measure=MLJ.misclassification_rate
│ operation=StatsBase.predict
└ Resampling from all rows.
Cross-validating: 100%[=========================] Time: 0:00:03
6-element Array{Float64,1}:
0.0
0.0
0.04
0.12
0.0
0.08 |
Will now make a new release of MLJModels |
Added LIBSVM. A few notes: