Ignore:
Timestamp:
Oct 16, 2010, 7:00:12 AM (12 years ago)
Author:
Peter
Message:

adding an archetype class for distance concept and use that class in KNN and NCC. Adding CopyConstructible? to requirement for Distance concept

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/knn_test.cc

    r2119 r2338  
    4343using namespace theplu::yat;
    4444
     45void compile_test(test::Suite&);
    4546utility::Matrix data(void);
    4647utility::MatrixWeighted data_weighted(void);
     
    5556std::vector<std::string> vec_target(void);
    5657
     58
    5759int main(int argc, char* argv[])
    5860
     
    6668  test_no_samples(suite);
    6769  test_no_features(suite);
     70  compile_test(suite);
    6871  return suite.return_value();
    6972}
     73
     74
     75void compile_test(test::Suite& suite)
     76{
     77  if (false) {
     78    boost::detail::dummy_constructor dummy;
     79    test::distance_archetype distance(dummy);
     80    classifier::KNN<test::distance_archetype> knn(distance);
     81    knn.k(3);
     82    knn.k();
     83    classifier::SupervisedClassifier* knn2 = knn.make_classifier();
     84    delete knn2;
     85    utility::Matrix result;
     86    knn.train(classifier::MatrixLookup(data()), classifier::Target());
     87    knn.train(classifier::MatrixLookupWeighted(data_weighted()),
     88              classifier::Target());
     89    knn.predict(classifier::MatrixLookup(data()), result);
     90    knn.predict(classifier::MatrixLookupWeighted(data_weighted()), result);
     91  }
     92}
    7093
    7194
Note: See TracChangeset for help on using the changeset viewer.