3#include "../_cexports/c_polimago.h"
5#include "../global.hpp"
6#include "../string.hpp"
7#include "predictor_base.hpp"
25 class TestResultBase :
public PolimagoFactoryCreatedObject
28 explicit TestResultBase(ReleaseObjectGuard &&guard)
29 : PolimagoFactoryCreatedObject(
std::move(guard))
30 , exampleMeanSquareErrors_()
32 CVB_CALL_CAPI(PMGetTestResultTrainParams(
Handle(), TrainingParameters()));
35 for (
decltype(num_examples) i = 0; i < num_examples; ++i)
37 exampleMeanSquareErrors_.push_back(CVB_CALL_CAPI(PMGetTestResultExampleMeanSquareError(
Handle(), i)));
42 static CExports::TTESTRESULT LoadInternal(
const String &fileName)
44 CExports::TTESTRESULT testResult =
nullptr;
46 CVB_CALL_CAPI_CHECKED(PMOpenTestResultTyped(fileName.c_str(), testResult));
50 void SaveFunction(
const String &fileName)
const override
52 CVB_CALL_CAPI_CHECKED(PMSaveTestResultTyped(fileName.c_str(),
Handle()));
63 return static_cast<int>(CVB_CALL_CAPI(PMGetTestResultNumExamples(
Handle())));
73 return static_cast<int>(CVB_CALL_CAPI(PMGetTestResultTotalMeanSquareError(
Handle())));
84 return exampleMeanSquareErrors_;
94 return TrainingParameters().FeatureMap.FeatureResolution;
25 class TestResultBase :
public PolimagoFactoryCreatedObject {
…};
void * Handle() const noexcept
Classic API Polimago handle.
Definition predictor_base.hpp:68
Base class for all Polimago Test Results.
Definition test_result_base.hpp:26
int FeatureResolution() const noexcept
Feature resolution value with which the classifier was trained.
Definition test_result_base.hpp:92
std::vector< double > ExampleMeanSquareError() const
Mean square error for each individual example (the index runs over all the examples that contributed ...
Definition test_result_base.hpp:82
int NumExamples() const
Number of examples that contributed to this test result.
Definition test_result_base.hpp:61
double TotalMeanSquareError() const
Total mean square error of the predictor over all examples and all coordinates.
Definition test_result_base.hpp:71
Namespace for the Polimago package testing functionality.
Definition classification_test_result.hpp:21
std::shared_ptr< TestResultBase > TestResultBasePtr
Convenience shared pointer for TestResultBase.
Definition test_result_base.hpp:102
Namespace for the Polimago package.
Definition classification_predictor.hpp:38
Root namespace for the Image Manager interface.
Definition c_bayer_to_rgb.h:17
std::string String
String for wide characters or unicode characters.
Definition string.hpp:49