Changeset 529


Ignore:
Timestamp:
Mar 1, 2006, 3:03:27 PM (16 years ago)
Author:
Markus Ringnér
Message:

Added score for signal-to-noise ratio (Golub score). Fixed documentation. Improved weighted version of tScore

Location:
trunk/lib/statistics
Files:
2 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/statistics/Makefile.am

    r503 r529  
    1515  MultiDimensional.cc Naive.cc NaiveWeighted.cc OneDimensional.cc\
    1616  Pearson.cc PearsonDistance.cc \
    17   Polynomial.cc ROC.cc Score.cc tScore.cc utility.cc \
     17  Polynomial.cc ROC.cc Score.cc tScore.cc SNR.cc utility.cc \
    1818  WilcoxonFoldChange.cc
    1919
     
    2828  Local.h MultiDimensional.h Naive.h NaiveWeighted.h OneDimensional.h \
    2929  OneDimensionalWeighted.h Pearson.h  PearsonDistance.h \
    30   Polynomial.h ROC.h Score.h tScore.h \
     30  Polynomial.h ROC.h Score.h SNR.h tScore.h \
    3131  utility.h WilcoxonFoldChange.h
  • trunk/lib/statistics/Score.cc

    r509 r529  
    77
    88  Score::Score(bool absolute)
    9     : absolute_(absolute)
     9    : absolute_(absolute), weighted_(false)
    1010  {
    1111  }
  • trunk/lib/statistics/Score.h

    r509 r529  
    7979    /// @param value vector of the values
    8080    /// @param weight vector of accompanied weight to the values
    81     /// @train_set defining which values to use (number of values used
    82     /// in the calculation is equal to size of \a train_set)
    8381    ///
    8482    virtual double
     
    9997    /// @param value vector of the values
    10098    /// @param weight vector of accompanied weight to the values
    101     /// @train_set defining which values to use (number of values used
    102     /// in the calculation is equal to size of \a train_set)
    10399    ///
    104100    inline double
  • trunk/lib/statistics/tScore.cc

    r526 r529  
    5050    statistics::AveragerWeighted positive;
    5151    statistics::AveragerWeighted negative;
    52     dof_=target.size()-2;
    5352    for(size_t i=0; i<target.size(); i++){
    5453      if (target.binary(i))
     
    6059    double s2=(positive.sum_xx_centered()+negative.sum_xx_centered())/
    6160      (positive.n()+negative.n()-2);
    62     t_=diff/sqrt(s2*(1.0/positive.sum_w()+1.0/negative.sum_w()));
     61    t_=diff/sqrt(s2*(1.0/positive.sum_w()+1.0/negative.sum_w()));   
    6362    if (t_<0 && absolute_)
    6463      t_=-t_;
     64
     65    if(positive.n()==0 || negative.n()==0 ||
     66       positive.sum_w()==0 || positive.sum_w()==0)
     67      t_=0;
     68    dof_=target.size()-2;
    6569     
    6670    return t_;
  • trunk/lib/statistics/tScore.h

    r492 r529  
    4242    ///
    4343    /// Weighted version of t-Score @return t-score if absolute=true
    44     /// absolute value of t-score is returned
     44    /// absolute value of t-score is returned.
     45    /// @todo Peter: This is probably
     46    /// not implemented as it should be!
    4547    ///
    4648    double score(const classifier::Target& target,
Note: See TracChangeset for help on using the changeset viewer.