DiSMEC++
dismec::prediction::InstanceRankedPositives Class Reference

#include <metrics.h>

Inheritance diagram for dismec::prediction::InstanceRankedPositives:
dismec::prediction::InstanceAveragedMetric dismec::prediction::MetricCollectionInterface

Public Member Functions

 InstanceRankedPositives (long num_labels, long k, bool normalize=false)
 
 InstanceRankedPositives (long num_labels, long k, bool normalize, std::vector< double > weights)
 
void update (const pd_info_vec &prediction, const gt_info_vec &labels) override
 
std::unique_ptr< MetricCollectionInterfaceclone () const override
 
- Public Member Functions inherited from dismec::prediction::InstanceAveragedMetric
 InstanceAveragedMetric (long num_labels)
 
void reduce (const MetricCollectionInterface &other) override
 
double value () const
 
- Public Member Functions inherited from dismec::prediction::MetricCollectionInterface
 MetricCollectionInterface (long num_labels)
 
virtual ~MetricCollectionInterface ()=default
 
long num_labels () const
 Gets the number of labels. More...
 

Private Attributes

long m_K
 
bool m_Normalize
 
std::vector< double > m_Weights
 
std::vector< double > m_Cumulative
 

Additional Inherited Members

- Public Types inherited from dismec::prediction::MetricCollectionInterface
using gt_info_vec = std::vector< sTrueLabelInfo >
 
using pd_info_vec = std::vector< sPredLabelInfo >
 
- Protected Member Functions inherited from dismec::prediction::InstanceAveragedMetric
void accumulate (double value)
 

Detailed Description

Definition at line 79 of file metrics.h.

Constructor & Destructor Documentation

◆ InstanceRankedPositives() [1/2]

InstanceRankedPositives::InstanceRankedPositives ( long  num_labels,
long  k,
bool  normalize = false 
)

Definition at line 100 of file metrics.cpp.

◆ InstanceRankedPositives() [2/2]

InstanceRankedPositives::InstanceRankedPositives ( long  num_labels,
long  k,
bool  normalize,
std::vector< double >  weights 
)

Definition at line 105 of file metrics.cpp.

References ALWAYS_ASSERT_EQUAL, m_Cumulative, m_K, m_Weights, and dismec::ssize().

Member Function Documentation

◆ clone()

std::unique_ptr< MetricCollectionInterface > InstanceRankedPositives::clone ( ) const
overridevirtual

◆ update()

void InstanceRankedPositives::update ( const pd_info_vec prediction,
const gt_info_vec labels 
)
overridevirtual

Member Data Documentation

◆ m_Cumulative

std::vector<double> dismec::prediction::InstanceRankedPositives::m_Cumulative
private

Definition at line 89 of file metrics.h.

Referenced by InstanceRankedPositives(), and update().

◆ m_K

long dismec::prediction::InstanceRankedPositives::m_K
private

Definition at line 86 of file metrics.h.

Referenced by clone(), InstanceRankedPositives(), and update().

◆ m_Normalize

bool dismec::prediction::InstanceRankedPositives::m_Normalize
private

Definition at line 87 of file metrics.h.

Referenced by clone(), and update().

◆ m_Weights

std::vector<double> dismec::prediction::InstanceRankedPositives::m_Weights
private

Definition at line 88 of file metrics.h.

Referenced by clone(), InstanceRankedPositives(), and update().


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