File partition.hpp¶
-
class IPartition¶
- #include <partition.hpp>
Defines an interface for all classes that provide access to the indices of training examples that have been split into a training set and a holdout set.
Subclassed by BiPartition, SinglePartition
Public Functions
-
inline virtual ~IPartition()¶
-
virtual std::unique_ptr<IStoppingCriterion> createStoppingCriterion(const IStoppingCriterionFactory &factory) = 0¶
Creates and returns a new instance of the class
IStoppingCriterion, based on the type of this partition.- Parameters:
factory – A reference to an object of type
IStoppingCriterionFactorythat should be used to create the instance- Returns:
An unique pointer to an object of type
IStoppingCriterionthat has been created
-
virtual std::unique_ptr<IInstanceSampling> createInstanceSampling(const IClassificationInstanceSamplingFactory &factory, const IRowWiseLabelMatrix &labelMatrix, IStatistics &statistics, const EqualWeightVector &exampleWeights) = 0¶
Creates and returns a new instance of the class
IInstanceSamplingthat can be used in classification problems, based on the type of this partition.- Parameters:
factory – A reference to an object of type
IClassificationInstanceSamplingFactorythat should be used to create the instancelabelMatrix – A reference to an object of type
IRowWiseLabelMatrixthat provides row-wise access to the labels of individual training examplesstatistics – A reference to an object of type
IStatisticsthat provides access to the statistics which serve as a basis for learning rulesexampleWeights – A reference to an object of type
EqualWeightVectorthat provides access to the weights of individual training examples
- Returns:
An unique pointer to an object of type
IInstanceSamplingthat has been created
-
virtual std::unique_ptr<IInstanceSampling> createInstanceSampling(const IClassificationInstanceSamplingFactory &factory, const IRowWiseLabelMatrix &labelMatrix, IStatistics &statistics, const DenseWeightVector<float32> &exampleWeights) = 0¶
Creates and returns a new instance of the class
IInstanceSamplingthat can be used in classification problems, based on the type of this partition.- Parameters:
factory – A reference to an object of type
IClassificationInstanceSamplingFactorythat should be used to create the instancelabelMatrix – A reference to an object of type
IRowWiseLabelMatrixthat provides row-wise access to the labels of individual training examplesstatistics – A reference to an object of type
IStatisticsthat provides access to the statistics which serve as a basis for learning rulesexampleWeights – A reference to an object of type
DenseWeightVector<float32>that provides access to the weights of individual training examples
- Returns:
An unique pointer to an object of type
IInstanceSamplingthat has been created
-
virtual std::unique_ptr<IInstanceSampling> createInstanceSampling(const IRegressionInstanceSamplingFactory &factory, const IRowWiseRegressionMatrix ®ressionMatrix, IStatistics &statistics, const EqualWeightVector &exampleWeights) = 0¶
Creates and returns a new instance of the class
IInstanceSamplingthat can be used in regression problems, based on the type of this partition.- Parameters:
factory – A reference to an object of type
IRegressionInstanceSamplingFactorythat should be used to create the instanceregressionMatrix – A reference to an object of type
IRowWiseRegressionMatrixthat provides row-wise access to the regression scores of individual training examplesstatistics – A reference to an object of type
IStatisticsthat provides access to the statistics which serve as a basis for learning rulesexampleWeights – A reference to an object of type
EqualWeightVectorthat provides access to the weights of individual training examples
- Returns:
An unique pointer to an object of type
IInstanceSamplingthat has been created
-
virtual std::unique_ptr<IInstanceSampling> createInstanceSampling(const IRegressionInstanceSamplingFactory &factory, const IRowWiseRegressionMatrix ®ressionMatrix, IStatistics &statistics, const DenseWeightVector<float32> &exampleWeights) = 0¶
Creates and returns a new instance of the class
IInstanceSamplingthat can be used in regression problems, based on the type of this partition.- Parameters:
factory – A reference to an object of type
IRegressionInstanceSamplingFactorythat should be used to create the instanceregressionMatrix – A reference to an object of type
IRowWiseRegressionMatrixthat provides row-wise access to the regression scores of individual training examplesstatistics – A reference to an object of type
IStatisticsthat provides access to the statistics which serve as a basis for learning rulesexampleWeights – A reference to an object of type
DenseWeightVector<float64>that provides access to the weights of individual training examples
- Returns:
An unique pointer to an object of type
IInstanceSamplingthat has been created
-
virtual Quality evaluateOutOfSample(const IFeatureSubspace &featureSubspace, const CoverageMask &coverageMask, const IPrediction &head) = 0¶
Calculates and returns a numerical score that assesses the quality of a rule’s prediction for all examples that do not belong to the current sample and are marked as covered according to a given object of type
CoverageMask.- Parameters:
featureSubspace – A reference to an object of type
IFeatureSubspacethat should be used to evaluate the predictioncoverageMask – A reference to an object of type
CoverageMaskthat keeps track of the examples that are covered by the rulehead – A reference to an object of type
IPredictionthat stores the scores that are predicted by the rule
- Returns:
An object of type
Qualitythat stores the calculated quality
-
virtual void recalculatePrediction(const IFeatureSubspace &featureSubspace, const CoverageMask &coverageMask, std::unique_ptr<IEvaluatedPrediction> &headPtr) = 0¶
Recalculates and updates a rule’s prediction based on all examples in the training set that are marked as covered according to a given object of type
CoverageMask.- Parameters:
featureSubspace – A reference to an object of type
IFeatureSubspacethat should be used to recalculate the predictioncoverageMask – A reference to an object of type
CoverageMaskthat keeps track of the examples that are covered by the ruleheadPtr – A reference to an unique pointer that stores an object of type
IEvaluatedPredictionto be updated
-
virtual std::unique_ptr<IMarginalProbabilityCalibrationModel> fitMarginalProbabilityCalibrationModel(const IMarginalProbabilityCalibrator &probabilityCalibrator, const IRowWiseLabelMatrix &labelMatrix, const IStatistics &statistics) = 0¶
Fits and returns a model for the calibration of marginal probabilities, based on the type of this partition.
- Parameters:
probabilityCalibrator – A reference to an object of type
IMarginalProbabilityCalibratorthat should be used to fit the calibration modellabelMatrix – A reference to an object of type
IRowWiseLabelMatrixthat provides row-wise access to the labels of the training examplesstatistics – A reference to an object of type
IStatisticsthat provides access to statistics about the quality of predictions for training examples
- Returns:
An unique pointer to an object of type
IMarginalProbabilityCalibrationModelthat has been fit
-
virtual std::unique_ptr<IJointProbabilityCalibrationModel> fitJointProbabilityCalibrationModel(const IJointProbabilityCalibrator &probabilityCalibrator, const IRowWiseLabelMatrix &labelMatrix, const IStatistics &statistics) = 0¶
Fits and returns a model for the calibration of joint probabilities, based on the type of this partition.
- Parameters:
probabilityCalibrator – A reference to an object of type
IJointProbabilityCalibratorthat should be used to fit the calibration modellabelMatrix – A reference to an object of type
IRowWiseLabelMatrixthat provides row-wise access to the labels of the training examplesstatistics – A reference to an object of type
IStatisticsthat provides access to statistics about the quality of predictions for training examples
- Returns:
An unique pointer to an object of type
IJointProbabilityCalibrationModelthat has been fit
-
inline virtual ~IPartition()¶