Ignore:
Timestamp:
Mar 5, 2006, 2:33:47 PM (16 years ago)
Author:
Peter
Message:

re-introduced prediction in SVM

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/classifier/SVM.cc

    r537 r539  
    5959  }
    6060
    61   double SVM::predict(const gslapi::vector& x) const
    62   {
    63     // predict won't work until kernel::element is working
    64     assert(0);
     61  double SVM::predict(const DataLookup1D& x) const
     62  {
    6563    double y=0;
    66     //for (size_t i=0; i<alpha_.size(); i++)
    67       //y += alpha_(i)*target_(i)*kernel_->element(x,i);
     64    for (size_t i=0; i<alpha_.size(); i++)
     65      y += alpha_(i)*target_(i)*kernel_->element(x,i);
    6866
    6967    return y+bias_;
Note: See TracChangeset for help on using the changeset viewer.