Skip to content

Commit

Permalink
Added ensure_valid to ROC, PRC and ContingencyTableEvaluation
Browse files Browse the repository at this point in the history
  • Loading branch information
lisitsyn committed May 22, 2012
1 parent c3b256b commit c196b13
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/shogun/evaluation/ContingencyTableEvaluation.cpp
Expand Up @@ -17,6 +17,8 @@ float64_t CContingencyTableEvaluation::evaluate(CLabels* predicted, CLabels* gro
{
ASSERT(predicted->get_label_type()==LT_BINARY);
ASSERT(ground_truth->get_label_type()==LT_BINARY);
predicted->ensure_valid();
ground_truth->ensure_valid();
compute_scores((CBinaryLabels*)predicted,(CBinaryLabels*)ground_truth);
switch (m_type)
{
Expand Down
1 change: 1 addition & 0 deletions src/shogun/evaluation/PRCEvaluation.cpp
Expand Up @@ -25,6 +25,7 @@ float64_t CPRCEvaluation::evaluate(CLabels* predicted, CLabels* ground_truth)
ASSERT(predicted->get_num_labels()==ground_truth->get_num_labels());
ASSERT(predicted->get_label_type()==LT_BINARY);
ASSERT(ground_truth->get_label_type()==LT_BINARY);
ground_truth->ensure_valid();

// number of true positive examples
float64_t tp = 0.0;
Expand Down
1 change: 1 addition & 0 deletions src/shogun/evaluation/ROCEvaluation.cpp
Expand Up @@ -23,6 +23,7 @@ float64_t CROCEvaluation::evaluate(CLabels* predicted, CLabels* ground_truth)
ASSERT(predicted->get_num_labels()==ground_truth->get_num_labels());
ASSERT(predicted->get_label_type()==LT_BINARY);
ASSERT(ground_truth->get_label_type()==LT_BINARY);
ground_truth->ensure_valid();

// assume threshold as negative infinity
float64_t threshold = CMath::ALMOST_NEG_INFTY;
Expand Down

0 comments on commit c196b13

Please sign in to comment.