Navigation Menu

Skip to content

Commit

Permalink
Made SVMOcas support subsets
Browse files Browse the repository at this point in the history
  • Loading branch information
lisitsyn committed May 24, 2012
1 parent 7866158 commit ede11ce
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/shogun/classifier/svm/SVMOcas.cpp
Expand Up @@ -67,10 +67,13 @@ bool CSVMOcas::train_machine(CFeatures* data)
}
ASSERT(features);

lab=((CBinaryLabels*) m_labels)->get_labels();
int32_t num_vec=features->get_num_vectors();
lab = SGVector<float64_t>(num_vec);
for (int32_t i=0; i<num_vec; i++)
lab[i] = ((CBinaryLabels*)m_labels)->get_label(i);

w=SGVector<float64_t>(features->get_dim_feature_space());
w.zero();
int32_t num_vec=features->get_num_vectors();

if (num_vec!=lab.vlen || num_vec<=0)
SG_ERROR("num_vec=%d num_train_labels=%d\n", num_vec, lab.vlen);
Expand Down

0 comments on commit ede11ce

Please sign in to comment.