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 IStoppingCriterionFactory that should be used to create the instance

Returns:

An unique pointer to an object of type IStoppingCriterion that has been created

virtual std::unique_ptr<IInstanceSampling> createInstanceSampling(const IInstanceSamplingFactory &factory, const IRowWiseLabelMatrix &labelMatrix, IStatistics &statistics) = 0

Creates and returns a new instance of the class IInstanceSampling, based on the type of this partition.

Parameters:
  • factory – A reference to an object of type IInstanceSamplingFactory that should be used to create the instance

  • labelMatrix – A reference to an object of type IRowWiseLabelMatrix that provides row-wise access to the labels of individual training examples

  • statistics – A reference to an object of type IStatistics that provides access to the statistics which serve as a basis for learning rules

Returns:

An unique pointer to an object of type IInstanceSampling that 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 IFeatureSubspace that should be used to evaluate the prediction

  • coverageMask – A reference to an object of type CoverageMask that keeps track of the examples that are covered by the rule

  • head – A reference to an object of type IPrediction that stores the scores that are predicted by the rule

Returns:

An object of type Quality that stores the calculated quality

virtual void recalculatePrediction(const IFeatureSubspace &featureSubspace, const CoverageMask &coverageMask, IPrediction &head) = 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 IFeatureSubspace that should be used to recalculate the prediction

  • coverageMask – A reference to an object of type CoverageMask that keeps track of the examples that are covered by the rule

  • head – A reference to an object of type IPrediction to 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 IMarginalProbabilityCalibrator that should be used to fit the calibration model

  • labelMatrix – A reference to an object of type IRowWiseLabelMatrix that provides row-wise access to the labels of the training examples

  • statistics – A reference to an object of type IStatistics that provides access to statistics about the labels of the training examples

Returns:

An unique pointer to an object of type IMarginalProbabilityCalibrationModel that 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 IJointProbabilityCalibrator that should be used to fit the calibration model

  • labelMatrix – A reference to an object of type IRowWiseLabelMatrix that provides row-wise access to the labels of the training examples

  • statistics – A reference to an object of type IStatistics that provides access to statistics about the labels of the training examples

Returns:

An unique pointer to an object of type IJointProbabilityCalibrationModel that has been fit