Changeset 1433


Ignore:
Timestamp:
Aug 25, 2008, 5:23:42 PM (13 years ago)
Author:
Peter
Message:

fixes #423

Location:
branches/0.4-stable
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/0.4-stable/test/regression_test.cc

    r1392 r1433  
    487487
    488488  rl.fit(10, 100);
     489  if (rl.x().size()!=1000/10)
     490    return false;
     491  for (size_t i=0; i+1<rl.x().size(); ++i)
     492    if (!suite.equal(rl.x()(i+1)-rl.x()(i),10.0))
     493      return false;
    489494
    490495  utility::Vector y(rl.y_predicted());
     
    493498      return false;
    494499    }
     500
    495501  return true;
    496502}
  • branches/0.4-stable/yat/regression/Local.cc

    r1392 r1433  
    6969
    7070    size_t nof_fits=data_.size()/step_size;
    71     x_ = utility::Vector(nof_fits);
    72     y_predicted_ = utility::Vector(x_.size());
    73     y_err_ = utility::Vector(x_.size());
     71    x_.resize(nof_fits);
     72    y_predicted_.resize(x_.size());
     73    y_err_.resize(x_.size());
    7474    sort(data_.begin(), data_.end());
    7575
    76     // coying data to 2 utility vectors ONCE to use views from
     76    // copying data to 2 utility vectors ONCE to use views from
    7777    utility::Vector x(data_.size());
    7878    utility::Vector y(data_.size());
     
    124124      assert(i<y_predicted_.size());
    125125      assert(i<y_err_.size());
     126      x_(i) = x(i*step_size);
    126127      y_predicted_(i) = regressor_->predict(x(i*step_size));
    127128      y_err_(i) = sqrt(regressor_->standard_error2(x(i*step_size)));
  • branches/0.4-stable/yat/regression/Local.h

    r1392 r1433  
    7070
    7171    ///
     72    /// @param step_size Size of step between each fit
    7273    /// @param nof_points Number of points used in each fit
    73     /// @param step_size Size of step between each fit
    7474    ///
    7575    void fit(const size_t step_size, const size_t nof_points);
Note: See TracChangeset for help on using the changeset viewer.