SHOGUN
v1.1.0
|
The class ContingencyTableEvaluation a base class used to evaluate 2-class classification with TP, FP, TN, FN rates.
This class has implementations of the measures listed below:
Accuracy (ACCURACY):
Error rate (ERROR_RATE):
Balanced error (BAL):
Weighted relative accuracy (WRACC):
F1 score (F1):
Cross correlation coefficient (CROSS_CORRELATION):
Recall (RECALL):
Precision (PRECISION):
Specificity (SPECIFICITY):
Note that objects of this class should be used only if computing of many different measures is required. In other case, using helper classes (CAccuracyMeasure, ...) could be more convenient.
Definition at line 69 of file ContingencyTableEvaluation.h.
Protected Member Functions | |
void | compute_scores (CLabels *predicted, CLabels *ground_truth) |
Protected Attributes | |
EContingencyTableMeasureType | m_type |
bool | m_computed |
int32_t | m_N |
float64_t | m_TP |
float64_t | m_FP |
float64_t | m_TN |
float64_t | m_FN |
Additional Inherited Members | |
![]() | |
SGIO * | io |
Parallel * | parallel |
Version * | version |
Parameter * | m_parameters |
Parameter * | m_model_selection_parameters |
constructor
Definition at line 75 of file ContingencyTableEvaluation.h.
constructor
type | type of measure (e.g ACCURACY) |
Definition at line 81 of file ContingencyTableEvaluation.h.
|
virtual |
destructor
Definition at line 85 of file ContingencyTableEvaluation.h.
get scores for TP, FP, TN, FN
Definition at line 73 of file ContingencyTableEvaluation.cpp.
evaluate labels
predicted | labels |
ground_truth | labels assumed to be correct |
Implements CBinaryClassEvaluation.
Definition at line 15 of file ContingencyTableEvaluation.cpp.
float64_t get_accuracy | ( | ) | const |
float64_t get_BAL | ( | ) | const |
Balanced error (BAL)
Definition at line 127 of file ContingencyTableEvaluation.h.
float64_t get_cross_correlation | ( | ) | const |
cross correlation
Definition at line 160 of file ContingencyTableEvaluation.h.
float64_t get_error_rate | ( | ) | const |
|
virtual |
Implements CEvaluation.
Definition at line 44 of file ContingencyTableEvaluation.cpp.
float64_t get_F1 | ( | ) | const |
|
virtual |
get name
Implements CSGObject.
Reimplemented in CSpecificityMeasure, CPrecisionMeasure, CRecallMeasure, CCrossCorrelationMeasure, CF1Measure, CWRACCMeasure, CBALMeasure, CErrorRateMeasure, and CAccuracyMeasure.
Definition at line 97 of file ContingencyTableEvaluation.h.
float64_t get_precision | ( | ) | const |
float64_t get_recall | ( | ) | const |
float64_t get_specificity | ( | ) | const |
specificity
Definition at line 193 of file ContingencyTableEvaluation.h.
float64_t get_WRACC | ( | ) | const |
|
protected |
indicator of contingencies being computed
Definition at line 210 of file ContingencyTableEvaluation.h.
|
protected |
number of false negative examples
Definition at line 225 of file ContingencyTableEvaluation.h.
|
protected |
number of false positive examples
Definition at line 219 of file ContingencyTableEvaluation.h.
|
protected |
total number of labels
Definition at line 213 of file ContingencyTableEvaluation.h.
|
protected |
number of true negative examples
Definition at line 222 of file ContingencyTableEvaluation.h.
|
protected |
number of true positive examples
Definition at line 216 of file ContingencyTableEvaluation.h.
|
protected |
type of measure to evaluate
Definition at line 207 of file ContingencyTableEvaluation.h.