27 ASSERT(predicted && ground_truth)
47 int32_t length = orig_labels.
vlen;
48 for (i=0; i<length; i++)
54 for(i=0; i<length; i++)
63 for (i=0; i<length-1; i++)
65 if (labels[i] != labels[i+1])
77 for(i=0; i<length; i++)
86 REQUIRE(pos_count>0,
"%s::evaluate_roc(): Number of positive labels is "
88 REQUIRE(neg_count>0,
"%s::evaluate_roc(): Number of negative labels is "
95 for(i=0; i<length; i++)
99 if (label != threshold)
107 m_thresholds[i]=threshold;
109 if (ground_truth->
get_value(idxs[i]) > 0)
130 SG_ERROR(
"Uninitialized, please call evaluate first")
138 SG_ERROR(
"Uninitialized, please call evaluate first")
146 SG_ERROR(
"Uninitialized, please call evaluate first")
virtual float64_t get_value(int32_t idx)
virtual ELabelType get_label_type() const =0
virtual const char * get_name() const
SGVector< float64_t > get_thresholds()
The class Labels models labels, i.e. class assignments of objects.
virtual int32_t get_num_labels() const =0
SGMatrix< float64_t > m_ROC_graph
float64_t evaluate_roc(CLabels *predicted, CLabels *ground_truth)
SGMatrix< float64_t > get_ROC()
static const float64_t ALMOST_NEG_INFTY
almost neg (log) infinity
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()
all of classes and functions are contained in the shogun namespace
virtual float64_t evaluate(CLabels *predicted, CLabels *ground_truth)
virtual void ensure_valid(const char *context=NULL)=0
static void qsort_backward_index(T1 *output, T2 *index, int32_t size)
SGVector< float64_t > m_thresholds