Feature Weight Adjustment with SVM
I want to use Support Vector Machine to adjust the class weight of my
features (zhere are 7 features in my test datas). Is there a method to
extract the optimized class weights from the SVM?
I've tested:
CvSVMParams params;
params.svm_type = CvSVM::C_SVC;
params.kernel_type = CvSVM::LINEAR;
params.term_crit = cvTermCriteria(CV_TERMCRIT_ITER, 100, 1e-6);
CvSVM SVM;
SVM.train_auto(trainingDataMat, labelsMat, Mat(), Mat(), params);
CvSVMParams optimized=SVM.get_params();
CvMat* weights=optimized.class_weights;
qDebug()<<weights->cols;
But then, the programm crashes
greetings
No comments:
Post a Comment