File label_matrix_row_wise.hpp

class IRowWiseLabelMatrix : public ILabelMatrix
#include <label_matrix_row_wise.hpp>

Defines an interface for all label matrices that provide access to the labels of the training examples.

Subclassed by ICContiguousLabelMatrix, ICsrLabelMatrix

Public Functions

inline virtual ~IRowWiseLabelMatrix() override
virtual float32 calculateLabelCardinality() const = 0

Calculates and returns the label cardinality, i.e., the average number of relevant labels per example.

Returns:

The label cardinality

virtual std::unique_ptr<LabelVector> createLabelVector(uint32 row) const = 0

Creates and returns a label vector that corresponds to a specific row in the label matrix.

Parameters:

row – The row

Returns:

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

virtual std::unique_ptr<IStatisticsProvider> createStatisticsProvider(const IStatisticsProviderFactory &factory) const = 0

Creates and returns a new instance of the class IStatisticsProvider, based on the type of this label matrix.

Parameters:

factory – A reference to an object of type IStatisticsProviderFactory that should be used to create the instance

Returns:

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

virtual std::unique_ptr<IPartitionSampling> createPartitionSampling(const IPartitionSamplingFactory &factory) const = 0

Creates and returns a new instance of the class IPartitionSampling, based on the type of this label matrix.

Parameters:

factory – A reference to an object of type IPartitionSamplingFactory that should be used to create the instance

Returns:

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

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

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

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

  • partition – A reference to an object of type SinglePartition that provides access to the indices of the training examples that are included in the training set

  • 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 std::unique_ptr<IInstanceSampling> createInstanceSampling(const IInstanceSamplingFactory &factory, BiPartition &partition, IStatistics &statistics) const = 0

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

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

  • partition – A reference to an object of type BiPartition that provides access to the indices of the training examples that are included in the training set and the holdout set, respectively

  • 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 std::unique_ptr<IMarginalProbabilityCalibrationModel> fitMarginalProbabilityCalibrationModel(const IMarginalProbabilityCalibrator &probabilityCalibrator, const SinglePartition &partition, const IStatistics &statistics) const = 0

Fits and returns a model for the calibration of marginal probabilities, based on the type of this label matrix.

Parameters:
  • probabilityCalibrator – A reference to an object of type IMarginalProbabilityCalibrator that should be used to fit the calibration model

  • partition – A reference to an object of type SinglePartition that provides access to the indices of the training examples that are included in the training set

  • 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<IMarginalProbabilityCalibrationModel> fitMarginalProbabilityCalibrationModel(const IMarginalProbabilityCalibrator &probabilityCalibrator, BiPartition &partition, const IStatistics &statistics) const = 0

Fits and returns a model for the calibration of marginal probabilities, based on the type of this label matrix.

Parameters:
  • probabilityCalibrator – A reference to an object of type IMarginalProbabilityCalibrator that should be used to fit the calibration model

  • partition – A reference to an object of type BiPartition that provides access to the indices of the training examples that are included in the training set and the holdout set, respectively

  • 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 SinglePartition &partition, const IStatistics &statistics) const = 0

Fits and returns a model for the calibration of joint probabilities, based on the type of this label matrix.

Parameters:
  • probabilityCalibrator – A reference to an object of type IJointProbabilityCalibrator that should be used to fit the calibration model

  • partition – A reference to an object of type SinglePartition that provides access to the indices of the training examples that are included in the training set

  • 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

virtual std::unique_ptr<IJointProbabilityCalibrationModel> fitJointProbabilityCalibrationModel(const IJointProbabilityCalibrator &probabilityCalibrator, BiPartition &partition, const IStatistics &statistics) const = 0

Fits and returns a model for the calibration of joint probabilities, based on the type of this label matrix.

Parameters:
  • probabilityCalibrator – A reference to an object of type IJointProbabilityCalibrator that should be used to fit the calibration model

  • partition – A reference to an object of type BiPartition that provides access to the indices of the training examples that are included in the training set and the holdout set, respectively

  • 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