I have a .mat file which could be easily read by matlab, but I need to convert it a C++ readable .model file. is there a way to do it (by hands, or maybe programmatically)?
相关问题
- Sorting 3 numbers without branching [closed]
- Extract matrix elements using a vector of column i
- How to compile C++ code in GDB?
- Why does const allow implicit conversion of refere
- thread_local variables initialization
相关文章
- 关于使用SVM进行AE信号分类的问题
- How to replace file-access references for a module
- Class layout in C++: Why are members sometimes ord
- How to mock methods return object with deleted cop
- Which is the best way to multiply a large and spar
- C++ default constructor does not initialize pointe
- Selecting only the first few characters in a strin
- What exactly do pointers store? (C++)
You could load the data matrix in MATLAB as any regular MAT-file:
then use the MEX function
libsvmwrite
which comes with the libsvm MATLAB interface, to write it to the so called "sparse" format:If you are talking about trained models not data, a quick search revealed this page (I haven't personally tested it).
EDIT:
Ok, it appears that the code I mentioned needs some tweaking. Below is my modified version. I tested it using the latest libSVM-3.12, with VS2010 as compiler:
svm_savemodel.c
Assuming you compiled the above MEX file, here is an example usage:
The text file created looks like:
mymodel.model