DiSMEC++
|
Simple weighting scheme that assigns the same weighting to all label_id
s.
More...
#include <weighting.h>
Public Member Functions | |
ConstantWeighting (double positive_cost, double negative_cost) | |
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 | |
double | m_PositiveCost |
Cost to use if the label is present, independent of the label_id . More... | |
double | m_NegativeCost |
Cost to use if the label is absent, independent of the label_id . More... | |
Simple weighting scheme that assigns the same weighting to all label_id
s.
This realization of a WeightingScheme only returns two different values, one if the label is there and another if it is not.
Definition at line 46 of file weighting.h.
ConstantWeighting::ConstantWeighting | ( | double | positive_cost, |
double | negative_cost | ||
) |
Definition at line 37 of file weighting.cpp.
|
overridevirtual |
Gets the weight to use for all examples where the label label_id
is absent.
Implements dismec::WeightingScheme.
Definition at line 33 of file weighting.cpp.
References m_NegativeCost.
Referenced by TEST_CASE().
|
overridevirtual |
Gets the weight to use for all examples where the label label_id
is present.
Implements dismec::WeightingScheme.
Definition at line 29 of file weighting.cpp.
References m_PositiveCost.
Referenced by TEST_CASE().
|
private |
Cost to use if the label is absent, independent of the label_id
.
Definition at line 53 of file weighting.h.
Referenced by get_negative_weight().
|
private |
Cost to use if the label is present, independent of the label_id
.
Definition at line 52 of file weighting.h.
Referenced by get_positive_weight().