Changeset 1042


Ignore:
Timestamp:
Feb 6, 2008, 7:32:30 PM (13 years ago)
Author:
Peter
Message:

fixes #268 - remove return value in SupervisedClassifier::train()

Location:
trunk
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/svm_test.cc

    r1000 r1042  
    131131  classifier::KernelLookup kv(kernel);
    132132  theplu::yat::classifier::SVM svm(kv, target);
    133   if (!svm.train()){
    134     ok=false;
    135     *error << "Training failured" << std::endl;
    136   }
     133  svm.train();
    137134
    138135  theplu::yat::utility::vector alpha = svm.alpha();
  • trunk/yat/classifier/KNN.h

    r1031 r1042  
    9595    /// @return true if training succedeed.
    9696    ///
    97     bool train();
     97    void train();
    9898
    9999   
     
    241241 
    242242  template <typename Distance>
    243   bool KNN<Distance>::train()
     243  void KNN<Distance>::train()
    244244  {   
    245245    trained_=true;
    246     return trained_;
    247246  }
    248247
  • trunk/yat/classifier/NBC.cc

    r1028 r1042  
    8282
    8383
    84   bool NBC::train()
     84  void NBC::train()
    8585  {   
    8686    sigma2_.resize(data_.rows(), target_.nof_classes());
     
    133133    }   
    134134    trained_=true;
    135     return trained_;
    136135  }
    137136
  • trunk/yat/classifier/NBC.h

    r1000 r1042  
    8484    /// @return true if training succedeed.
    8585    ///
    86     bool train();
     86    void train();
    8787
    8888   
  • trunk/yat/classifier/NCC.h

    r1033 r1042  
    9696    /// @return true if training succedeed.
    9797    ///
    98     bool train();
     98    void train();
    9999
    100100   
     
    182182
    183183  template <typename Distance>
    184   bool NCC<Distance>::train()
     184  void NCC<Distance>::train()
    185185  {   
    186186    if(centroids_)
     
    219219      }
    220220    }
    221     return true;
    222221  }
    223222
  • trunk/yat/classifier/SVM.cc

    r1013 r1042  
    206206  }
    207207
    208   bool SVM::train(void)
     208  void SVM::train(void)
    209209  {
    210210    // initializing variables for optimization
     
    289289    calculate_margin();
    290290    trained_ = calculate_bias();
    291     return trained_;
    292291  }
    293292
  • trunk/yat/classifier/SVM.h

    r1000 r1042  
    188188       @return true if succesful
    189189    */
    190     bool train();
     190    void train();
    191191
    192192       
  • trunk/yat/classifier/SupervisedClassifier.h

    r1000 r1042  
    8888    /// Train the classifier.
    8989    ///
    90     virtual bool train()=0;
     90    virtual void train()=0;
    9191
    9292   
Note: See TracChangeset for help on using the changeset viewer.