6 #ifndef DISMEC_WEIGHTING_H
7 #define DISMEC_WEIGHTING_H
Simple weighting scheme that assigns the same weighting to all label_ids.
double get_positive_weight(label_id_t label_id) const override
Gets the weight to use for all examples where the label label_id is present.
ConstantWeighting(double positive_cost, double negative_cost)
double m_NegativeCost
Cost to use if the label is absent, independent of the label_id.
double m_PositiveCost
Cost to use if the label is present, independent of the label_id.
double get_negative_weight(label_id_t label_id) const override
Gets the weight to use for all examples where the label label_id is absent.
double get_positive_weight(label_id_t label_id) const override
Gets the weight to use for all examples where the label label_id is present.
double get_negative_weight(label_id_t label_id) const override
Gets the weight to use for all examples where the label label_id is absent.
DenseRealVector m_NegativeWeights
DenseRealVector m_PositiveWeights
CustomWeighting(DenseRealVector positive_weights, DenseRealVector negative_weights)
double get_positive_weight(label_id_t label_id) const override
Gets the weight to use for all examples where the label label_id is present.
PropensityModel m_Propensity
double get_negative_weight(label_id_t label_id) const override
Gets the weight to use for all examples where the label label_id is absent.
PropensityDownWeighting(PropensityModel model)
const DatasetBase * m_Data
PropensityModel(const DatasetBase *data, double a=0.55, double b=1.5)
double get_propensity(label_id_t label_id) const
PropensityModel m_Propensity
double get_negative_weight(label_id_t label_id) const override
Gets the weight to use for all examples where the label label_id is absent.
PropensityWeighting(PropensityModel model)
double get_positive_weight(label_id_t label_id) const override
Gets the weight to use for all examples where the label label_id is present.
Base class for label-based weighting schemes.
virtual ~WeightingScheme()=default
virtual double get_positive_weight(label_id_t label_id) const =0
Gets the weight to use for all examples where the label label_id is present.
virtual double get_negative_weight(label_id_t label_id) const =0
Gets the weight to use for all examples where the label label_id is absent.
Strong typedef for an int to signify a label id.
Main namespace in which all types, classes, and functions are defined.
types::DenseVector< real_t > DenseRealVector
Any dense, real values vector.