Changeset 2133


Ignore:
Timestamp:
Dec 24, 2009, 4:08:18 AM (12 years ago)
Author:
Peter
Message:

fixes #567

Location:
branches/0.5-stable
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/0.5-stable/test/ensemble_test.cc

    r2132 r2133  
    134134
    135135  {
     136    suite.err() << "test ensemble of SVMs with weighted kernel" << std::endl;
     137    classifier::MatrixLookupWeighted wdata(data_core);
     138    classifier::Kernel_SEV kernel(wdata, *kf);
     139    classifier::KernelLookup wkl(kernel);
     140    classifier::EnsembleBuilder<classifier::SVM, classifier::KernelLookup>
     141      ensemble(svm, wkl, sampler);
     142    suite.err() << "build ensemble" << std::endl;
     143    ensemble.build();
     144    ensemble.validate();
     145    std::vector<std::vector<statistics::Averager> > result;
     146    ensemble.predict(wkl, result);
     147  }
     148
     149  {
    136150    suite.err() << "create ensemble" << std::endl;
    137151    classifier::EnsembleBuilder<classifier::SVM, classifier::KernelLookup>
  • branches/0.5-stable/yat/classifier/EnsembleBuilder.h

    r2132 r2133  
    231231    // weighted case
    232232    if (kernel.weighted()){
    233       assert(false);
    234233      // no feature selection
    235234      if (kernel.data_weighted().rows()==subset_->training_features(k).size())
     
    246245   
    247246    // feature selection
    248     return subset_->training_data(k).test_kernel(test_data(kernel.data(),k));
     247    MatrixLookup ml = test_data(kernel.data(),k);
     248    return subset_->training_data(k).test_kernel(ml);
    249249  }
    250250 
Note: See TracChangeset for help on using the changeset viewer.