3#include "../_cexports/c_polimago.h"
5#include "../global.hpp"
6#include "../string.hpp"
7#include "test_result_base.hpp"
34 for (
decltype(numExamples) i = 0; i < numExamples; ++i)
37 for (
decltype(dimension) j = 0; j < dimension; ++j)
39 auto targetValue = CVB_CALL_CAPI(PMGetTestResultTargetValue(
Handle(), i, j));
40 targetValuesPerExample.push_back (targetValue);
42 targetValues_.push_back (targetValuesPerExample);
45 for (
decltype(numExamples) i = 0; i < numExamples; ++i)
48 for (
decltype(dimension) j = 0; j < dimension; ++j)
50 auto predictionResult = CVB_CALL_CAPI(PMGetTestResultNumericalPrediction(
Handle(), i, j));
51 predictionResultsPerExample.push_back (predictionResult);
53 predictionResults_.push_back (predictionResultsPerExample);
59 return thisObjectName_;
72 if (CVB_CALL_CAPI (PMGetTestResultNumClasses(
Handle())) != 0)
121 return static_cast<int>(CVB_CALL_CAPI (PMGetTestResultOutputDimension(
Handle())));
131 return targetValues_;
141 return predictionResults_;
147 const std::string thisObjectName_ =
"Polimago Regression Test Result";
void * Handle() const noexcept
Classic API Polimago handle.
Definition: predictor_base.hpp:66
Regression test result object.
Definition: regression_test_result.hpp:27
std::vector< std::vector< double > > PredictedValues() const
Prediction results for example.
Definition: regression_test_result.hpp:139
std::vector< std::vector< double > > TargetValues() const
Target values for each example.
Definition: regression_test_result.hpp:129
RegressionTestResult(const String &fileName)
Load a saved regression test result from a file.
Definition: regression_test_result.hpp:69
int RegressionDimension() const
Dimension of the regression results.
Definition: regression_test_result.hpp:119
RegressionTestResult(RegressionTestResult &&) noexcept=default
Move constructor.
static std::unique_ptr< RegressionTestResult > Load(const String &fileName)
Load a saved test result from a file.
Definition: regression_test_result.hpp:109
static std::unique_ptr< RegressionTestResult > FromHandle(ReleaseObjectGuard &&guard)
Creates test result from a classic API handle.
Definition: regression_test_result.hpp:94
Base class for all Polimago Test Results.
Definition: test_result_base.hpp:26
int NumExamples() const
Number of examples that contributed to this test result.
Definition: test_result_base.hpp:67
Root namespace for the Image Manager interface.
Definition: c_barcode.h:24