Skip to content
This repository has been archived by the owner on May 25, 2024. It is now read-only.

One Class SVM just gives the wrong output #15

Open
Michel96w opened this issue Sep 21, 2022 · 1 comment
Open

One Class SVM just gives the wrong output #15

Michel96w opened this issue Sep 21, 2022 · 1 comment

Comments

@Michel96w
Copy link

Hello,
I train the One Class SVC in Python and port it to C++ as follows:
import micromlgen
from micromlgen import port
classmap = {
-1: 'Fault',
1: 'No fault'
}
c_code_OCSVM= port(one_class_svm)
modelfile= open('OCSVM.h', 'w')
modelfile.write(c_code_OCSVM)
modelfile.close()

I import the OCSVM as follows to the Arduino IDE, (Board: ESP32)
#include "OCSVM.h"

Eloquent::ML::Port::OneClassSVM clf;
void setup() {
Serial.begin(115200);
delay(2000);

float data [2] ={0.45,1.0};
Serial.println(clf.predict(data));
}

The Problem is, that "clf.predict(data)" gives another outout as "prediction = one_class_svm.predict(r)" in python.
Is soemthing missing in my Code?

@Shirsaa
Copy link

Shirsaa commented Apr 10, 2024

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?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants