1 | initial version |
I am currently working with LibSVM and Visual Studio 2010 anc C++.
What I did is the following:
Copy and paste svm.h and svm.cpp into my Visual Studio project. I am currently using versión 3.1 (#define LIBSVM_VERSION 310)
Maybe you need to include "#pragma once" directive to cause the current source file to be included only once in svm.h file, and #include "StdAfx.h" in the svm.cpp file. (At least is what i did).
In order to access to svm-train.c, svm-scale.c and svm-predict.c what i did is the following. I carefully copy the code of these files into one file "svmutils". And then what i did is to eliminate the main function of each one. But you must do the same functionality that is done in the main functions. For example, in the main funtion of the svm-train.c the code is something like this:
int main(int argc, char **argv) { ... parse_command_line(argc, argv, input_file_name, model_file_name); ... model = svm_train(&prob,¶m); ... }
You must change this, because if you want to call svm_train function inside your program, you don't have argc, or argv parameters.
2 | No.2 Revision |
I am currently working with LibSVM and Visual Studio 2010 anc and C++.
What I did is the following:
Copy and paste svm.h and svm.cpp into my Visual Studio project. I am currently using versión 3.1 (#define LIBSVM_VERSION 310)
Maybe you need to include "#pragma once" directive to cause the current source file to be included only once in svm.h file, and #include "StdAfx.h" in the svm.cpp file. (At least is what i did).
In order to access to svm-train.c, svm-scale.c and svm-predict.c what i did is the following. I carefully copy the code of these files into one file "svmutils". And then what i did is to eliminate the main function of each one. But you must do the same functionality that is done in the main functions. For example, in the main funtion of the svm-train.c the code is something like this:
int main(int argc, char **argv) { ... parse_command_line(argc, argv, input_file_name, model_file_name); ... model = svm_train(&prob,¶m); ... }
You must change this, because if you want to call svm_train function inside your program, you don't have argc, or argv parameters.
3 | No.3 Revision |
I am currently working with LibSVM and LibSVM, Visual Studio 2010 and C++.
What I did is the following:
Copy and paste svm.h and svm.cpp into my Visual Studio project. I am currently using versión 3.1 (#define LIBSVM_VERSION 310)
Maybe you need to include "#pragma once" directive to cause the current source file to be included only once in svm.h file, and #include "StdAfx.h" in the svm.cpp file. (At least is what i did).
In order to access to svm-train.c, svm-scale.c and svm-predict.c what i did is the following. I carefully copy the code of these files into one file "svmutils". And then what i did is to eliminate the main function of each one. But you must do the same functionality that is done in the main functions. For example, in the main funtion of the svm-train.c the code is something like this:
int main(int argc, char **argv) { ... parse_command_line(argc, argv, input_file_name, model_file_name); ... model = svm_train(&prob,¶m); ... }
You must change this, because if you want to call svm_train function inside your program, you don't have argc, or argv parameters.
4 | No.4 Revision |
I am currently working with LibSVM, Visual Studio 2010 and C++.
What I did is the following:
Copy and paste svm.h and svm.cpp into my Visual Studio project. I am currently using versión 3.1 (#define LIBSVM_VERSION 310)
Maybe you need to include "#pragma once" directive to cause the current source file to be included only once in svm.h file, and #include "StdAfx.h" in the svm.cpp file. (At least is what i did).
In order to access to svm-train.c, svm-scale.c and svm-predict.c what i did is the following. I carefully copy the code of these files into one file "svmutils". And then what i did is to eliminate the main function of each one. But you must do the same functionality that is done in the main functions. For example, in the main funtion of the svm-train.c the code is something like this:
int main(int argc, char **argv) { ... parse_command_line(argc, argv, input_file_name, model_file_name); ... model = svm_train(&prob,¶m); ... }
You must change this, because if you want to call svm_train function inside your program, you don't have argc, or argv parameters.
EDIT
I you want to call "grid.py" file inside your project in order to find the best svm parameters (cross-validation, and so on), you can do something like this:
void findBestSVMParameters(string fileResult){
char grid[] = "./tools/grid.py";
_spawnl(P_WAIT,"C:\\Python27\\python.exe","C:\\Python27\\python.exe", grid, file_result.c_str(), NULL);
}
where fileResult is the file with the operator scale data.