Changeset 1009 for trunk/yat/classifier


Ignore:
Timestamp:
Feb 1, 2008, 5:15:44 AM (14 years ago)
Author:
Peter
Message:

merging branch peter-dev into trunk delta 1008:994

Location:
trunk/yat/classifier
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/yat/classifier/IGP.h

    r1000 r1009  
    8686   
    8787    // Calculate IGP for each class
    88     igp_.clone(utility::vector(target_.nof_classes()));
     88    igp_ = utility::vector(target_.nof_classes());
    8989   
    9090    for(u_int i=0; i<target_.size(); i++) {
  • trunk/yat/classifier/KNN.h

    r999 r1009  
    261261    for(size_t sample=0;sample<distances->columns();sample++) {
    262262      std::vector<size_t> k_index;
    263       utility::sort_smallest_index(k_index,k_,utility::vector(*distances,sample,false));
     263      utility::sort_smallest_index(k_index,k_,distances->column_vec(sample));
    264264      for(size_t j=0;j<k_index.size();j++) {
    265265        prediction(target_(k_index[j]),sample)++;
  • trunk/yat/classifier/NBC.cc

    r1000 r1009  
    205205
    206206    // normalize each row (label) to sum up to unity (probability)
    207     for (size_t i=0; i<prediction.rows(); ++i)
    208       utility::vector(prediction,i) *=
    209         1.0/utility::sum(utility::vector(prediction,i));
    210 
     207    for (size_t i=0; i<prediction.rows(); ++i){
     208      prediction.row_vec(i) *=
     209        1.0/sum(
     210                prediction.row_vec(i)
     211                );
     212    }
    211213  }
    212214
  • trunk/yat/classifier/SVM.cc

    r1000 r1009  
    198198  {
    199199    trained_=false;
    200     alpha_.clone(utility::vector(target_.size(), 0));
     200    alpha_ = utility::vector(target_.size(), 0);
    201201  }
    202202
  • trunk/yat/classifier/utility.cc

    r1000 r1009  
    3535  void convert(const DataLookup1D& lookup, utility::vector& vector)
    3636  {
    37     vector.clone(utility::vector(lookup.size()));
     37    vector = utility::vector(lookup.size());
    3838    for(u_int i=0; i<lookup.size(); i++)
    3939      vector(i)=lookup(i);
     
    4444  {
    4545   
    46     value.clone(utility::vector(lookup.size()));
    47     weight.clone(utility::vector(lookup.size()));
     46    value = utility::vector(lookup.size());
     47    weight = utility::vector(lookup.size());
    4848    for(u_int i=0; i<lookup.size(); i++){
    4949      value(i)=lookup.data(i);
Note: See TracChangeset for help on using the changeset viewer.