From 1c84a971f827a4ef6f2da6e9cfcfda80f99d1891 Mon Sep 17 00:00:00 2001 From: Michael Rapp Date: Mon, 19 Aug 2024 23:20:51 +0200 Subject: [PATCH] Implement visitors for creating statistics backed by a `BitDecomposableStatisticView`. --- .../statistics/statistics_provider_decomposable_dense.cpp | 7 +++++-- .../statistics_provider_non_decomposable_dense.cpp | 8 ++++++-- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/cpp/subprojects/boosting/src/mlrl/boosting/statistics/statistics_provider_decomposable_dense.cpp b/cpp/subprojects/boosting/src/mlrl/boosting/statistics/statistics_provider_decomposable_dense.cpp index b6b67f692..b0db2287b 100644 --- a/cpp/subprojects/boosting/src/mlrl/boosting/statistics/statistics_provider_decomposable_dense.cpp +++ b/cpp/subprojects/boosting/src/mlrl/boosting/statistics/statistics_provider_decomposable_dense.cpp @@ -44,8 +44,11 @@ namespace boosting { }; auto bitDecomposableMatrixVisitor = [&](std::unique_ptr>& quantizationMatrixPtr) { - // TODO Implement - throw std::runtime_error("not implemented"); + statisticsPtr = std::make_unique< + DenseDecomposableStatistics, + BitDecomposableStatisticVector, EvaluationMeasure>>( + std::move(quantizationMatrixPtr), std::move(lossPtr), std::move(evaluationMeasurePtr), + ruleEvaluationFactory, outputMatrix, std::move(statisticMatrixPtr), std::move(scoreMatrixPtr)); }; quantizationPtr->visitQuantizationMatrix(denseDecomposableMatrixVisitor, bitDecomposableMatrixVisitor, {}, {}); return statisticsPtr; diff --git a/cpp/subprojects/boosting/src/mlrl/boosting/statistics/statistics_provider_non_decomposable_dense.cpp b/cpp/subprojects/boosting/src/mlrl/boosting/statistics/statistics_provider_non_decomposable_dense.cpp index fae99bb6c..50f8a7534 100644 --- a/cpp/subprojects/boosting/src/mlrl/boosting/statistics/statistics_provider_non_decomposable_dense.cpp +++ b/cpp/subprojects/boosting/src/mlrl/boosting/statistics/statistics_provider_non_decomposable_dense.cpp @@ -158,8 +158,12 @@ namespace boosting { }; auto bitDecomposableMatrixVisitor = [&](std::unique_ptr>& quantizationMatrixPtr) { - // TODO Implement - throw std::runtime_error("not implemented"); + statisticsPtr = std::make_unique< + DenseDecomposableStatistics, + BitDecomposableStatisticVector, EvaluationMeasure>>( + std::move(quantizationMatrixPtr), std::move(this->lossPtr_), + std::move(this->evaluationMeasurePtr_), ruleEvaluationFactory, this->outputMatrix_, + std::move(decomposableStatisticMatrixPtr), std::move(this->scoreMatrixPtr_)); }; quantizationPtr->visitQuantizationMatrix(denseDecomposableMatrixVisitor, bitDecomposableMatrixVisitor, {}, {});