Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #632 from karlnapf/master
fix for an example and debug messages
  • Loading branch information
karlnapf committed Jul 8, 2012
2 parents 7cfd299 + 94a6183 commit c593061
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
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
6 changes: 6 additions & 0 deletions src/shogun/evaluation/CrossValidation.cpp
Expand Up @@ -174,6 +174,7 @@ float64_t CCrossValidation::evaluate_one_run()
/* different behavior whether data is locked or not */
if (m_machine->is_data_locked())
{
SG_DEBUG("starting locked evaluation\n", get_name());
/* do actual cross-validation */
for (index_t i=0; i <num_subsets; ++i)
{
Expand Down Expand Up @@ -203,10 +204,13 @@ float64_t CCrossValidation::evaluate_one_run()

/* clean up */
SG_UNREF(result_labels);

SG_DEBUG("done locked evaluation\n", get_name());
}
}
else
{
SG_DEBUG("starting unlocked evaluation\n", get_name());
/* tell machine to store model internally
* (otherwise changing subset of features will kaboom the classifier) */
m_machine->set_store_model_features(true);
Expand Down Expand Up @@ -262,6 +266,8 @@ float64_t CCrossValidation::evaluate_one_run()
SG_UNREF(result_labels);
m_labels->remove_subset();
}

SG_DEBUG("done unlocked evaluation\n", get_name());
}

/* build arithmetic mean of results */
Expand Down
2 changes: 0 additions & 2 deletions src/shogun/machine/KernelMachine.cpp
Expand Up @@ -260,15 +260,13 @@ SGVector<float64_t> CKernelMachine::apply_get_outputs(CFeatures* data)
data->get_name());
}

/*
if (data && kernel->get_kernel_type()!=K_COMBINED)
{
CFeatures* lhs=kernel->get_lhs();
REQUIRE(lhs, "%s: No left hand side specified\n", get_name());
kernel->init(lhs, data);
SG_UNREF(lhs);
}
*/

int32_t num_vectors=kernel->get_num_vec_rhs();

Expand Down

0 comments on commit c593061

Please sign in to comment.