Changeset 848


Ignore:
Timestamp:
Apr 28, 2007, 5:20:40 PM (14 years ago)
Author:
Jari Häkkinen
Message:

Merged log:/branches/0.3.1#838:846 to trunk.

Location:
trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/README

    r831 r848  
    3737installation location is /usr/local, this can be changed with
    3838./configure --prefix=/dir/to/install/to.
     39
     40
     41Contact information through http://lev.thep.lu.se/trac/yat
  • trunk/test/averager_test.cc

    r831 r848  
    3030#include "yat/utility/vector.h"
    3131
     32#include <cmath>
    3233#include <fstream>
    3334#include <limits>
     
    229230bool equal(const Averager& a, const Averager& b)
    230231{
    231 //  std::cout << (a.n()==b.n()) << std::endl;
     232//  std::cout << (a.n()==b.n()) << std::endl;
    232233//  std::cout << (a.mean()==b.mean()) << std::endl;
    233 //  std::cout << (a.variance()==b.variance()) << std::endl;
    234   return (a.n()==b.n() && a.mean()==b.mean() && a.variance()==b.variance());
     234//  std::cout << (fabs(a.variance()-b.variance()<1e-15)) << std::endl;
     235  return (a.n()==b.n() && a.mean()==b.mean() &&
     236          fabs(a.variance()-b.variance()<1e-15));
    235237}
    236238
  • trunk/test/regression_test.cc

    r831 r848  
    267267  r.fit(x,y);
    268268  rw.fit(x,y,w);
    269   if (r.predict(2000) != rw.predict(2000)){
     269  if (fabs(r.predict(2000) - rw.predict(2000))>1e-15) {
    270270    ok = false;
    271271    *error << "Error: predict not equal\n"
     
    382382
    383383  wr.fit(x2,y2,w2);
    384   if (wr.predict(2000) != predict){
     384  if (fabs(wr.predict(2000) - predict)>1e-15) {
    385385    ok = false;
    386386    *error << "Error: predict not equal.\n";
    387387  }
    388   if (wr.prediction_error2(2000) != prediction_error2){
     388  if (fabs(wr.prediction_error2(2000) - prediction_error2)>1e-13) {
    389389    ok = false;
    390390    *error << "Error: prediction_error2 not equal.\n";
    391391  }
    392   if (wr.r2() != r2){
     392  if (fabs(wr.r2() - r2)>1e-15) {
    393393    ok = false;
    394394    *error << "Error: r2 not equal.\n";
     
    396396    *error << "   r2: " << wr.r2() << "\n";
    397397  }
    398   if (wr.s2() != s2){
     398  if (fabs(wr.s2() - s2)>1e-15) {
    399399    ok = false;
    400400    *error << "Error: s2 not equal.\n";
    401401  }
    402   if (wr.standard_error2(2000) != standard_error2){
     402  if (fabs(wr.standard_error2(2000) - standard_error2)>1e-15) {
    403403    ok = false;
    404404    *error << "Error: standard_error2 not equal.\n";
     
    437437  }
    438438
    439   if (md.standard_error2(z) != mdw.standard_error2(z)){
     439  if (fabs(md.standard_error2(z)-mdw.standard_error2(z))>10e-6){
    440440    ok = false;
    441441    *error << "Error: standard_error2 not equal\n"
  • trunk/yat/classifier/BootstrapSampler.cc

    r823 r848  
    2626#include "yat/random/random.h"
    2727
     28#include <cassert>
     29
    2830//#include <algorithm>
    29 //#include <cassert>
    3031//#include <utility>
    3132//#include <vector>
  • trunk/yat/statistics/ROC.cc

    r831 r848  
    115115
    116116
    117   size_t ROC::n(void) const
     117  double ROC::n(void) const
    118118  {
    119119    return n_pos()+n_neg();
     
    121121
    122122
    123   size_t ROC::n_neg(void) const
     123  double ROC::n_neg(void) const
    124124  {
    125125    return w_neg_;
     
    127127
    128128
    129   size_t ROC::n_pos(void) const
     129  double ROC::n_pos(void) const
    130130  {
    131131    return w_pos_;
  • trunk/yat/statistics/ROC.h

    r831 r848  
    9797    /// @return sum of weights
    9898    ///
    99     size_t n(void) const;
     99    double n(void) const;
    100100
    101101    ///
    102102    /// @return sum of weights with negative target
    103103    ///
    104     size_t n_neg(void) const;
     104    double n_neg(void) const;
    105105
    106106    ///
    107107    /// @return sum of weights with positive target
    108108    ///
    109     size_t n_pos(void) const;
     109    double n_pos(void) const;
    110110
    111111    ///
Note: See TracChangeset for help on using the changeset viewer.