classias::precall Class Reference


Detailed Description

Counter for precision, recall, and F1 scores.


Public Member Functions

 precall (int N)
 Constructs an object.
virtual ~precall ()
 Destructs an object.
void resize (int N)
 Resize the number of labels.
void set (int p, int r)
 Sets a pair of predicted and reference labels.
template<class positive_iterator_type>
void output_micro (std::ostream &os, positive_iterator_type pb, positive_iterator_type pe) const
 Outputs micro-average precision, recall, F1 scores.
template<class positive_iterator_type>
void output_macro (std::ostream &os, positive_iterator_type pb, positive_iterator_type pe) const
 Outputs macro-average precision, recall, F1 scores.

Protected Attributes

std::vector< label_statm_stat
 The label-wise stats.

Data Structures

struct  label_stat
 A counter for each label. More...


Constructor & Destructor Documentation

classias::precall::precall ( int  N  )  [inline]

Constructs an object.

Parameters:
N The number of labels.


Member Function Documentation

void classias::precall::resize ( int  N  )  [inline]

Resize the number of labels.

Parameters:
N The number of labels.

void classias::precall::set ( int  p,
int  r 
) [inline]

Sets a pair of predicted and reference labels.

Parameters:
p The predicted label.
r The reference label.

template<class positive_iterator_type>
void classias::precall::output_micro ( std::ostream &  os,
positive_iterator_type  pb,
positive_iterator_type  pe 
) const [inline]

Outputs micro-average precision, recall, F1 scores.

Parameters:
os The output stream.
pb The iterator for the first element of the positive labels.
pe The iterator just beyond the last element of the positive labels.

template<class positive_iterator_type>
void classias::precall::output_macro ( std::ostream &  os,
positive_iterator_type  pb,
positive_iterator_type  pe 
) const [inline]

Outputs macro-average precision, recall, F1 scores.

Parameters:
os The output stream.
pb The iterator for the first element of the positive labels.
pe The iterator just beyond the last element of the positive labels.


Copyright (c) 2002-2009 by Naoaki Okazaki
Mon Dec 28 23:41:05 2009