From c15934dd2b0a91617f0453d1cd4a64a959be0972 Mon Sep 17 00:00:00 2001 From: Maria Dimashova Date: Thu, 24 Jun 2010 08:34:47 +0000 Subject: [PATCH] modified default var_type values --- modules/ml/src/ertrees.cpp | 4 ++-- modules/ml/src/tree.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/ml/src/ertrees.cpp b/modules/ml/src/ertrees.cpp index 03470b4313..2f35309a96 100644 --- a/modules/ml/src/ertrees.cpp +++ b/modules/ml/src/ertrees.cpp @@ -72,7 +72,7 @@ void CvERTreeTrainData::set_data( const CvMat* _train_data, int _tflag, __BEGIN__; - int sample_all = 0, r_type = 0, cv_n; + int sample_all = 0, r_type, cv_n; int total_c_count = 0; int tree_block_size, temp_block_size, max_split_size, nv_size, cv_size = 0; int ds_step, dv_step, ms_step = 0, mv_step = 0; // {data|mask}{sample|var}_step @@ -148,11 +148,11 @@ void CvERTreeTrainData::set_data( const CvMat* _train_data, int _tflag, if ( sample_count < 65536 ) is_buf_16u = true; + r_type = CV_VAR_CATEGORICAL; if( _var_type ) CV_CALL( var_type0 = cvPreprocessVarType( _var_type, var_idx, var_count, &r_type )); CV_CALL( var_type = cvCreateMat( 1, var_count+2, CV_32SC1 )); - cat_var_count = 0; ord_var_count = -1; diff --git a/modules/ml/src/tree.cpp b/modules/ml/src/tree.cpp index 466c31dbe7..117a269f34 100644 --- a/modules/ml/src/tree.cpp +++ b/modules/ml/src/tree.cpp @@ -149,7 +149,7 @@ void CvDTreeTrainData::set_data( const CvMat* _train_data, int _tflag, __BEGIN__; - int sample_all = 0, r_type = 0, cv_n; + int sample_all = 0, r_type, cv_n; int total_c_count = 0; int tree_block_size, temp_block_size, max_split_size, nv_size, cv_size = 0; int ds_step, dv_step, ms_step = 0, mv_step = 0; // {data|mask}{sample|var}_step @@ -252,11 +252,11 @@ void CvDTreeTrainData::set_data( const CvMat* _train_data, int _tflag, "floating-point vector containing as many elements as " "the total number of samples in the training data matrix" ); + r_type = CV_VAR_CATEGORICAL; if( _var_type ) CV_CALL( var_type0 = cvPreprocessVarType( _var_type, var_idx, var_count, &r_type )); CV_CALL( var_type = cvCreateMat( 1, var_count+2, CV_32SC1 )); - cat_var_count = 0; ord_var_count = -1;