Changeset 916 for trunk/test
 Timestamp:
 Sep 30, 2007, 2:50:10 AM (15 years ago)
 Location:
 trunk/test
 Files:

 4 edited
Legend:
 Unmodified
 Added
 Removed

trunk/test/Makefile.am
r904 r916 32 32 distance_test \ 33 33 ensemble_test feature_selection_test fileutil_test inputranker_test \ 34 iterator_test kernel_test kernel_lookup_test \ 34 iterator_test kernel_test kernel_lookup_test \ 35 35 knn_test matrix_test matrix_lookup_test \ 36 36 nbc_test \ 
trunk/test/averager_test.cc
r887 r916 141 141 theplu::yat::utility::vector w(3,1); 142 142 theplu::yat::statistics::AveragerWeighted aw; 143 a w.add_values(x,w);143 add(aw, x.begin(), x.end(), w.begin()); 144 144 a.reset(); 145 a .add_values(x);145 add(a, x.begin(), x.end()); 146 146 const double tol=std::numeric_limits<double>().round_error(); 147 147 if (!equal(a,aw,tol,error)){ … … 166 166 aw2>reset(); 167 167 w*=17; 168 a w2>add_values(x,w);168 add(*aw2, x.begin(), x.end(), w.begin()); 169 169 if (!equal(aw,*aw2,tol,error)){ 170 170 *error << "error: AveragerWeighted rescaling weights " 
trunk/test/knn_test.cc
r903 r916 4 4 #include "yat/classifier/MatrixLookupWeighted.h" 5 5 #include "yat/statistics/euclidean_vector_distance.h" 6 #include "yat/statistics/pearson_vector_distance.h" 6 7 #include "yat/utility/matrix.h" 7 8 … … 42 43 utility::matrix weights(data.rows(),data.columns(),0.0); 43 44 utility::nan(data,weights); 44 45 45 46 classifier::MatrixLookupWeighted dataviewweighted(data,weights); 46 classifier::KNN<statistics::euclidean_vector_distance_tag> knn(dataviewweighted,targets); 47 classifier::KNN<statistics::pearson_vector_distance_tag> knn(dataviewweighted,targets); 48 *error << "Training KNN" << std::endl; 47 49 knn.train(); 48 50 
trunk/test/ncc_test.cc
r901 r916 56 56 bool ok = true; 57 57 58 classifier::MatrixLookupWeighted ml(4,4); 59 std::vector<std::string> vec(4, "pos"); 60 vec[3]="bjds"; 61 classifier::Target target(vec); 62 statistics::vector_distance_lookup_weighted_ptr dist= 63 statistics::vector_distance<statistics::pearson_vector_distance_tag>; 64 classifier::NCC ncctmp(ml,target,dist); 65 *error << "training...\n"; 66 ncctmp.train(); 67 58 68 std::ifstream is("data/sorlie_centroid_data.txt"); 59 69 utility::matrix data(is,'\t'); … … 72 82 statistics::vector_distance<statistics::pearson_vector_distance_tag>; 73 83 classifier::NCC ncc(dataviewweighted,targets,distance); 84 *error << "training...\n"; 74 85 ncc.train(); 75 86 … … 103 114 } 104 115 116 *error << "prediction...\n"; 105 117 utility::matrix prediction; 106 118 ncc.predict(dataviewweighted,prediction);
Note: See TracChangeset
for help on using the changeset viewer.