Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- init_shogun_with_defaults();
- SGMatrix<float> shogun_testdata=CV2SGFactory::get_sgmatrix<float>(features);
- SGMatrix<float>::transpose_matrix(shogun_testdata.matrix, shogun_testdata.num_rows, shogun_testdata.num_cols);
- CDenseFeatures<float>* testfeatures=new CDenseFeatures<float>(shogun_testdata);
- SGVector<float64_t> shogun_vector_response(6);
- for(int i=0;i<6;i++){
- shogun_vector_response[i]=i;
- }
- CLinearKernel* kernel = new CLinearKernel();
- kernel->init(testfeatures,testfeatures);
- CMulticlassLibSVM* shogunsvm=new CMulticlassLibSVM(10, kernel,new CMulticlassLabels(shogun_vector_response));
- FILE* f=fopen(model.c_str(),"r");
- if (f!=NULL)
- {
- shogunsvm->load(f);
- cout << "start predict" << endl;
- CMulticlassLabels* labels=shogunsvm->apply_multiclass();
- fclose(f);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement