Ignore:
Timestamp:
Mar 5, 2008, 6:56:01 PM (15 years ago)
Author:
Peter
Message:

fixes #345

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/ensemble_test.cc

    r1161 r1206  
    3232#include "yat/classifier/Kernel_MEV.h"
    3333#include "yat/classifier/MatrixLookup.h"
     34#include "yat/classifier/MatrixLookupWeighted.h"
    3435#include "yat/classifier/NCC.h"
    3536#include "yat/classifier/PolynomialKernelFunction.h"
     
    8788    *error << "build ensemble" << std::endl;
    8889    ensemble.build();
     90    std::vector<std::vector<statistics::Averager> > result;
     91    ensemble.predict(data, result);
     92  }
     93
     94  {
     95    *error << "create ensemble of ncc" << std::endl;
     96    classifier::MatrixLookupWeighted data_weighted(data);
     97    classifier::NCC<statistics::EuclideanDistance> ncc;
     98    classifier::CrossValidationSampler sampler(target,3,3);
     99    classifier::SubsetGenerator<classifier::MatrixLookupWeighted>
     100      subdata(sampler,data_weighted);
     101    classifier::EnsembleBuilder<classifier::SupervisedClassifier,
     102      classifier::MatrixLookupWeighted> ensemble(ncc, data_weighted, sampler);
     103    *error << "build ensemble" << std::endl;
     104    ensemble.build();
     105    std::vector<std::vector<statistics::Averager> > result;
     106    ensemble.predict(data_weighted, result);
    89107  }
    90108
     
    103121  *error << "build ensemble" << std::endl;
    104122  ensemble.build();
     123  std::vector<std::vector<statistics::Averager> > result;
     124  ensemble.predict(kernel_lookup, result);
    105125 
    106126  utility::Vector out(target.size(),0);
Note: See TracChangeset for help on using the changeset viewer.