-
Notifications
You must be signed in to change notification settings - Fork 2
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
Allow kernel
to be callable, fix some sloppy implementation of the MLJ interface; add docstrings
#13
Conversation
Codecov Report
@@ Coverage Diff @@
## master #13 +/- ##
==========================================
+ Coverage 88.23% 90.90% +2.67%
==========================================
Files 1 1
Lines 153 176 +23
==========================================
+ Hits 135 160 +25
+ Misses 18 16 -2
Continue to review full report at Codecov.
|
kernel
to be callablekernel
to be callable and fix some sloppy implementation of the MLJ interface; add docstrings
kernel
to be callable and fix some sloppy implementation of the MLJ interface; add docstringskernel
to be callable, fix some sloppy implementation of the MLJ interface; add docstrings
Erstwhile maintainers of LIBSVM.jl: @iblis17 @barucden @till-m @mpastell. This PR adds detailed document strings to the models constituting an MLJ interface to LIBSVM.jl . I wonder if any of you have time in the next week or so to look over these strings, which appear at the end of the file MLJLIBSVMInterface.jl . Familiarity with MLJ would be helpful, but hardly essential. I'm mainly interested in low-level editorial comments and that the descriptions of model hyper-parameters (taken mostly from scikit-learn) are correct. In return, I would be happy to update the LIBSVM.jl readme with guidance on using the MLJ interface. The MLJ doc-string standard is here. |
@OkonSamuel Perhaps, some time over the next week you can look over the code (don't worry about the doc-strings). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Besides that one missing parenthesis, I couldn't spot any apparent problem.
Consider adding a note regarding the serialization of the trained model when a user-defined kernel was used (see, e.g., my comment that shows the limitation). I believe this has not been targeted in LIBSVM.jl yet, so if it's not already covered in MLJ on the general level somehow, I think there should be a note for it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't really find anything noteworthy either. Comments are just small things that caught my eye.
I also noticed that attempting to use Kernel.Precomputed
now throws an error. Is there a particular reason for not supporting pre-computed kernels?
@barucden says:
Done, thanks! |
@till-m says:
No, it is unlikely MLJ will support this soon as it requires adjustments to the API that would be special to SVM (at present). |
In this PR we:
update the compatibility requirement of LIBSVM.jl to the latest version
(enhancement) Allow the
kernel
hyper-parameter to be a function or other callable(breaking) Overload
fitted_params
of all models so as to be more user-friendly(breaking) Remove a number of superfluous hyper-parameters (hyper-parameters whose values are ignored internally):
p
fromLinearSVC
(alias forϵ
in the cited paper) which is only defined for regression modelscost
fromNuSVC
(alias forC
in cited paper) which is redundant asnu
is a re-parameterization of itcost
fromOneClassSVM
(again,nu
is used instead)(breaking) Re-implement
OneClassSVM
as aUnsupervisedDetector
satisfying MLJ's API for such models. In particular,transform(mach, Xnew)
now returns raw outlier scores. To extract normalised probabilities or for threshold outlier classification, refer to the new document string.(breaking) Re-implement
SVC
andLinearSVC
so that optional class weight dictionaries are specified along with the training data, and fix bugs in how these were interpreted internally. Remove weight support forNuSVC
asLIBSVM.jl
does not appear to support it.(enhancement) Add MLJ-compliant document strings to all models, with detailed examples
My apologies for combining so much in a single PR. The original intention was just to update document strings. The issues were revealed only progressively as I worked through these.