公有成员 | 保护成员 | 保护属性

CPerformanceMeasures类参考


详细描述

Class to implement various performance measures.

based on: Fawcett, T: March 2004, ROC Graphs: Notes and Practical Considerations for Researchers and input from Sonnenburg, S: Feburary 2008, various discussions

在文件PerformanceMeasures.h45行定义。

继承图,类CPerformanceMeasures
Inheritance graph
[图例]

所有成员的列表。

公有成员

 CPerformanceMeasures ()
 CPerformanceMeasures (CLabels *true_labels, CLabels *output)
virtual ~CPerformanceMeasures ()
bool set_true_labels (CLabels *true_labels)
CLabelsget_true_labels () const
bool set_output (CLabels *output)
CLabelsget_output () const
int32_t get_num_labels () const
void get_ROC (float64_t **result, int32_t *num, int32_t *dim)
float64_t get_auROC ()
float64_t get_aoROC ()
void get_PRC (float64_t **result, int32_t *num, int32_t *dim)
float64_t get_auPRC ()
float64_t get_aoPRC ()
void get_DET (float64_t **result, int32_t *num, int32_t *dim)
float64_t get_auDET ()
float64_t get_aoDET ()
void get_all_accuracy (float64_t **result, int32_t *num, int32_t *dim)
float64_t get_accuracy (float64_t threshold=0)
void get_all_error (float64_t **result, int32_t *num, int32_t *dim)
float64_t get_error (float64_t threshold=0)
void get_all_fmeasure (float64_t **result, int32_t *num, int32_t *dim)
float64_t get_fmeasure (float64_t threshold=0)
void get_all_CC (float64_t **result, int32_t *num, int32_t *dim)
float64_t get_CC (float64_t threshold=0)
void get_all_WRAcc (float64_t **result, int32_t *num, int32_t *dim)
float64_t get_WRAcc (float64_t threshold=0)
void get_all_BAL (float64_t **result, int32_t *num, int32_t *dim)
float64_t get_BAL (float64_t threshold=0)
virtual const char * get_name () const

保护成员

void init_nolabels ()
float64_t trapezoid_area (float64_t x1, float64_t x2, float64_t y1, float64_t y2)
void create_sortedROC ()
void compute_ROC (float64_t **result)
void compute_accuracy (float64_t **result, int32_t *num, int32_t *dim, bool do_error=false)
void compute_PRC (float64_t **result)
void compute_DET (float64_t **result)
void compute_confusion_matrix (float64_t threshold, int32_t *tp, int32_t *fp, int32_t *fn, int32_t *tn)

保护属性

CLabelsm_true_labels
CLabelsm_output
int32_t m_num_labels
int32_t m_all_true
int32_t m_all_false
int32_t * m_sortedROC
float64_t m_auROC
float64_t m_auPRC
float64_t m_auDET

构造及析构函数文档

default constructor

在文件PerformanceMeasures.cpp18行定义。

CPerformanceMeasures ( CLabels true_labels,
CLabels output 
)

constructor

参数:
true_labels true labels as seen in real world
output output labels/hypothesis from a classifier

在文件PerformanceMeasures.cpp27行定义。

~CPerformanceMeasures (  )  [virtual]

在文件PerformanceMeasures.cpp39行定义。


成员函数文档

void compute_accuracy ( float64_t **  result,
int32_t *  num,
int32_t *  dim,
bool  do_error = false 
) [protected]

compute ROC accuracy/error

参数:
result where the result will be stored
num number of points
dim dimension == 2 (output, accuracy/error)
do_error if error instead of accuracy shall be computed

在文件PerformanceMeasures.cpp385行定义。

void compute_confusion_matrix ( float64_t  threshold,
int32_t *  tp,
int32_t *  fp,
int32_t *  fn,
int32_t *  tn 
) [protected]

compute confusion matrix

caller has to delete[]

参数:
threshold threshold to compute against
tp storage of true positives or NULL if unused
fp storage of false positives or NULL if unused
fn storage of false negatives or NULL if unused
tn storage of true negatives or NULL if unused

在文件PerformanceMeasures.cpp148行定义。

void compute_DET ( float64_t **  result  )  [protected]

compute DET points and auDET

参数:
result where the result will be stored

在文件PerformanceMeasures.cpp332行定义。

void compute_PRC ( float64_t **  result  )  [protected]

compute PRC points and auPRC

参数:
result where the result will be stored

在文件PerformanceMeasures.cpp282行定义。

void compute_ROC ( float64_t **  result  )  [protected]

compute ROC points and auROC

在文件PerformanceMeasures.cpp208行定义。

void create_sortedROC (  )  [protected]

create index for ROC sorting

在文件PerformanceMeasures.cpp119行定义。

float64_t get_accuracy ( float64_t  threshold = 0  ) 

get classifier's accuracy at given threshold

参数:
threshold all values below are considered negative examples (default 0)
返回:
classifer's accuracy at threshold

在文件PerformanceMeasures.cpp373行定义。

void get_all_accuracy ( float64_t **  result,
int32_t *  num,
int32_t *  dim 
)

get classifier's accuracies (swig compatible)

accuracy = (true positives + true negatives) / all labels

caller has to free

参数:
result storage of accuracies in 2 dim array: (output, accuracy), sorted by output
num number of accuracy points
dim dimension == 2 (output, accuracy)

在文件PerformanceMeasures.cpp413行定义。

void get_all_BAL ( float64_t **  result,
int32_t *  num,
int32_t *  dim 
)

get classifier's Balanced Error (swig compatible)

BAL = 0.5 * ( true positives / all true labels + true negatives / all false labels )

caller has to free

参数:
result storage of BAL in 2 dim array: (output, BAL), sorted by output
num number of BAL points
dim dimension == 2 (output, BAL)

在文件PerformanceMeasures.cpp585行定义。

void get_all_CC ( float64_t **  result,
int32_t *  num,
int32_t *  dim 
)

get classifier's Cross Correlation coefficients (swig compatible)

CC = ( true positives * true negatives

  • false positives * false negatives ) / sqrt( (true positives + false positives) * (true positives + false negatives) * (true negatives + false positives) * (true negatives + false negatives) )

also check http://en.wikipedia.org/wiki/Correlation

caller has to free

参数:
result storage of CCs in 2 dim array: (output, CC), sorted by output
num number of CC points
dim dimension == 2 (output, CC)

在文件PerformanceMeasures.cpp494行定义。

void get_all_error ( float64_t **  result,
int32_t *  num,
int32_t *  dim 
)

get classifier's error rates (swig compatible)

value is 1 - accuracy

caller has to free

参数:
result storage of errors in 2 dim array: (output, error), sorted by output
num number of accuracy points
dim dimension == 2 (output, error)

在文件PerformanceMeasures.cpp419行定义。

void get_all_fmeasure ( float64_t **  result,
int32_t *  num,
int32_t *  dim 
)

get classifier's F-measure (swig compatible)

F-measure = 2 / (1 / precision + 1 / recall)

caller has to free

参数:
result storage of F-measure in 2 dim array (output, fmeasure), sorted by output
num number of accuracy points
dim dimension == 2 (output, fmeasure)

在文件PerformanceMeasures.cpp456行定义。

void get_all_WRAcc ( float64_t **  result,
int32_t *  num,
int32_t *  dim 
)

get classifier's Weighted Relative Accuracy (swig compatible)

WRAcc = ( true positives / (true positives + false negatives) )

  • ( false positives / (false positives + true negatives) )

caller has to free

参数:
result storage of WRAccs in 2 dim array: (output, WRAcc), sorted by output
num number of WRAcc points
dim dimension == 2 (output, WRAcc)

在文件PerformanceMeasures.cpp541行定义。

float64_t get_aoDET (  ) 

return area over Detection Error Tradeoff curve

value is 1 - auDET

返回:
area over DET curve

在文件PerformanceMeasures.h223行定义。

float64_t get_aoPRC (  ) 

return area over Precision Recall Curve

value is 1 - auPRC

返回:
area over PRC

在文件PerformanceMeasures.h180行定义。

float64_t get_aoROC (  ) 

return area over Reveiver Operating Curve

value is 1 - auROC

返回:
area over ROC

在文件PerformanceMeasures.h138行定义。

float64_t get_auDET (  ) 

return area under Detection Error Tradeoff curve

calculated by adding trapezoids

返回:
area under DET curve

在文件PerformanceMeasures.h205行定义。

float64_t get_auPRC (  ) 

return area under Precision Recall Curve

calculated by adding trapezoids

返回:
area under PRC

在文件PerformanceMeasures.h163行定义。

float64_t get_auROC (  ) 

return area under Receiver Operating Curve

calculated by adding trapezoids

返回:
area under ROC

在文件PerformanceMeasures.h120行定义。

float64_t get_BAL ( float64_t  threshold = 0  ) 

get classifier's Balanced Error at threshold 0

返回:
classifer's BAL at threshold 0

在文件PerformanceMeasures.cpp569行定义。

float64_t get_CC ( float64_t  threshold = 0  ) 

get classifier's Cross Correlation coefficient at threshold

返回:
classifer's CC at threshold

在文件PerformanceMeasures.cpp480行定义。

void get_DET ( float64_t **  result,
int32_t *  num,
int32_t *  dim 
)

get Detection Error Tradeoff curve for previously given labels (swig compatible)

DET point = false positives / all false labels, false negatives / all false labels

caller has to free

参数:
result where computed DET values will be stored
num number of labels/examples
dim dimension == 2 (false positive rate, false negative rate)

在文件PerformanceMeasures.cpp323行定义。

float64_t get_error ( float64_t  threshold = 0  ) 

get classifier's error at threshold

value is 1 - accuracy0

参数:
threshold all values below are considered negative examples (default 0)
返回:
classifer's error at threshold

在文件PerformanceMeasures.h270行定义。

float64_t get_fmeasure ( float64_t  threshold = 0  ) 

get classifier's F-measure at threshold 0

返回:
classifer's F-measure at threshold 0

在文件PerformanceMeasures.cpp427行定义。

virtual const char* get_name (  )  const [virtual]

get the name of tghe object

返回:
name of object

实现了CSGObject

在文件PerformanceMeasures.h383行定义。

int32_t get_num_labels (  )  const

get number of labels in output/true labels

返回:
number of labels in output/true labels

在文件PerformanceMeasures.h98行定义。

CLabels* get_output (  )  const

get classifier's output labels/hypothesis

返回:
output labels

在文件PerformanceMeasures.h88行定义。

void get_PRC ( float64_t **  result,
int32_t *  num,
int32_t *  dim 
)

get Precision Recall Curve for previously given labels (swig compatible)

PRC point = true positives / all true labels, true positives / (true positives + false positives)

caller has to free

参数:
result where computed ROC values will be stored
num number of labels/examples
dim dimension == 2 (recall, precision)

在文件PerformanceMeasures.cpp273行定义。

void get_ROC ( float64_t **  result,
int32_t *  num,
int32_t *  dim 
)

get Receiver Operating Curve for previously given labels (swig compatible)

ROC point = false positives / all false labels, true positives / all true labels

caller has to free

参数:
result where computed ROC values will be stored
num number of labels/examples
dim dimensions == 2 (false positive rate, true positive rate)

在文件PerformanceMeasures.cpp200行定义。

CLabels* get_true_labels (  )  const

get true labels as seen in real world

返回:
true labels as seen in real world

在文件PerformanceMeasures.h71行定义。

float64_t get_WRAcc ( float64_t  threshold = 0  ) 

get classifier's Weighted Relative Accuracy at threshold 0

返回:
classifer's WRAcc at threshold 0

在文件PerformanceMeasures.cpp522行定义。

void init_nolabels (  )  [protected]

initialise values independent from true labels/output

在文件PerformanceMeasures.cpp53行定义。

bool set_output ( CLabels output  ) 

set output labels/hypothesis from a classifier

参数:
output output labels
返回:
if setting was successful

在文件PerformanceMeasures.cpp103行定义。

bool set_true_labels ( CLabels true_labels  ) 

set true labels as seen in real world

参数:
true_labels true labels
返回:
if setting was successful

在文件PerformanceMeasures.cpp63行定义。

float64_t trapezoid_area ( float64_t  x1,
float64_t  x2,
float64_t  y1,
float64_t  y2 
) [protected]

calculate trapezoid area for auROC

参数:
x1 x coordinate of point 1
x2 x coordinate of point 2
y1 y coordinate of point 1
y2 y coordinate of point 2
返回:
trapezoid area for auROC

在文件PerformanceMeasures.cpp136行定义。


成员数据文档

int32_t m_all_false [protected]

number of negative examples in true_labels

在文件PerformanceMeasures.h456行定义。

int32_t m_all_true [protected]

number of positive examples in true_labels

在文件PerformanceMeasures.h454行定义。

float64_t m_auDET [protected]

area under DET; 1 - area over DET

在文件PerformanceMeasures.h466行定义。

float64_t m_auPRC [protected]

area under PRC; 1 - area over PRC

在文件PerformanceMeasures.h464行定义。

float64_t m_auROC [protected]

area under ROC; 1 - area over ROC

在文件PerformanceMeasures.h462行定义。

int32_t m_num_labels [protected]

number of true labels/outputs/accuracies/ROC points

在文件PerformanceMeasures.h451行定义。

CLabels* m_output [protected]

output labels/hypothesis from a classifier

在文件PerformanceMeasures.h449行定义。

int32_t* m_sortedROC [protected]

array of size num_labels with indices of true_labels/output sorted to fit ROC algorithm

在文件PerformanceMeasures.h460行定义。

CLabels* m_true_labels [protected]

true labels/examples as seen in real world

在文件PerformanceMeasures.h447行定义。


该类的文档由以下文件生成:

SHOGUN Machine Learning Toolbox - Documentation