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"
64 return Internal::DoResCallObjectOut<ClassificationTestResult>([&](
void* & res)
66 return CVB_CALL_CAPI(PMLeaveOutTestOnSil (mts.Handle (), ..., holdoutSize, usage, preproCode_, featureResolution_, lambda_, iterpolation_ ==
InterpolationType::Linear, res));
80 return Internal::DoResCallObjectOut<RegressionTestResult>([&](
void* & res)
82 return CVB_CALL_CAPI(PMLeaveOutTestOnSil (mts.Handle (), ..., holdoutSize, CExports::CU_Regression, preproCode_, featureResolution_, lambda_, iterpolation_ ==
InterpolationType::Linear, res));
97 return Internal::DoResCallObjectOut<ClassificationTestResult>([&](
void* & res)
99 return CVB_CALL_CAPI(PMLeaveOutTestOnMts (mts.Handle (), ..., holdoutSize, usage, preproCode_, featureResolution_, lambda_, iterpolation_ ==
InterpolationType::Linear, res));
111 return interpolation_;
121 interpolation_ = interpolation;
170 std::string asciiCode (Internal::CastToAscii(code));
171 std::transform(asciiCode.begin(), asciiCode.end(), asciiCode.begin(), [](
char ch)
173 return static_cast<char>(std::tolower(ch));
180 preproCode_.assign (asciiCode.begin(), asciiCode.end());
190 return featureResolution_;
205 featureResolution_ = featureResolution;
Factory object for holdout tests.
Definition: holdout_test_result_factory.hpp:35
String Preprocessing() const
Get preprocessing code with which the object is to be generated.
Definition: holdout_test_result_factory.hpp:154
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:119
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:139
HoldoutTestResultFactory()
Constructor.
Definition: holdout_test_result_factory.hpp:41
double Lambda() const noexcept
Gets the regularization value to be used for generating the object.
Definition: holdout_test_result_factory.hpp:129
int FeatureResolution() const noexcept
Gets the feature resolution (determines the size of the classification retina.
Definition: holdout_test_result_factory.hpp:188
void SetPreprocessing(const String &code)
Set preprocessing code with which the object is to be generated.
Definition: holdout_test_result_factory.hpp:164
void SetFeatureResolution(int featureResolution)
Sets the feature resolution (determines the size of the classification retina).
Definition: holdout_test_result_factory.hpp:198
InterpolationType Interpolation() const noexcept
Gets the interpolation setting to be used for generating this object.
Definition: holdout_test_result_factory.hpp:109
Base class for test factory classes.
Definition: test_result_factory.hpp:24
static constexpr InterpolationType InterpolationDefault
Default value for interpolation.
Definition: predictor_factory_base.hpp:193
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:47
static ValueRange< int > FeatureResolutionRange()
Valid range of feature resolution value.
Definition: predictor_factory_base.hpp:56
static constexpr double LambdaDefault
Default value for lambda.
Definition: predictor_factory_base.hpp:44
static constexpr int FeatureResolutionDefault
Default value for feature resolution.
Definition: predictor_factory_base.hpp:53
static constexpr int PreprocessingMaxLength
Maximum length of a preprocessing code (excluding the terminating zero).
Definition: predictor_factory_base.hpp:62
Classifier type that operates on images.
Definition: decl_regression_sil.hpp:182
ClassificationType
Determine the classification type to be carried out.
Definition: classification_predictor.hpp:32
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.
Root namespace for the Image Manager interface.
Definition: c_barcode.h:24
Angle Max(Angle a, Angle b) noexcept
Returns the bigger of two angles.
Definition: angle.hpp:504
Angle Min(Angle a, Angle b) noexcept
Returns the smaller of two angles.
Definition: angle.hpp:521