-
-
Notifications
You must be signed in to change notification settings - Fork 252
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
Iter fold #77
Iter fold #77
Conversation
removed fit dataset lifetime, finished fold_fit tentative trait impl for kernel adjusted svm for iter_fold
Codecov Report
@@ Coverage Diff @@
## master #77 +/- ##
==========================================
- Coverage 54.49% 54.02% -0.47%
==========================================
Files 62 63 +1
Lines 4318 4583 +265
==========================================
+ Hits 2353 2476 +123
- Misses 1965 2107 +142
Continue to review full report at Codecov.
|
thanks! I will look into this in the next days :) |
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.
okay I added some comments on the PR. This is really awesome work 👍
I think it would be better to separate Kernel
from Dataset
in order to resolve the ambiguities between Kernel
and OwnedKernel
. I added some comments how this can be realized.
After merging this, I will investigate how to simplify the API with Borrow
you still have to remove the commented parameters, but for my part we can merge this |
my bad, I forgot to remove them 👍🏻 |
This PR introduces the iter_fold method for k_folding. The main points are:
Linfa/src
Fit
trait to remove training set lifetimeLinfa-kernel
Inner
to represent an inner matrix. Implementors of this trait are:Array2
,ArrayView2
,CsMat
,CsMatView
KernelInner
now takes twoInner
as parameters, one for the dense implementation and one for the sparse implementationKernel
toKernelBase
, which now takes the two Inner types for theKernelInner
enumKernel<'a, F>
which is a kernel that keeps the data in anArrayView2
and has an owned inner matrix (the most common case)KernelOwned<F>
for which the data is owned tooKernelView<'a, F>
which has a view on both its data and inner matrixview()
andto_owned()
to switch between the various typesThis was done to be able to have both a kernel that borrows data with a lifetime and one that owns it with just one struct
Linfa-svm
Svm
owns the kernel data (via aKernelOwned
attribute)Fit
definition and kernel typesiter_fold
both for regression and classification to show that it worksOther sub crates
Fit
definition and kernel typesThis doesn't address the points on #70 about the
Dynamic
Kernel type and Svm that only keeps its support vectors because I wanted to have a solid and approved basis before doing any additional work.