CVB++ 14.0
ClassificationPredictorFactory Class Reference

Predictor factory for classification predictor. More...

#include <cvb/polimago/classification_predictor_factory.hpp>

Inherits PredictorFactoryBaseEx.

Public Member Functions

 ClassificationPredictorFactory (ClassificationType usageType)
 Constructor. More...
 
ClassificationType Usage () const noexcept
 Gets the type of classification for which to generate the predictor. More...
 
void SetUsage (ClassificationType usage)
 Sets the type of classification for which to generate the predictor. More...
 
void UseSettingsFromPredictor (const ClassificationPredictor &clf)
 Copy the predictor generation settings from a predictor. More...
 
void UseSettingsFromTestResult (const ClassificationTestResult &res)
 Copy the predictor generation settings from a test result. More...
 
- Public Member Functions inherited from PredictorFactoryBaseEx
InterpolationType Interpolation () const noexcept
 Gets the interpolation setting to be used for generating this object. More...
 
void SetInterpolation (InterpolationType interpolation) noexcept
 Sets the interpolation setting to be used for generating this object. Using interpolation will generate less artifacts, but requires more processor time. More...
 
int FeatureResolution () const noexcept
 Gets the feature resolution (determines the size of the classification retina). More...
 
void SetFeatureResolution (int featureResolution)
 Sets the feature resolution (determines the size of the classification retina). More...
 
- Public Member Functions inherited from PredictorFactoryBase
double Lambda () const noexcept
 Gets the regularization value to be used for generating the object. More...
 
void SetLambda (double lambda)
 Sets the regularization value to be used for generating the object. Possible values range from 0 to 10, good starting values for experiments are usually around 0.01. More...
 
String Preprocessing () const
 Get preprocessing code with which the object is to be generated. More...
 
void SetPreprocessing (const String &code)
 Set preprocessing code with which the object is to be generated. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from PredictorFactoryBase
static ValueRange< double > LambdaRange ()
 Acceptable scale factor range for search classifier training.
 
static ValueRange< int > FeatureResolutionRange ()
 Valid range of feature resolution value.
 
static constexpr std::array< char, 4 > PreprocessingValidCharacters ()
 Characters that a preprocessing string may contain.
 
static String FormatPreprocessingCode (const String &input)
 Correct a preprocessing code to make sure that no invalid characters are in the code and the code does not exceed the maximum length. More...
 
- Static Public Attributes inherited from PredictorFactoryBaseEx
static constexpr InterpolationType InterpolationDefault = InterpolationType::Linear
 Default value for interpolation.
 
- Static Public Attributes inherited from PredictorFactoryBase
static constexpr double LambdaDefault = 0.1
 Default value for lambda.
 
static constexpr int FeatureResolutionDefault = 1
 Default value for feature resolution.
 
static constexpr int PreprocessingMaxLength = 15
 Maximum length of a preprocessing code (excluding the terminating zero).
 

Detailed Description

Predictor factory for classification predictor.

Constructor & Destructor Documentation

◆ ClassificationPredictorFactory()

Constructor.

Parameters
[in]usageTypeThe type of predictor to be generated.
Exceptions
Anyexception derived from std::exception including CvbException.

Member Function Documentation

◆ SetUsage()

void SetUsage ( ClassificationType  usage)
inline

Sets the type of classification for which to generate the predictor.

Parameters
[in]usageThe classification type.
Exceptions
Anyexception derived from std::exception including CvbException.

◆ Usage()

ClassificationType Usage ( ) const
inlinenoexcept

Gets the type of classification for which to generate the predictor.

Returns
The classification type.
Exceptions
Doesnot throw any exception.

◆ UseSettingsFromPredictor()

void UseSettingsFromPredictor ( const ClassificationPredictor clf)
inline

Copy the predictor generation settings from a predictor.

Parameters
[in]clfPredictor to take the settings from.
Exceptions
Anyexception derived from std::exception including CvbException.

◆ UseSettingsFromTestResult()

void UseSettingsFromTestResult ( const ClassificationTestResult res)
inline

Copy the predictor generation settings from a test result.

Parameters
[in]resTest result object from which to adopt the training settings.
Exceptions
Anyexception derived from std::exception including CvbException.