-
Notifications
You must be signed in to change notification settings - Fork 77
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
Move to enum Kernels instead of Structs for hypertuning #169
base: development
Are you sure you want to change the base?
Move to enum Kernels instead of Structs for hypertuning #169
Conversation
This is a breaking change, so may require more thought on the approach. |
Codecov Report
@@ Coverage Diff @@
## development #169 +/- ##
===============================================
+ Coverage 84.40% 84.47% +0.06%
===============================================
Files 86 86
Lines 9921 9927 +6
===============================================
+ Hits 8374 8386 +12
+ Misses 1547 1541 -6
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
please add the breaking change to the CHANGESLOG |
I think that having the I tried that approach in #181 Let me know if that is enough for your use case @montanalow On the other hand, it looks like the original test is failing. Can you check that in your branch?
|
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.
Please adapt these changes to the new code in development.
Kernel
is now an object-safe trait. Making an enum of Kernel
s had been a problem for me because a match expression needs to return the same type. I tried different options but for sure there is something I am missing:
pun enum Kernels {
Linear(LinearKernel),
RBF(RBFKernel)
...
}
match kernel {
Linear => LinearKernel::default(), // this returns a LinearKernel type
RBF => RBFkernel::default(), // this returns a RBFKernel type
...
}
SVCSearchParameters currently uses a Vec for kernels, which means you can't search across multiple kernel types at the same time. This PR converts K to an enum Kernel type, instead of a generic type, so that multiple kinds of kernels may be compared in the same grid search.