Changeset 1621


Ignore:
Timestamp:
Nov 10, 2008, 10:39:48 PM (12 years ago)
Author:
Peter
Message:

fixes #460

Location:
branches/0.4-stable
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • branches/0.4-stable/test/Makefile.am

    r1392 r1621  
    3636  consensus_inputranker_test data_lookup_1d_test  distance_test \
    3737  ensemble_test feature_selection_test fileutil_test \
    38   index_test inputranker_test \
     38  fisher_test index_test inputranker_test \
    3939  iterator_test kernel_lookup_test kernel_test \
    4040  knn_test matrix_lookup_test matrix_test \
     
    6666feature_selection_test_SOURCES = feature_selection_test.cc
    6767fileutil_test_SOURCES = fileutil_test.cc
     68fisher_test_SOURCES = fisher_test.cc
    6869index_test_SOURCES = index_test.cc
    6970inputranker_test_SOURCES = inputranker_test.cc
  • branches/0.4-stable/yat/statistics/Fisher.cc

    r1392 r1621  
    3737 
    3838  Fisher::Fisher()
    39     : a_(0), b_(0), c_(0), d_(0), oddsratio_(1.0)
     39    : a_(0), b_(0), c_(0), d_(0), minimum_size_(10), oddsratio_(1.0)
    4040  {
    4141  }
     
    9393      throw std::runtime_error("runtime_error: Table in Fisher is not valid\n");
    9494    }
     95    a_ = a;
     96    b_ = b;
     97    c_ = c;
     98    d_ = d;
    9599
    96     oddsratio_=(a*d)/(b*d);
     100    oddsratio_=static_cast<double>(a*d)/static_cast<double>(b*c);
    97101    return oddsratio_;
    98102  }
  • branches/0.4-stable/yat/statistics/Fisher.h

    r1392 r1621  
    8484         
    8585   
    86     ///
    87     /// @return Chi2 score
    88     ///
     86    /**
     87       The Chi2 score is calculated as \f$ \sum
     88       \frac{(O_i-E_i)^2}{E_i}\f$ where \a E is expected value and \a
     89       O is observed value.
     90
     91       \return Chi2 score
     92    */
    8993    double Chi2(void) const;
    9094
     
    143147       \end{tabular} \f] as \f$ \frac{ad}{bc} \f$
    144148
     149       Object will remember the values of \a a, \a b, \a c, and \a d.
     150
    145151       @return odds ratio.
    146152
Note: See TracChangeset for help on using the changeset viewer.