DiSMEC++
dismec::prediction::ConfusionMatrixRecorder Class Reference

#include <metrics.h>

Inheritance diagram for dismec::prediction::ConfusionMatrixRecorder:
dismec::prediction::MetricCollectionInterface

Public Member Functions

 ConfusionMatrixRecorder (long num_labels, long k)
 
void update (const pd_info_vec &prediction, const gt_info_vec &labels) override
 
void reduce (const MetricCollectionInterface &other) override
 
std::unique_ptr< MetricCollectionInterfaceclone () const override
 
long get_k () const
 
ConfusionMatrix get_confusion_matrix (label_id_t label) 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
 
long m_InstanceCount = 0
 
std::vector< ConfusionMatrixm_Confusion
 

Additional Inherited Members

- Public Types inherited from dismec::prediction::MetricCollectionInterface
using gt_info_vec = std::vector< sTrueLabelInfo >
 
using pd_info_vec = std::vector< sPredLabelInfo >
 

Detailed Description

Definition at line 47 of file metrics.h.

Constructor & Destructor Documentation

◆ ConfusionMatrixRecorder()

ConfusionMatrixRecorder::ConfusionMatrixRecorder ( long  num_labels,
long  k 
)

Member Function Documentation

◆ clone()

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

◆ get_confusion_matrix()

ConfusionMatrix ConfusionMatrixRecorder::get_confusion_matrix ( label_id_t  label) const

◆ get_k()

long dismec::prediction::ConfusionMatrixRecorder::get_k ( ) const
inline

◆ reduce()

void ConfusionMatrixRecorder::reduce ( const MetricCollectionInterface other)
overridevirtual

◆ update()

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

Implements dismec::prediction::MetricCollectionInterface.

Definition at line 29 of file metrics.cpp.

References m_Confusion, m_InstanceCount, and m_K.

Member Data Documentation

◆ m_Confusion

std::vector<ConfusionMatrix> dismec::prediction::ConfusionMatrixRecorder::m_Confusion
private

Definition at line 59 of file metrics.h.

Referenced by ConfusionMatrixRecorder(), get_confusion_matrix(), reduce(), and update().

◆ m_InstanceCount

long dismec::prediction::ConfusionMatrixRecorder::m_InstanceCount = 0
private

Definition at line 58 of file metrics.h.

Referenced by get_confusion_matrix(), reduce(), and update().

◆ m_K

long dismec::prediction::ConfusionMatrixRecorder::m_K
private

Definition at line 57 of file metrics.h.

Referenced by clone(), get_k(), reduce(), and update().


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