DiSMEC++
dismec::CustomWeighting Class Reference

#include <weighting.h>

Inheritance diagram for dismec::CustomWeighting:
dismec::WeightingScheme

Public Member Functions

 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. More...
 
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. More...
 
- Public Member Functions inherited from dismec::WeightingScheme
virtual ~WeightingScheme ()=default
 

Private Attributes

DenseRealVector m_PositiveWeights
 
DenseRealVector m_NegativeWeights
 

Detailed Description

Definition at line 74 of file weighting.h.

Constructor & Destructor Documentation

◆ CustomWeighting()

CustomWeighting::CustomWeighting ( DenseRealVector  positive_weights,
DenseRealVector  negative_weights 
)
explicit

Definition at line 70 of file weighting.cpp.

References m_NegativeWeights, and m_PositiveWeights.

Member Function Documentation

◆ get_negative_weight()

double CustomWeighting::get_negative_weight ( label_id_t  label_id) const
overridevirtual

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

Implements dismec::WeightingScheme.

Definition at line 89 of file weighting.cpp.

References m_NegativeWeights, and dismec::opaque_int_type< Tag, T >::to_index().

◆ get_positive_weight()

double CustomWeighting::get_positive_weight ( label_id_t  label_id) const
overridevirtual

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

Implements dismec::WeightingScheme.

Definition at line 80 of file weighting.cpp.

References m_PositiveWeights, and dismec::opaque_int_type< Tag, T >::to_index().

Member Data Documentation

◆ m_NegativeWeights

DenseRealVector dismec::CustomWeighting::m_NegativeWeights
private

Definition at line 82 of file weighting.h.

Referenced by CustomWeighting(), and get_negative_weight().

◆ m_PositiveWeights

DenseRealVector dismec::CustomWeighting::m_PositiveWeights
private

Definition at line 81 of file weighting.h.

Referenced by CustomWeighting(), and get_positive_weight().


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