Skip to content

Commit

Permalink
Added missed initialization of custom evaluations array
Browse files Browse the repository at this point in the history
  • Loading branch information
lisitsyn committed Jul 26, 2012
1 parent 09b53b5 commit 57d6371
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/shogun/evaluation/CrossValidation.cpp
Expand Up @@ -299,6 +299,7 @@ float64_t CCrossValidation::evaluate_one_run(CModelSelectionOutput* ms_output)
results[i]=m_evaluation_criterion->evaluate(result_labels, m_labels);
if (ms_output)
{
ms_output->output_custom_evaluations(result_labels, m_labels);
ms_output->output_test_indices(subset_indices);
ms_output->output_test_result(result_labels);
ms_output->output_test_true_result(m_labels);
Expand Down
6 changes: 5 additions & 1 deletion src/shogun/modelselection/ModelSelectionOutput.cpp
Expand Up @@ -17,12 +17,14 @@

using namespace shogun;

CModelSelectionOutput::CModelSelectionOutput() : CSGObject()
CModelSelectionOutput::CModelSelectionOutput() : CSGObject(),
m_custom_evaluations(NULL)
{
}

CModelSelectionOutput::~CModelSelectionOutput()
{
SG_UNREF(m_custom_evaluations);
}

void CModelSelectionOutput::output_train_indices(SGVector<index_t> indices)
Expand Down Expand Up @@ -79,6 +81,8 @@ void CModelSelectionOutput::output_evaluate_result(float64_t result)

void CModelSelectionOutput::add_custom_evaluation(CEvaluation* evaluation)
{
if (!m_custom_evaluations)
m_custom_evaluations = new CDynamicObjectArray();
m_custom_evaluations->append_element(evaluation);
}

Expand Down

0 comments on commit 57d6371

Please sign in to comment.