14 using namespace shogun;
23 ASSERT(predicted && ground_truth);
41 int32_t length = orig_labels.
vlen;
46 int32_t* idxs =
SG_MALLOC(int32_t, length);
47 for(i=0; i<length; i++)
56 for (i=0; i<length-1; i++)
58 if (labels[i] != labels[i+1])
71 for(i=0; i<length; i++)
80 ASSERT(pos_count>0 && neg_count>0);
86 for(i=0; i<length; i++)
90 if (label != threshold)
100 if (ground_truth->
get_label(idxs[i]) > 0)
124 SG_ERROR(
"Uninitialized, please call evaluate first");
134 SG_ERROR(
"Uninitialized, please call evaluate first");
144 SG_ERROR(
"Uninitialized, please call evaluate first");
SGVector< float64_t > get_labels()
SGVector< float64_t > get_thresholds()
The class Labels models labels, i.e. class assignments of objects.
SGMatrix< float64_t > get_ROC()
static const float64_t ALMOST_NEG_INFTY
almost neg (log) infinity
virtual void free_vector()
float64_t get_label(int32_t idx)
static T * clone_vector(const T *vec, int32_t len)
static float64_t area_under_curve(float64_t *xy, int32_t len, bool reversed)
virtual ~CROCEvaluation()
bool is_two_class_labeling()
virtual float64_t evaluate(CLabels *predicted, CLabels *ground_truth)
#define SG_MALLOC(type, len)
static void qsort_backward_index(T1 *output, T2 *index, int32_t size)