3#include "../_cexports/c_polimago.h"
5#include "../global.hpp"
6#include "../string.hpp"
7#include "../value_range.hpp"
8#include "predictor_base.hpp"
9#include "test_result_base.hpp"
70 return{
'p',
'a',
's',
'+' };
119 std::string asciiCode (Internal::CastToAscii(code));
120 std::transform(asciiCode.begin(), asciiCode.end(), asciiCode.begin(), [](
char ch)
122 return static_cast<char>(std::tolower(ch));
129 preproCode_.assign (asciiCode.begin(), asciiCode.end());
141 std::transform(input.begin(), input.end(), std::back_inserter(asciiCode), [](
const String::value_type ch)
143 return static_cast<char>(std::tolower(static_cast<char>(ch)));
147 for (
auto c : asciiCode)
150 if (std::find (preprocessingValidCharacters.begin(), preprocessingValidCharacters.end(), c) != preprocessingValidCharacters.end()
153 retval.push_back (c);
202 return interpolation_;
212 interpolation_ = interpolation;
222 return featureResolution_;
237 featureResolution_ = featureResolution;
243 PredictorFactoryBase::UseSettingsFromPredictor (clf);
257 int featureResolution_;
String Preprocessing() const
Preprocessing code with which this object was generated.
Definition: predictor_base.hpp:175
double Lambda() const noexcept
Regularization value that has been used for generating this object.
Definition: predictor_base.hpp:98
InterpolationType Interpolation() const noexcept
Interpolation setting used for generating this object.
Definition: predictor_base.hpp:118
Base class for Polimago predictors.
Definition: predictor_base.hpp:284
int FeatureResolution() const noexcept
Feature resolution value with which the classifier was trained.
Definition: predictor_base.hpp:304
Base class for Polimago predictors.
Definition: predictor_base.hpp:198
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:97
Base class for classifier factory classes.
Definition: predictor_factory_base.hpp:178
void SetInterpolation(InterpolationType interpolation) noexcept
Sets the interpolation setting to be used for generating this object. Using interpolation will genera...
Definition: predictor_factory_base.hpp:210
int FeatureResolution() const noexcept
Gets the feature resolution (determines the size of the classification retina).
Definition: predictor_factory_base.hpp:220
void SetFeatureResolution(int featureResolution)
Sets the feature resolution (determines the size of the classification retina).
Definition: predictor_factory_base.hpp:230
InterpolationType Interpolation() const noexcept
Gets the interpolation setting to be used for generating this object.
Definition: predictor_factory_base.hpp:200
static constexpr InterpolationType InterpolationDefault
Default value for interpolation.
Definition: predictor_factory_base.hpp:193
Base class for classifier factory classes.
Definition: predictor_factory_base.hpp:30
static constexpr std::array< char, 4 > PreprocessingValidCharacters()
Characters that a preprocessing string may contain.
Definition: predictor_factory_base.hpp:68
String Preprocessing() const
Get preprocessing code with which the object is to be generated.
Definition: predictor_factory_base.hpp:103
static ValueRange< double > LambdaRange()
Acceptable scale factor range for search classifier training.
Definition: predictor_factory_base.hpp:47
void SetLambda(double lambda)
Sets the regularization value to be used for generating the object. Possible values range from 0 to 1...
Definition: predictor_factory_base.hpp:88
static String FormatPreprocessingCode(const String &input)
Correct a preprocessing code to make sure that no invalid characters are in the code and the code doe...
Definition: predictor_factory_base.hpp:138
static ValueRange< int > FeatureResolutionRange()
Valid range of feature resolution value.
Definition: predictor_factory_base.hpp:56
double Lambda() const noexcept
Gets the regularization value to be used for generating the object.
Definition: predictor_factory_base.hpp:78
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
void SetPreprocessing(const String &code)
Set preprocessing code with which the object is to be generated.
Definition: predictor_factory_base.hpp:113
static constexpr int PreprocessingMaxLength
Maximum length of a preprocessing code (excluding the terminating zero).
Definition: predictor_factory_base.hpp:62
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