Skip to content

Commit

Permalink
added a proper error message if number of labels are different
Browse files Browse the repository at this point in the history
  • Loading branch information
karlnapf committed Jul 8, 2012
1 parent 7cfd299 commit 1bc6e55
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/shogun/evaluation/ContingencyTableEvaluation.cpp
Expand Up @@ -84,7 +84,12 @@ void CContingencyTableEvaluation::compute_scores(CBinaryLabels* predicted, CBina
ASSERT(ground_truth->get_label_type() == LT_BINARY);
ASSERT(predicted->get_label_type() == LT_BINARY);

ASSERT(predicted->get_num_labels()==ground_truth->get_num_labels());
if (predicted->get_num_labels()!=ground_truth->get_num_labels())
{
SG_ERROR("%s::compute_scores(): Number of predicted labels (%d) is not "
"equal to number of ground truth labels (%d)!\n", get_name(),
predicted->get_num_labels(), ground_truth->get_num_labels());
}
m_TP = 0.0;
m_FP = 0.0;
m_TN = 0.0;
Expand Down

0 comments on commit 1bc6e55

Please sign in to comment.