Lines Matching refs:CvSVM
123 CvParamGrid CvSVM::get_default_grid( int param_id )
126 if( param_id == CvSVM::C )
132 else if( param_id == CvSVM::GAMMA )
138 else if( param_id == CvSVM::P )
144 else if( param_id == CvSVM::NU )
150 else if( param_id == CvSVM::COEF )
156 else if( param_id == CvSVM::DEGREE )
163 cvError( CV_StsBadArg, "CvSVM::get_default_grid", "Invalid type of parameter "
164 "(use one of CvSVM::C, CvSVM::GAMMA et al.)", __FILE__, __LINE__ );
170 svm_type(CvSVM::C_SVC), kernel_type(CvSVM::RBF), degree(0),
222 calc_func = params->kernel_type == CvSVM::RBF ? &CvSVMKernel::calc_rbf :
223 params->kernel_type == CvSVM::POLY ? &CvSVMKernel::calc_poly :
224 params->kernel_type == CvSVM::SIGMOID ? &CvSVMKernel::calc_sigmoid :
436 select_working_set_func = svm_type == CvSVM::NU_SVC || svm_type == CvSVM::NU_SVR ?
441 calc_rho_func = svm_type == CvSVM::NU_SVC || svm_type == CvSVM::NU_SVR ?
446 get_row_func = params->svm_type == CvSVM::EPS_SVR ||
447 params->svm_type == CvSVM::NU_SVR ? &CvSVMSolver::get_row_svr :
448 params->svm_type == CvSVM::C_SVC ||
449 params->svm_type == CvSVM::NU_SVC ? &CvSVMSolver::get_row_svc :
1135 CvSVM::CvSVM()
1150 CvSVM::~CvSVM()
1156 void CvSVM::clear()
1173 CvSVM::CvSVM( const CvMat* _train_data, const CvMat* _responses,
1189 int CvSVM::get_support_vector_count() const
1195 const float* CvSVM::get_support_vector(int i) const
1201 bool CvSVM::set_params( const CvSVMParams& _params )
1205 CvSVM::set_params" );
1269 void CvSVM::create_kernel()
1275 void CvSVM::create_solver( )
1282 bool CvSVM::train1( int sample_count, int var_count, const float** samples,
1288 //CV_FUNCNAME( "CvSVM::train1" );
1316 bool CvSVM::do_train( int svm_type, int sample_count, int var_count, const float** samples,
1321 CV_FUNCNAME( "CvSVM::do_train" );
1365 assert( svm_type == CvSVM::C_SVC || svm_type == CvSVM::NU_SVC );
1367 if( svm_type == CvSVM::C_SVC && params.class_weights )
1525 bool CvSVM::train( const CvMat* _train_data, const CvMat* _responses,
1533 CV_FUNCNAME( "CvSVM::train" );
1547 CV_CALL( cvPrepareTrainData( "CvSVM::train", _train_data, CV_ROW_SAMPLE,
1548 svm_type != CvSVM::ONE_CLASS ? _responses : 0,
1549 svm_type == CvSVM::C_SVC ||
1550 svm_type == CvSVM::NU_SVC ? CV_VAR_CATEGORICAL :
1590 bool CvSVM::train_auto( const CvMat* _train_data, const CvMat* _responses,
1602 CV_FUNCNAME( "CvSVM::train_auto" );
1617 if( _params.svm_type == CvSVM::ONE_CLASS )
1683 if( params.kernel_type != CvSVM::POLY )
1685 if( params.kernel_type == CvSVM::LINEAR )
1687 if( params.kernel_type != CvSVM::POLY && params.kernel_type != CvSVM::SIGMOID )
1689 if( svm_type == CvSVM::NU_SVC || svm_type == CvSVM::ONE_CLASS )
1691 if( svm_type == CvSVM::C_SVC || svm_type == CvSVM::EPS_SVR )
1693 if( svm_type != CvSVM::EPS_SVR )
1700 CV_CALL(cvPrepareTrainData( "CvSVM::train_auto", _train_data, CV_ROW_SAMPLE,
1701 svm_type != CvSVM::ONE_CLASS ? _responses : 0,
1702 svm_type == CvSVM::C_SVC ||
1703 svm_type == CvSVM::NU_SVC ? CV_VAR_CATEGORICAL :
1877 float CvSVM::predict( const CvMat* sample ) const
1884 CV_FUNCNAME( "CvSVM::predict" );
1972 void CvSVM::write_params( CvFileStorage* fs )
1974 //CV_FUNCNAME( "CvSVM::write_params" );
1982 svm_type == CvSVM::C_SVC ? "C_SVC" :
1983 svm_type == CvSVM::NU_SVC ? "NU_SVC" :
1984 svm_type == CvSVM::ONE_CLASS ? "ONE_CLASS" :
1985 svm_type == CvSVM::EPS_SVR ? "EPS_SVR" :
1986 svm_type == CvSVM::NU_SVR ? "NU_SVR" : 0;
1988 kernel_type == CvSVM::LINEAR ? "LINEAR" :
1989 kernel_type == CvSVM::POLY ? "POLY" :
1990 kernel_type == CvSVM::RBF ? "RBF" :
1991 kernel_type == CvSVM::SIGMOID ? "SIGMOID" : 0;
2006 if( kernel_type == CvSVM::POLY || !kernel_type_str )
2009 if( kernel_type != CvSVM::LINEAR || !kernel_type_str )
2012 if( kernel_type == CvSVM::POLY || kernel_type == CvSVM::SIGMOID || !kernel_type_str )
2017 if( svm_type == CvSVM::C_SVC || svm_type == CvSVM::EPS_SVR ||
2018 svm_type == CvSVM::NU_SVR || !svm_type_str )
2021 if( svm_type == CvSVM::NU_SVC || svm_type == CvSVM::ONE_CLASS ||
2022 svm_type == CvSVM::NU_SVR || !svm_type_str )
2025 if( svm_type == CvSVM::EPS_SVR || !svm_type_str )
2039 void CvSVM::write( CvFileStorage* fs, const char* name )
2041 CV_FUNCNAME( "CvSVM::write" );
2056 params.svm_type == CvSVM::ONE_CLASS ? 1 : 0;
2115 void CvSVM::read_params( CvFileStorage* fs, CvFileNode* svm_node )
2117 CV_FUNCNAME( "CvSVM::read_params" );
2135 strcmp( svm_type_str, "C_SVC" ) == 0 ? CvSVM::C_SVC :
2136 strcmp( svm_type_str, "NU_SVC" ) == 0 ? CvSVM::NU_SVC :
2137 strcmp( svm_type_str, "ONE_CLASS" ) == 0 ? CvSVM::ONE_CLASS :
2138 strcmp( svm_type_str, "EPS_SVR" ) == 0 ? CvSVM::EPS_SVR :
2139 strcmp( svm_type_str, "NU_SVR" ) == 0 ? CvSVM::NU_SVR : -1;
2159 strcmp( kernel_type_str, "LINEAR" ) == 0 ? CvSVM::LINEAR :
2160 strcmp( kernel_type_str, "POLY" ) == 0 ? CvSVM::POLY :
2161 strcmp( kernel_type_str, "RBF" ) == 0 ? CvSVM::RBF :
2162 strcmp( kernel_type_str, "SIGMOID" ) == 0 ? CvSVM::SIGMOID : -1;
2196 void CvSVM::read( CvFileStorage* fs, CvFileNode* svm_node )
2200 CV_FUNCNAME( "CvSVM::read" );
2355 src->params.svm_type == CvSVM::ONE_CLASS ? 1 : 0;
2598 if( kernel != CvSVM::POLY )
2601 if( kernel == CvSVM::LINEAR )
2604 if( kernel != CvSVM::POLY && kernel != CvSVM::SIGMOID )
2607 if( svm_type == CvSVM::NU_SVC || svm_type == CvSVM::ONE_CLASS )
2610 if( svm_type == CvSVM::C_SVC || svm_type == CvSVM::EPS_SVR )
2613 if( svm_type != CvSVM::EPS_SVR )