From 311c111f24fdae19e8bb99335764ebecc04749b5 Mon Sep 17 00:00:00 2001 From: Simon Giraudot Date: Tue, 29 Jan 2019 16:35:00 +0100 Subject: [PATCH] Add verbosity info in ETHZ RF --- .../Classification/ETHZ/Random_forest_classifier.h | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/Classification/include/CGAL/Classification/ETHZ/Random_forest_classifier.h b/Classification/include/CGAL/Classification/ETHZ/Random_forest_classifier.h index a1211943214..d2f50acecba 100644 --- a/Classification/include/CGAL/Classification/ETHZ/Random_forest_classifier.h +++ b/Classification/include/CGAL/Classification/ETHZ/Random_forest_classifier.h @@ -179,6 +179,10 @@ public: std::vector gt; std::vector ft; + +#ifdef CGAL_CLASSIFICATION_VERBOSE + std::vector count (m_labels.size(), 0); +#endif for (std::size_t i = 0; i < ground_truth.size(); ++ i) { @@ -188,10 +192,17 @@ public: for (std::size_t f = 0; f < m_features.size(); ++ f) ft.push_back(m_features[f]->value(i)); gt.push_back(g); +#ifdef CGAL_CLASSIFICATION_VERBOSE + count[std::size_t(g)] ++; +#endif } } - CGAL_CLASSIFICATION_CERR << "Using " << gt.size() << " inliers" << std::endl; + CGAL_CLASSIFICATION_CERR << "Using " << gt.size() << " inliers:" << std::endl; +#ifdef CGAL_CLASSIFICATION_VERBOSE + for (std::size_t i = 0; i < m_labels.size(); ++ i) + std::cerr << " * " << m_labels[i]->name() << ": " << count[i] << " inlier(s)" << std::endl; +#endif CGAL::internal::liblearning::DataView2D label_vector (&(gt[0]), gt.size(), 1); CGAL::internal::liblearning::DataView2D feature_vector(&(ft[0]), gt.size(), ft.size() / gt.size());