How to use a KNN classifier from Matlab in c++

6 visualizaciones (últimos 30 días)
deams
deams el 29 de Mayo de 2017
Respondida: Bernhard Suhm el 20 de Sept. de 2018
Hi,
I have been tinkering with the machine learning toolbox in Matlab for a while. Now that I managed to get a good classifier, I would like to test it out of the lab. I was happy to see that Matlab has a built-in code generation tool, but it seems that KNN classifiers are not included.
How would I go about using the trained KNN from Matlab in a c++ program?
Would I have to write my own KNN implementation and use the parameters from the trained one in Matlab? If so, is there such an implementation already?

Respuestas (1)

Bernhard Suhm
Bernhard Suhm el 20 de Sept. de 2018
Little late, but with MATLAB Coder you can convert a prediction function for KNN to C/C++ code, and then use that with your other code for feature extraction (which you could write in MATLAB also, and then convert - for supported functions).

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by