minor change (moved methods implementation from hpp to cpp)
This commit is contained in:
parent
74f1162a41
commit
0209d72534
@ -2094,18 +2094,16 @@ public:
|
|||||||
// 1 - file can not be opened or is not correct
|
// 1 - file can not be opened or is not correct
|
||||||
int read_csv( const char* filename );
|
int read_csv( const char* filename );
|
||||||
|
|
||||||
const CvMat* get_values(){ return values; }
|
const CvMat* get_values();
|
||||||
|
|
||||||
const CvMat* get_responses();
|
const CvMat* get_responses();
|
||||||
|
const CvMat* get_missing();
|
||||||
const CvMat* get_missing(){ return missing; }
|
|
||||||
|
|
||||||
void set_response_idx( int idx ); // old response become predictors, new response_idx = idx
|
void set_response_idx( int idx ); // old response become predictors, new response_idx = idx
|
||||||
// if idx < 0 there will be no response
|
// if idx < 0 there will be no response
|
||||||
int get_response_idx() { return response_idx; }
|
int get_response_idx();
|
||||||
|
|
||||||
const CvMat* get_train_sample_idx() { return train_sample_idx; }
|
const CvMat* get_train_sample_idx();
|
||||||
const CvMat* get_test_sample_idx() { return test_sample_idx; }
|
const CvMat* get_test_sample_idx();
|
||||||
void mix_train_and_test_idx();
|
void mix_train_and_test_idx();
|
||||||
void set_train_test_split( const CvTrainTestSplit * spl );
|
void set_train_test_split( const CvTrainTestSplit * spl );
|
||||||
|
|
||||||
@ -2113,7 +2111,7 @@ public:
|
|||||||
void chahge_var_idx( int vi, bool state ); // state == true to set vi-variable as predictor
|
void chahge_var_idx( int vi, bool state ); // state == true to set vi-variable as predictor
|
||||||
|
|
||||||
const CvMat* get_var_types();
|
const CvMat* get_var_types();
|
||||||
int get_var_type( int var_idx ) { return var_types->data.ptr[var_idx]; }
|
int get_var_type( int var_idx );
|
||||||
// following 2 methods enable to change vars type
|
// following 2 methods enable to change vars type
|
||||||
// use these methods to assign CV_VAR_CATEGORICAL type for categorical variable
|
// use these methods to assign CV_VAR_CATEGORICAL type for categorical variable
|
||||||
// with numerical labels; in the other cases var types are correctly determined automatically
|
// with numerical labels; in the other cases var types are correctly determined automatically
|
||||||
@ -2123,10 +2121,10 @@ public:
|
|||||||
void change_var_type( int var_idx, int type); // type in { CV_VAR_ORDERED, CV_VAR_CATEGORICAL }
|
void change_var_type( int var_idx, int type); // type in { CV_VAR_ORDERED, CV_VAR_CATEGORICAL }
|
||||||
|
|
||||||
void set_delimiter( char ch );
|
void set_delimiter( char ch );
|
||||||
char get_delimiter() { return delimiter; }
|
char get_delimiter();
|
||||||
|
|
||||||
void set_miss_ch( char ch );
|
void set_miss_ch( char ch );
|
||||||
char get_miss_ch() { return miss_ch; }
|
char get_miss_ch();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual void clear();
|
virtual void clear();
|
||||||
|
@ -244,6 +244,16 @@ int CvMLData::read_csv(const char* filename)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const CvMat* CvMLData::get_values()
|
||||||
|
{
|
||||||
|
return values;
|
||||||
|
}
|
||||||
|
|
||||||
|
const CvMat* CvMLData::get_missing()
|
||||||
|
{
|
||||||
|
return missing;
|
||||||
|
}
|
||||||
|
|
||||||
void CvMLData::str_to_flt_elem( const char* token, float& flt_elem, int& type)
|
void CvMLData::str_to_flt_elem( const char* token, float& flt_elem, int& type)
|
||||||
{
|
{
|
||||||
|
|
||||||
@ -286,6 +296,11 @@ void CvMLData :: set_delimiter(char ch)
|
|||||||
__END__;
|
__END__;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
char CvMLData::get_delimiter()
|
||||||
|
{
|
||||||
|
return delimiter;
|
||||||
|
}
|
||||||
|
|
||||||
void CvMLData::set_miss_ch(char ch)
|
void CvMLData::set_miss_ch(char ch)
|
||||||
{
|
{
|
||||||
CV_FUNCNAME( "CvMLData::set_miss_ch" );
|
CV_FUNCNAME( "CvMLData::set_miss_ch" );
|
||||||
@ -299,6 +314,11 @@ void CvMLData :: set_miss_ch(char ch)
|
|||||||
__END__;
|
__END__;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
char CvMLData::get_miss_ch()
|
||||||
|
{
|
||||||
|
return miss_ch;
|
||||||
|
}
|
||||||
|
|
||||||
void CvMLData::set_response_idx( int idx )
|
void CvMLData::set_response_idx( int idx )
|
||||||
{
|
{
|
||||||
CV_FUNCNAME( "CvMLData::set_response_idx" );
|
CV_FUNCNAME( "CvMLData::set_response_idx" );
|
||||||
@ -319,6 +339,11 @@ void CvMLData :: set_response_idx( int idx )
|
|||||||
__END__;
|
__END__;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int CvMLData::get_response_idx()
|
||||||
|
{
|
||||||
|
return response_idx;
|
||||||
|
}
|
||||||
|
|
||||||
void CvMLData::change_var_type( int var_idx, int type )
|
void CvMLData::change_var_type( int var_idx, int type )
|
||||||
{
|
{
|
||||||
CV_FUNCNAME( "CvMLData::change_var_type" );
|
CV_FUNCNAME( "CvMLData::change_var_type" );
|
||||||
@ -511,6 +536,11 @@ const CvMat* CvMLData :: get_var_types()
|
|||||||
return var_types_out;
|
return var_types_out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int CvMLData::get_var_type( int var_idx )
|
||||||
|
{
|
||||||
|
return var_types->data.ptr[var_idx];
|
||||||
|
}
|
||||||
|
|
||||||
const CvMat* CvMLData::get_responses()
|
const CvMat* CvMLData::get_responses()
|
||||||
{
|
{
|
||||||
CV_FUNCNAME( "CvMLData::get_responses_ptr" );
|
CV_FUNCNAME( "CvMLData::get_responses_ptr" );
|
||||||
@ -597,6 +627,16 @@ void CvMLData :: set_train_test_split( const CvTrainTestSplit * spl)
|
|||||||
__END__;
|
__END__;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const CvMat* CvMLData::get_train_sample_idx()
|
||||||
|
{
|
||||||
|
return train_sample_idx;
|
||||||
|
}
|
||||||
|
|
||||||
|
const CvMat* CvMLData::get_test_sample_idx()
|
||||||
|
{
|
||||||
|
return test_sample_idx;
|
||||||
|
}
|
||||||
|
|
||||||
void CvMLData::mix_train_and_test_idx()
|
void CvMLData::mix_train_and_test_idx()
|
||||||
{
|
{
|
||||||
if ( !values || !sample_idx) return;
|
if ( !values || !sample_idx) return;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user