File label_matrix_row_wise.hpp¶
-
class IRowWiseLabelMatrix : public IOutputMatrix¶
- #include <label_matrix_row_wise.hpp>
Defines an interface for all label matrices that provide access to the ground truth labels of 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
LabelVectorthat has been created
-
virtual std::unique_ptr<IInstanceSampling> createInstanceSampling(const IClassificationInstanceSamplingFactory &factory, const SinglePartition &partition, IStatistics &statistics, const EqualWeightVector &exampleWeights) 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
IClassificationInstanceSamplingFactorythat should be used to create the instancepartition – A reference to an object of type
SinglePartitionthat provides access to the indices of the training examples that are included in the training setstatistics – A reference to an object of type
IStatisticsthat provides access to statistics about the quality of predictions for training examplesexampleWeights – 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 SinglePartition &partition, IStatistics &statistics, const DenseWeightVector<float32> &exampleWeights) 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
IClassificationInstanceSamplingFactorythat should be used to create the instancepartition – A reference to an object of type
SinglePartitionthat provides access to the indices of the training examples that are included in the training setstatistics – A reference to an object of type
IStatisticsthat provides access to statistics about the quality of predictions for training examplesexampleWeights – 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 IClassificationInstanceSamplingFactory &factory, BiPartition &partition, IStatistics &statistics, const EqualWeightVector &exampleWeights) 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
IClassificationInstanceSamplingFactorythat should be used to create the instancepartition – A reference to an object of type
BiPartitionthat provides access to the indices of the training examples that are included in the training set and the holdout set, respectivelystatistics – A reference to an object of type
IStatisticsthat provides access to statistics about the quality of predictions for training examplesexampleWeights – 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, BiPartition &partition, IStatistics &statistics, const DenseWeightVector<float32> &exampleWeights) 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
IClassificationInstanceSamplingFactorythat should be used to create the instancepartition – A reference to an object of type
BiPartitionthat provides access to the indices of the training examples that are included in the training set and the holdout set, respectivelystatistics – A reference to an object of type
IStatisticsthat provides access to statistics about the quality of predictions for training examplesexampleWeights – A reference to an object of type
DenseeWeightVector<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<IPartitionSampling> createPartitionSampling(const IClassificationPartitionSamplingFactory &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
IClassificationPartitionSamplingFactorythat should be used to create the instance- Returns:
An unique pointer to an object of type
IPartitionSamplingthat has been created
-
virtual std::unique_ptr<IStatisticsProvider> createStatisticsProvider(const IClassificationStatisticsProviderFactory &factory) const = 0¶
Creates and returns a new instance of the class
IStatisticsProvider, based on the type of this output matrix.- Parameters:
factory – A reference to an object of type
IClassificationStatisticsProviderFactorythat should be used to create the instance- Returns:
An unique pointer to an object of type
IStatisticsProviderthat 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
IMarginalProbabilityCalibratorthat should be used to fit the calibration modelpartition – A reference to an object of type
SinglePartitionthat provides access to the indices of the training examples that are included in the training setstatistics – 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<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
IMarginalProbabilityCalibratorthat should be used to fit the calibration modelpartition – A reference to an object of type
BiPartitionthat provides access to the indices of the training examples that are included in the training set and the holdout set, respectivelystatistics – 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 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
IJointProbabilityCalibratorthat should be used to fit the calibration modelpartition – A reference to an object of type
SinglePartitionthat provides access to the indices of the training examples that are included in the training setstatistics – 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
-
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
IJointProbabilityCalibratorthat should be used to fit the calibration modelpartition – A reference to an object of type
BiPartitionthat provides access to the indices of the training examples that are included in the training set and the holdout set, respectivelystatistics – 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 ~IRowWiseLabelMatrix() override¶