DiSMEC++
dismec::WeightingScheme Class Referenceabstract

Base class for label-based weighting schemes. More...

#include <weighting.h>

Inheritance diagram for dismec::WeightingScheme:
dismec::ConstantWeighting dismec::CustomWeighting dismec::PropensityDownWeighting dismec::PropensityWeighting

Public Member Functions

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. More...
 
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. More...
 

Detailed Description

Base class for label-based weighting schemes.

A label-based weighting scheme assigns each training example a weight depending on whether the labels is present or absent. These weights can depend on the label id, and are requested using the get_positive_weight() and get_negative_weight() functions respectively.

Definition at line 32 of file weighting.h.

Constructor & Destructor Documentation

◆ ~WeightingScheme()

virtual dismec::WeightingScheme::~WeightingScheme ( )
virtualdefault

Member Function Documentation

◆ get_negative_weight()

virtual double dismec::WeightingScheme::get_negative_weight ( label_id_t  label_id) const
pure virtual

Gets the weight to use for all examples where the label label_id is absent.

Implemented in dismec::CustomWeighting, dismec::PropensityDownWeighting, dismec::PropensityWeighting, and dismec::ConstantWeighting.

Referenced by anonymous_namespace{py_train.cpp}::get_negative_weight().

◆ get_positive_weight()

virtual double dismec::WeightingScheme::get_positive_weight ( label_id_t  label_id) const
pure virtual

Gets the weight to use for all examples where the label label_id is present.

Implemented in dismec::CustomWeighting, dismec::PropensityDownWeighting, dismec::PropensityWeighting, and dismec::ConstantWeighting.

Referenced by anonymous_namespace{py_train.cpp}::get_positive_weight().


The documentation for this class was generated from the following file: