3#include "../_cexports/c_polimago.h"
5#include "../global.hpp"
6#include "../string.hpp"
7#include "test_result_factory.hpp"
8#include "predictor_base.hpp"
9#include "predictor_factory_base.hpp"
10#include "classification_predictor.hpp"
11#include "../minos/training_set.hpp"
12#include "../sample_database/sample_classification_image_list.hpp"
13#include "../sample_database/sample_regression_image_list.hpp"
58 return Internal::DoResCallObjectOut<ClassificationTestResult>([&](
void* & res)
60 return CVB_CALL_CAPI(PMLeaveOutTestOnSil (mts.Handle (), ..., holdoutSize, usage, preproCode_, featureResolution_, lambda_, iterpolation_ ==
InterpolationType::Linear, res));
74 return Internal::DoResCallObjectOut<RegressionTestResult>([&](
void* & res)
76 return CVB_CALL_CAPI(PMLeaveOutTestOnSil (mts.Handle (), ..., holdoutSize, CExports::CU_Regression, preproCode_, featureResolution_, lambda_, iterpolation_ ==
InterpolationType::Linear, res));
89 std::unique_ptr<ClassificationTestResult> RunTest (
int holdoutSize,
ClassificationType usage,
const Minos::TrainingSet & database)
91 return Internal::DoResCallObjectOut<ClassificationTestResult>([&](
void* & res)
93 return CVB_CALL_CAPI(PMLeaveOutTestOnMts (mts.Handle (), ..., holdoutSize, usage, preproCode_, featureResolution_, lambda_, iterpolation_ ==
InterpolationType::Linear, res));
105 return interpolation_;
116 interpolation_ = interpolation;
167 std::string asciiCode(Internal::CastToAscii(code));
168 std::transform(asciiCode.begin(), asciiCode.end(), asciiCode.begin(),
169 [](
char ch) { return static_cast<char>(std::tolower(ch)); });
171 != std::string::npos)
176 preproCode_.assign(asciiCode.begin(), asciiCode.end());
186 return featureResolution_;
202 featureResolution_ = featureResolution;
HoldoutTestResultFactory()
Constructor.
Definition holdout_test_result_factory.hpp:40
Factory object for holdout tests.
Definition holdout_test_result_factory.hpp:34
String Preprocessing() const
Get preprocessing code with which the object is to be generated.
Definition holdout_test_result_factory.hpp:151
void SetInterpolation(InterpolationType interpolation) noexcept
Sets the interpolation setting to be used for generating this object. Using interpolation will genera...
Definition holdout_test_result_factory.hpp:114
void SetLambda(double lambda)
Sets the regularization value to be used for generating the object. Possible values range from 0 to 1...
Definition holdout_test_result_factory.hpp:135
HoldoutTestResultFactory()
Constructor.
Definition holdout_test_result_factory.hpp:40
double Lambda() const noexcept
Gets the regularization value to be used for generating the object.
Definition holdout_test_result_factory.hpp:124
int FeatureResolution() const noexcept
Gets the feature resolution (determines the size of the classification retina.
Definition holdout_test_result_factory.hpp:184
void SetPreprocessing(const String &code)
Set preprocessing code with which the object is to be generated.
Definition holdout_test_result_factory.hpp:161
void SetFeatureResolution(int featureResolution)
Sets the feature resolution (determines the size of the classification retina).
Definition holdout_test_result_factory.hpp:194
InterpolationType Interpolation() const noexcept
Gets the interpolation setting to be used for generating this object.
Definition holdout_test_result_factory.hpp:103
static constexpr InterpolationType InterpolationDefault
Default value for interpolation.
Definition predictor_factory_base.hpp:209
static constexpr std::array< char, 4 > PreprocessingValidCharacters()
Characters that a preprocessing string may contain.
Definition predictor_factory_base.hpp:68
static ValueRange< double > LambdaRange()
Acceptable scale factor range for search classifier training.
Definition predictor_factory_base.hpp:50
static ValueRange< int > FeatureResolutionRange()
Valid range of feature resolution value.
Definition predictor_factory_base.hpp:59
static constexpr double LambdaDefault
Default value for lambda.
Definition predictor_factory_base.hpp:47
static constexpr int FeatureResolutionDefault
Default value for feature resolution.
Definition predictor_factory_base.hpp:56
static constexpr int PreprocessingMaxLength
Maximum length of a preprocessing code (excluding the terminating zero).
Definition predictor_factory_base.hpp:65
Classifier type that operates on images.
Definition decl_regression_sil.hpp:190
Namespace for the Polimago package testing functionality.
Definition classification_test_result.hpp:21
std::shared_ptr< HoldoutTestResultFactory > HoldoutTestResultFactoryPtr
Convenience shared pointer for HoldoutTestResultFactory.
Definition holdout_test_result_factory.hpp:213
Namespace for the Polimago package.
Definition classification_predictor.hpp:38
ClassificationType
Determine the classification type to be carried out.
Definition classification_predictor.hpp:42
InterpolationType
Interpolation to be used when extracting image data for classifier generation.
Definition predictor_base.hpp:33
@ Linear
Image data is (if necessary) extracted with linear interpolation.
Definition predictor_base.hpp:37
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
Angle Max(Angle a, Angle b) noexcept
Returns the bigger of two angles.
Definition angle.hpp:495
Angle Min(Angle a, Angle b) noexcept
Returns the smaller of two angles.
Definition angle.hpp:512