本文整理汇总了C++中TrainingSet::get_label_type方法的典型用法代码示例。如果您正苦于以下问题:C++ TrainingSet::get_label_type方法的具体用法?C++ TrainingSet::get_label_type怎么用?C++ TrainingSet::get_label_type使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TrainingSet
的用法示例。
在下文中一共展示了TrainingSet::get_label_type方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
void ClassificationTree::print_train_log(const TreeNode::PtrSplitNodeBase split, const TrainingSet &train_set) const
{
MatType ltype = train_set.get_label_type();
MatType ftype = train_set.get_feature_type();
int rows = (int)ltype.total();
cv::Mat_<double> left_tmp;
cv::Mat_<double> right_tmp;
TrainingSet left_set(ftype, ltype);
TrainingSet right_set(ftype, ltype);
split->operator()(train_set, left_set, right_set);
left_set.compute_target_mean(left_tmp);
right_set.compute_target_mean(right_tmp);
cv::Mat_<double> left_dist(rows, 1, (double*)left_tmp.data);
cv::Mat_<double> right_dist(rows, 1, (double*)right_tmp.data);
printf("left dist\n");
for (unsigned ii = 0; ii < left_dist.total(); ++ii) {
printf("\tlabel%d:%f\n", ii, left_dist.at<double>(ii) / left_set.size());
}
printf("right dist\n");
for (unsigned ii = 0; ii < right_dist.total(); ++ii) {
printf("\tlabel%d:%f\n", ii, right_dist.at<double>(ii) / right_set.size());
}
}