20 ASSERT(predicted && ground_truth)
28 for (int32_t i=0; i<length; i++)
37 int32_t total = length;
38 for (int32_t i=0; i<length; i++)
48 SG_DEBUG(
"correct=%d, total=%d, rejected=%d\n",correct,total,length-total)
60 memset(confusion_matrix.
matrix,0,
sizeof(int32_t)*num_classes*num_classes);
61 for (int32_t i=0; i<length; i++)
64 int32_t ground_truth_label = ((
CMulticlassLabels*) ground_truth)->get_int_label(i);
69 confusion_matrix[predicted_label*num_classes+ground_truth_label]++;
71 return confusion_matrix;
virtual ELabelType get_label_type() const =0
virtual float64_t evaluate(CLabels *predicted, CLabels *ground_truth)
The class Labels models labels, i.e. class assignments of objects.
virtual int32_t get_num_labels() const =0
multi-class labels 0,1,...
Multiclass Labels for multi-class classification.
static SGMatrix< int32_t > get_confusion_matrix(CLabels *predicted, CLabels *ground_truth)
all of classes and functions are contained in the shogun namespace