1 | #ifndef _theplu_yat_statistics_snr |
---|
2 | #define _theplu_yat_statistics_snr |
---|
3 | |
---|
4 | // $Id: SNR.h 748 2007-02-11 17:48:22Z peter $ |
---|
5 | |
---|
6 | /* |
---|
7 | Copyright (C) The authors contributing to this file. |
---|
8 | |
---|
9 | This file is part of the yat library, http://lev.thep.lu.se/trac/yat |
---|
10 | |
---|
11 | The yat library is free software; you can redistribute it and/or |
---|
12 | modify it under the terms of the GNU General Public License as |
---|
13 | published by the Free Software Foundation; either version 2 of the |
---|
14 | License, or (at your option) any later version. |
---|
15 | |
---|
16 | The yat library is distributed in the hope that it will be useful, |
---|
17 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
18 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
---|
19 | General Public License for more details. |
---|
20 | |
---|
21 | You should have received a copy of the GNU General Public License |
---|
22 | along with this program; if not, write to the Free Software |
---|
23 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA |
---|
24 | 02111-1307, USA. |
---|
25 | */ |
---|
26 | |
---|
27 | #include "Score.h" |
---|
28 | |
---|
29 | #include <gsl/gsl_cdf.h> |
---|
30 | |
---|
31 | namespace theplu { |
---|
32 | namespace yat { |
---|
33 | namespace utility { |
---|
34 | class vector; |
---|
35 | } |
---|
36 | namespace classifier { |
---|
37 | class DataLookWeighted1D; |
---|
38 | } |
---|
39 | namespace statistics { |
---|
40 | |
---|
41 | /** |
---|
42 | @brief Class for score based on signal-to-noise ratio (SNR). |
---|
43 | |
---|
44 | Also |
---|
45 | sometimes referred to as Golub score. The score is the ratio |
---|
46 | between difference in mean and the sum of standard deviations |
---|
47 | for two groups: \f$ \frac{ m_x-m_y}{ s_x + s_y} \f$ where \f$ |
---|
48 | s \f$ is standard deviation. |
---|
49 | */ |
---|
50 | class SNR : public Score |
---|
51 | { |
---|
52 | |
---|
53 | public: |
---|
54 | /// |
---|
55 | /// @brief Default Constructor. |
---|
56 | /// |
---|
57 | SNR(bool absolute=true); |
---|
58 | |
---|
59 | /** |
---|
60 | SNR is defined as \f$ \frac{m_x-m_y}{s_x+s_y} \f$ where \f$ m |
---|
61 | \f$ and \f$ s \f$ are mean and standard deviation, |
---|
62 | respectively. @see Averager |
---|
63 | |
---|
64 | @return SNR score. If absolute=true absolute value of SNR is |
---|
65 | returned |
---|
66 | */ |
---|
67 | double score(const classifier::Target& target, |
---|
68 | const utility::vector& value); |
---|
69 | |
---|
70 | /** |
---|
71 | SNR is defined as \f$ \frac{m_x-m_y}{s_x+s_y} \f$ where \f$ m |
---|
72 | \f$ and \f$ s \f$ are weighted versions of mean and standard |
---|
73 | deviation, respectively. @see AveragerWeighted |
---|
74 | |
---|
75 | @return SNR score. If absolute=true absolute value of SNR is |
---|
76 | returned |
---|
77 | */ |
---|
78 | double score(const classifier::Target& target, |
---|
79 | const classifier::DataLookupWeighted1D& value); |
---|
80 | |
---|
81 | /** |
---|
82 | SNR is defined as \f$ \frac{m_x-m_y}{s_x+s_y} \f$ where \f$ m |
---|
83 | \f$ and \f$ s \f$ are weighted versions of mean and standard |
---|
84 | deviation, respectively. @see AveragerWeighted |
---|
85 | |
---|
86 | @return SNR score. If absolute=true absolute value of SNR is |
---|
87 | returned |
---|
88 | */ |
---|
89 | double score(const classifier::Target& target, |
---|
90 | const utility::vector& value, |
---|
91 | const utility::vector& weight); |
---|
92 | private: |
---|
93 | double score_; |
---|
94 | }; |
---|
95 | |
---|
96 | }}} // of namespace statistics, yat, and theplu |
---|
97 | |
---|
98 | #endif |
---|