simonpcouch / rinfa

Rust bindings for tidymodels [experimental]
https://simonpcouch.github.io/rinfa/
Other
7 stars 1 forks source link

support other SVM kernels #5

Open simonpcouch opened 3 months ago

simonpcouch commented 3 months ago

The choice of SVM kernel is hard-coded into our rust source:

https://github.com/simonpcouch/rinfa/blob/709b7882bfbec5e97d256dd4c1d9fa9358e176b8/src/rust/src/svm.rs#L36

It'd be pretty straightforward to copy that fit_svm_linear function and switch out the kernel to support svm_rbf() and svm_poly(), but I'd prefer to reduce code duplication here. Is there any way we could just pass a string and switch() it to the right parameter function from linfa?

simonpcouch commented 3 months ago

Ah, a complicating factor may be that different kernels support different additional arguments.