Lines Matching refs:vi

144     int vi, i;  in CV_IMPLEMENT_QSORT_EX()  local
243 for( vi = 0; vi < var_count; vi++ ) in CV_IMPLEMENT_QSORT_EX()
245 var_type->data.i[vi] = var_type0->data.ptr[vi] == CV_VAR_CATEGORICAL ? in CV_IMPLEMENT_QSORT_EX()
306 for( vi = 0; vi <= var_count; vi++ ) in CV_IMPLEMENT_QSORT_EX()
315 if( vi < var_count ) // analyze i-th input variable in CV_IMPLEMENT_QSORT_EX()
317 int vi0 = vidx ? vidx[vi] : vi; in CV_IMPLEMENT_QSORT_EX()
318 ci = get_var_type(vi); in CV_IMPLEMENT_QSORT_EX()
338 if( vi < var_count && ci >= 0 || in CV_IMPLEMENT_QSORT_EX()
339 vi == var_count && is_classifier ) // process categorical variable or response in CV_IMPLEMENT_QSORT_EX()
342 int* c_map, *dst = get_cat_var_data( data_root, vi ); in CV_IMPLEMENT_QSORT_EX()
359 "variable is not an integer", i, vi ); in CV_IMPLEMENT_QSORT_EX()
367 "variable is too large", i, vi ); in CV_IMPLEMENT_QSORT_EX()
387 if( vi > 0 ) in CV_IMPLEMENT_QSORT_EX()
424 CvPair32s32f* dst = get_ord_var_data( data_root, vi ); in CV_IMPLEMENT_QSORT_EX()
440 "variable (=%g) is too large", i, vi, val ); in CV_IMPLEMENT_QSORT_EX()
468 "variable (=%g) is out of range", i, vi, val ); in CV_IMPLEMENT_QSORT_EX()
479 if( vi < var_count ) in CV_IMPLEMENT_QSORT_EX()
480 data_root->set_num_valid(vi, num_valid); in CV_IMPLEMENT_QSORT_EX()
488 for( i = vi = 0; i < sample_count; i++ ) in CV_IMPLEMENT_QSORT_EX()
490 dst[i] = vi++; in CV_IMPLEMENT_QSORT_EX()
491 vi &= vi < cv_n ? -1 : 0; in CV_IMPLEMENT_QSORT_EX()
498 CV_SWAP( dst[a], dst[b], vi ); in CV_IMPLEMENT_QSORT_EX()
585 int vi, i, total = data_root->sample_count; in subsample_data() local
606 for( vi = 0; vi < work_var_count; vi++ ) in subsample_data()
608 int ci = get_var_type(vi); in subsample_data()
610 if( ci >= 0 || vi >= var_count ) in subsample_data()
612 const int* src = get_cat_var_data( data_root, vi ); in subsample_data()
613 int* dst = get_cat_var_data( root, vi ); in subsample_data()
623 if( vi < var_count ) in subsample_data()
624 root->set_num_valid(vi, num_valid); in subsample_data()
628 const CvPair32s32f* src = get_ord_var_data( data_root, vi ); in subsample_data()
629 CvPair32s32f* dst = get_ord_var_data( root, vi ); in subsample_data()
631 int num_valid = data_root->get_num_valid(vi); in subsample_data()
648 root->set_num_valid(vi, j); in subsample_data()
688 int i, vi, total = sample_count, count = total, cur_ofs = 0; in get_vectors() local
716 for( vi = 0; vi < var_count; vi++ ) in get_vectors()
718 int ci = get_var_type(vi); in get_vectors()
721 float* dst = values + vi; in get_vectors()
722 uchar* m = missing ? missing + vi : 0; in get_vectors()
723 const int* src = get_cat_var_data(data_root, vi); in get_vectors()
739 float* dst = values + vi; in get_vectors()
740 uchar* m = missing ? missing + vi : 0; in get_vectors()
741 const CvPair32s32f* src = get_ord_var_data(data_root, vi); in get_vectors()
742 int count1 = data_root->get_num_valid(vi); in get_vectors()
844 CvDTreeSplit* CvDTreeTrainData::new_split_ord( int vi, float cmp_val, in new_split_ord() argument
848 split->var_idx = vi; in new_split_ord()
859 CvDTreeSplit* CvDTreeTrainData::new_split_cat( int vi, float quality ) in new_split_cat() argument
864 split->var_idx = vi; in new_split_cat()
946 int CvDTreeTrainData::get_var_type(int vi) const in get_var_type()
948 return var_type->data.i[vi]; in get_var_type()
957 CvPair32s32f* CvDTreeTrainData::get_ord_var_data( CvDTreeNode* n, int vi ) in get_ord_var_data() argument
959 int oi = ~get_var_type(vi); in get_ord_var_data()
984 int* CvDTreeTrainData::get_cat_var_data( CvDTreeNode* n, int vi ) in get_cat_var_data() argument
986 int ci = get_var_type(vi); in get_cat_var_data()
1008 int vi, vcount = var_count; in write_params() local
1048 for( vi = 0; vi < vcount; vi++ ) in write_params()
1049 cvWriteInt( fs, 0, var_type->data.i[vi] >= 0 ); in write_params()
1072 int vi, max_split_size, tree_block_size; in read_params() local
1126 for( vi = 0; vi < var_count; vi++ ) in read_params()
1127 if( (unsigned)var_idx->data.i[vi] >= (unsigned)var_all ) in read_params()
1148 for( vi = 0; vi < var_count; vi++ ) in read_params()
1153 var_type->data.i[vi] = n->data.i ? cat_var_count++ : ord_var_count--; in read_params()
1185 for( vi = 0; vi < ccount; vi++ ) in read_params()
1187 int val = cat_count->data.i[vi]; in read_params()
1191 cat_ofs->data.i[vi+1] = total_c_count += val; in read_params()
1337 int i, n = node->sample_count, vi; in try_split_node() local
1383 for( vi = 0; vi < data->var_count; vi++ ) in try_split_node()
1386 int ci = data->get_var_type(vi); in try_split_node()
1388 if( vi == best_split->var_idx ) in try_split_node()
1392 split = find_surrogate_split_cat( node, vi ); in try_split_node()
1394 split = find_surrogate_split_ord( node, vi ); in try_split_node()
1431 int i, n = node->sample_count, vi = node->split->var_idx; in calc_node_dir() local
1436 if( data->get_var_type(vi) >= 0 ) // split on categorical var in calc_node_dir()
1438 const int* labels = data->get_cat_var_data(node,vi); in calc_node_dir()
1477 const CvPair32s32f* sorted = data->get_ord_var_data(node,vi); in calc_node_dir()
1479 int n1 = node->get_num_valid(vi); in calc_node_dir()
1529 int vi; in find_best_split() local
1532 for( vi = 0; vi < data->var_count; vi++ ) in find_best_split()
1534 int ci = data->get_var_type(vi); in find_best_split()
1535 if( node->get_num_valid(vi) <= 1 ) in find_best_split()
1541 split = find_split_cat_class( node, vi ); in find_best_split()
1543 split = find_split_ord_class( node, vi ); in find_best_split()
1548 split = find_split_cat_reg( node, vi ); in find_best_split()
1550 split = find_split_ord_reg( node, vi ); in find_best_split()
1566 CvDTreeSplit* CvDTree::find_split_ord_class( CvDTreeNode* node, int vi ) in find_split_ord_class() argument
1569 const CvPair32s32f* sorted = data->get_ord_var_data(node, vi); in find_split_ord_class()
1572 int n1 = node->get_num_valid(vi); in find_split_ord_class()
1653 return best_i >= 0 ? data->new_split_ord( vi, in find_split_ord_class()
1756 CvDTreeSplit* CvDTree::find_split_cat_class( CvDTreeNode* node, int vi ) in find_split_cat_class() argument
1759 const int* labels = data->get_cat_var_data(node, vi); in find_split_cat_class()
1761 int ci = data->get_var_type(vi); in find_split_cat_class()
1903 split = data->new_split_cat( vi, (float)best_val ); in find_split_cat_class()
1927 CvDTreeSplit* CvDTree::find_split_ord_reg( CvDTreeNode* node, int vi ) in find_split_ord_reg() argument
1930 const CvPair32s32f* sorted = data->get_ord_var_data(node, vi); in find_split_ord_reg()
1933 int n1 = node->get_num_valid(vi); in find_split_ord_reg()
1961 return best_i >= 0 ? data->new_split_ord( vi, in find_split_ord_reg()
1967 CvDTreeSplit* CvDTree::find_split_cat_reg( CvDTreeNode* node, int vi ) in find_split_cat_reg() argument
1970 const int* labels = data->get_cat_var_data(node, vi); in find_split_cat_reg()
1972 int ci = data->get_var_type(vi); in find_split_cat_reg()
2037 split = data->new_split_cat( vi, (float)best_val ); in find_split_cat_reg()
2048 CvDTreeSplit* CvDTree::find_surrogate_split_ord( CvDTreeNode* node, int vi ) in find_surrogate_split_ord() argument
2051 const CvPair32s32f* sorted = data->get_ord_var_data(node, vi); in find_surrogate_split_ord()
2053 int n1 = node->get_num_valid(vi); in find_surrogate_split_ord()
2156 return best_i >= 0 && best_val > node->maxlr ? data->new_split_ord( vi, in find_surrogate_split_ord()
2162 CvDTreeSplit* CvDTree::find_surrogate_split_cat( CvDTreeNode* node, int vi ) in find_surrogate_split_cat() argument
2164 const int* labels = data->get_cat_var_data(node, vi); in find_surrogate_split_cat()
2171 CvDTreeSplit* split = data->new_split_cat( vi, 0 ); in find_surrogate_split_cat()
2172 int i, mi = data->cat_count->data.i[data->get_var_type(vi)], l_win = 0; in find_surrogate_split_cat()
2438 int vi, i, n = node->sample_count, nl, nr, d0 = 0, d1 = -1; in complete_node_dir() local
2449 vi = split->var_idx; in complete_node_dir()
2451 if( data->get_var_type(vi) >= 0 ) // split on categorical var in complete_node_dir()
2453 const int* labels = data->get_cat_var_data(node, vi); in complete_node_dir()
2470 const CvPair32s32f* sorted = data->get_ord_var_data(node, vi); in complete_node_dir()
2472 int n1 = node->get_num_valid(vi); in complete_node_dir()
2518 int vi, i, n = node->sample_count, nl, nr; in split_node_data() local
2551 for( vi = 0; vi < data->var_count; vi++ ) in split_node_data()
2553 int ci = data->get_var_type(vi); in split_node_data()
2554 int n1 = node->get_num_valid(vi); in split_node_data()
2561 src = data->get_ord_var_data(node, vi); in split_node_data()
2562 ldst0 = ldst = data->get_ord_var_data(left, vi); in split_node_data()
2563 rdst0 = rdst = data->get_ord_var_data(right, vi); in split_node_data()
2579 left->set_num_valid(vi, (int)(ldst - ldst0)); in split_node_data()
2580 right->set_num_valid(vi, (int)(rdst - rdst0)); in split_node_data()
2598 for( vi = 0; vi < work_var_count; vi++ ) in split_node_data()
2600 int ci = data->get_var_type(vi); in split_node_data()
2601 int n1 = node->get_num_valid(vi), nr1 = 0; in split_node_data()
2605 if( ci < 0 || (vi < data->var_count && !split_input_data) ) in split_node_data()
2608 src = data->get_cat_var_data(node, vi); in split_node_data()
2609 ldst0 = ldst = data->get_cat_var_data(left, vi); in split_node_data()
2610 rdst0 = rdst = data->get_cat_var_data(right, vi); in split_node_data()
2623 if( vi < data->var_count ) in split_node_data()
2625 left->set_num_valid(vi, n1 - nr1); in split_node_data()
2626 right->set_num_valid(vi, nr1); in split_node_data()
2943 int vi = split->var_idx; in predict() local
2944 int ci = vtype[vi]; in predict()
2945 i = vidx ? vidx[vi] : vi; in predict()
3200 int vi, ci; in read_split() local
3205 vi = cvReadIntByName( fs, fnode, "var", -1 ); in read_split()
3206 if( (unsigned)vi >= (unsigned)data->var_count ) in read_split()
3209 ci = data->get_var_type(vi); in read_split()
3215 split = data->new_split_cat( vi, 0 ); in read_split()
3260 split = data->new_split_ord( vi, 0, 0, 0, 0 ); in read_split()