# source:trunk/c++_tools/statistics/SNR.h@623

Last change on this file since 623 was 623, checked in by Peter, 17 years ago

fixes #112 and refs #123 added overloaded function score taking Target and DataLookupWeighted1D, which is needed for InputRanker?.

• Property svn:eol-style set to native
• Property svn:keywords set to Id
File size: 1.6 KB
Line
1#ifndef _theplu_statistics_snr
2#define _theplu_statistics_snr
3
4// $Id: SNR.h 623 2006-09-05 02:13:12Z peter$
5
6#include <c++_tools/statistics/Score.h>
7
8#include <gsl/gsl_cdf.h>
9
10namespace theplu {
11  namespace utility {
12    class vector;
13  }
14  namespace classifier {
15    class DataLookWeighted1D;
16  }
17namespace statistics {
18
19  ///
20  /// @brief Class for score based on signal-to-noise ratio (SNR).
21  ///
22  /// Also
23  /// sometimes referred to as Golub score. The score is the ratio
24  /// between difference in mean and the sum of standard deviations
25  /// for two groups.  \f$\frac{ \frac{1}{n_x}\sum x_i - 26 /// \frac{1}{n_y}\sum y_i }{ \sigma_x + \sigma_y} \f$ where \f$27 /// \sigma \f$ is standard deviation.
28  ///
29  class SNR : public Score
30  {
31
32  public:
33    ///
34    /// Default Constructor.
35    ///
36    SNR(bool absolute=true);
37
38    ///
39    /// Calculates the value of SNR score. @return SNR score if
40    /// absolute=true absolute value of t-score is returned
41    ///
42    double score(const classifier::Target& target,
43                 const utility::vector& value);
44
45    ///
46    /// Weighted version of SNR @return t-score if absolute=true
47    /// absolute value of t-score is returned.
48    ///
49    double score(const classifier::Target& target,
50                 const classifier::DataLookupWeighted1D& value);
51
52    ///
53    /// Weighted version of SNR @return t-score if absolute=true
54    /// absolute value of t-score is returned.
55    ///
56    double score(const classifier::Target& target,
57                 const utility::vector& value,
58                 const utility::vector& weight);
59  private:
60    double score_;
61  };
62
63}} // of namespace statistics and namespace theplu
64
65#endif
66
Note: See TracBrowser for help on using the repository browser.