Changeset 1028 for trunk/yat/classifier
- Timestamp:
- Feb 3, 2008, 2:53:29 AM (16 years ago)
- Location:
- trunk/yat/classifier
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/yat/classifier/KNN.h
r1027 r1028 262 262 std::vector<size_t> k_index; 263 263 utility::sort_smallest_index(k_index,k_, 264 distances->column_const_v ec(sample));264 distances->column_const_view(sample)); 265 265 for(size_t j=0;j<k_index.size();j++) { 266 266 prediction(target_(k_index[j]),sample)++; -
trunk/yat/classifier/NBC.cc
r1027 r1028 206 206 // normalize each row (label) to sum up to unity (probability) 207 207 for (size_t i=0; i<prediction.rows(); ++i){ 208 prediction.row_vec(i) *= 209 1.0/sum(prediction.row_const_vec(i)); 208 prediction.row_view(i) *= 1.0/sum(prediction.row_const_view(i)); 210 209 } 211 210 }
Note: See TracChangeset
for help on using the changeset viewer.