nok / sklearn-porter

Transpile trained scikit-learn estimators to C, Java, JavaScript and others.
BSD 3-Clause "New" or "Revised" License
1.28k stars 170 forks source link

Using a nuSVC Model #4

Closed knseir closed 7 years ago

knseir commented 7 years ago

Hi, I know sklearn-porter doesn't support nu-SVCs, but those are mathematically equivalent to svm.SVC models (see http://scikit-learn.org/stable/modules/svm.html#nusvc). I was wondering if there was a workaround for this ? Thank you

nok commented 7 years ago

Hello @knseir,

thanks for the hint. I added the NuSVC classifier (\w tests) https://github.com/nok/sklearn-porter/commit/f8dbbf83a4fc9b74e2d1cd5575f4bdf65fd10e95 and pushed it to the master (development) branch. Now by using pip install https://github.com/nok/sklearn-porter/zipball/master you can install it locally.

Happy coding, Darius

knseir commented 7 years ago

Hi @nok , Thanks for the update! Just tried reinstalling the package with pip, it says it's up to date, porting the classifier still fails with The model is not an instance of a supported classifier or regressor.

nok commented 7 years ago

Yes, you have to remove the current version, try these steps:

pip uninstall -y sklearn-porter
pip install --no-cache-dir https://github.com/nok/sklearn-porter/zipball/master
knseir commented 7 years ago

Works perfectly, Thank you !