eloquentarduino / micromlgen

Generate C code for microcontrollers from Python's sklearn classifiers
MIT License
187 stars 35 forks source link

Decision function computed doesn't match with sklearn.svm.SVC #14

Open aravindsiv opened 2 years ago

aravindsiv commented 2 years ago

Hi,

I train my SVC in Python and port it to C++ as follows:

with open(fname, "w") as f: f.write(port(clf))

However, the decision function computed by clf.decision_function(X) (in Python) and the one computed inside Eloquent::ML::Port::SVM::predict (in the generated header file) do not match. The predictions do not match.

Is there something I'm missing?

Shirsaa commented 7 months ago

hi, i am also using micromlgen to convert my RF regression into C++ code. but the generated code gives different and wrong results as compared to the python code i had written. it is giving a single output for every input given to it which in fact is wrong.

Can someone tell me what went wrong?