File predictor_binary_output_wise.hpp

namespace boosting
class IOutputWiseBinaryPredictorConfig
#include <predictor_binary_output_wise.hpp>

Defines an interface for all classes that allow to configure a predictor that predicts whether individual labels of given query examples are relevant or irrelevant by discretizing the individual scores or probability estimates that are predicted for each label.

Subclassed by boosting::OutputWiseBinaryPredictorConfig

Public Functions

inline virtual ~IOutputWiseBinaryPredictorConfig()
virtual bool isBasedOnProbabilities() const = 0

Returns whether binary predictions are derived from probability estimates rather than scores or not.

Returns:

True, if binary predictions are derived from probability estimates rather than scores, false otherwise

virtual IOutputWiseBinaryPredictorConfig &setBasedOnProbabilities(bool basedOnProbabilities) = 0

Sets whether binary predictions should be derived from probability estimates rather than scores or not.

Parameters:

basedOnProbabilities – True, if binary predictions should be derived from probability estimates rather than scores, false otherwise

Returns:

A reference to an object of type IOutputWiseBinaryPredictorConfig that allows further configuration of the predictor

virtual bool isProbabilityCalibrationModelUsed() const = 0

Returns whether a model for the calibration of probabilities is used, if available, or not.

Returns:

True, if a model for the calibration of probabilities is used, if available, false otherwise

virtual IOutputWiseBinaryPredictorConfig &setUseProbabilityCalibrationModel(bool useProbabilityCalibrationModel) = 0

Sets whether a model for the calibration of probabilities should be used, if available, or not.

Parameters:

useProbabilityCalibrationModel – True, if a model for the calibration of probabilities should be used, if available, false otherwise

Returns:

A reference to an object of type IOutputWiseBinaryPredictorConfig that allows further configuration of the predictor

class OutputWiseBinaryPredictorConfig : public boosting::IOutputWiseBinaryPredictorConfig, public IBinaryPredictorConfig
#include <predictor_binary_output_wise.hpp>

Allows to configure a predictor that predicts whether individual labels of given query examples are relevant or irrelevant by discretizing the individual scores or probability estimates that are predicted for each label.

Public Functions

OutputWiseBinaryPredictorConfig(ReadableProperty<IClassificationLossConfig> lossConfig, ReadableProperty<IMultiThreadingConfig> multiThreadingConfig)
Parameters:
  • lossConfig – A ReadableProperty that allows to access the IClassificationLossConfig that stores the configuration of the loss function

  • multiThreadingConfig – A ReadableProperty that allows to access the IMultiThreadingConfig that stores the configuration of the multi-threading behavior that should be used to predict for several query examples in parallel

virtual bool isBasedOnProbabilities() const override

Returns whether binary predictions are derived from probability estimates rather than scores or not.

Returns:

True, if binary predictions are derived from probability estimates rather than scores, false otherwise

virtual IOutputWiseBinaryPredictorConfig &setBasedOnProbabilities(bool basedOnProbabilities) override

Sets whether binary predictions should be derived from probability estimates rather than scores or not.

Parameters:

basedOnProbabilities – True, if binary predictions should be derived from probability estimates rather than scores, false otherwise

Returns:

A reference to an object of type IOutputWiseBinaryPredictorConfig that allows further configuration of the predictor

virtual bool isProbabilityCalibrationModelUsed() const override

Returns whether a model for the calibration of probabilities is used, if available, or not.

Returns:

True, if a model for the calibration of probabilities is used, if available, false otherwise

virtual IOutputWiseBinaryPredictorConfig &setUseProbabilityCalibrationModel(bool useProbabilityCalibrationModel) override

Sets whether a model for the calibration of probabilities should be used, if available, or not.

Parameters:

useProbabilityCalibrationModel – True, if a model for the calibration of probabilities should be used, if available, false otherwise

Returns:

A reference to an object of type IOutputWiseBinaryPredictorConfig that allows further configuration of the predictor

std::unique_ptr<IBinaryPredictorFactory> createPredictorFactory(const IRowWiseFeatureMatrix &featureMatrix, uint32 numOutputs) const override

See also

IPredictorFactory::createPredictorFactory

std::unique_ptr<ISparseBinaryPredictorFactory> createSparsePredictorFactory(const IRowWiseFeatureMatrix &featureMatrix, uint32 numLabels) const override

See also

IBinaryPredictorFactory::createSparsePredictorFactory

bool isLabelVectorSetNeeded() const override

See also

IPredictorConfig::isLabelVectorSetNeeded

Private Members

bool basedOnProbabilities_
std::unique_ptr<IMarginalProbabilityCalibrationModel> noMarginalProbabilityCalibrationModelPtr_
const ReadableProperty<IClassificationLossConfig> lossConfig_
const ReadableProperty<IMultiThreadingConfig> multiThreadingConfig_