1 | #ifndef _theplu_yat_statistics_snr |
---|
2 | #define _theplu_yat_statistics_snr |
---|
3 | |
---|
4 | // $Id: SNRScore.h 4207 2022-08-26 04:36:28Z peter $ |
---|
5 | |
---|
6 | /* |
---|
7 | Copyright (C) 2006, 2007 Jari Häkkinen, Peter Johansson, Markus Ringnér |
---|
8 | Copyright (C) 2008 Jari Häkkinen, Peter Johansson |
---|
9 | Copyright (C) 2022 Peter Johansson |
---|
10 | |
---|
11 | This file is part of the yat library, http://dev.thep.lu.se/yat |
---|
12 | |
---|
13 | The yat library is free software; you can redistribute it and/or |
---|
14 | modify it under the terms of the GNU General Public License as |
---|
15 | published by the Free Software Foundation; either version 3 of the |
---|
16 | License, or (at your option) any later version. |
---|
17 | |
---|
18 | The yat library is distributed in the hope that it will be useful, |
---|
19 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
20 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
---|
21 | General Public License for more details. |
---|
22 | |
---|
23 | You should have received a copy of the GNU General Public License |
---|
24 | along with yat. If not, see <http://www.gnu.org/licenses/>. |
---|
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 VectorBase; |
---|
35 | } |
---|
36 | namespace classifier { |
---|
37 | class DataLookWeighted1D; |
---|
38 | } |
---|
39 | namespace statistics { |
---|
40 | |
---|
41 | /** |
---|
42 | @brief Class for score based on signal-to-noise ratio (SNRScore). |
---|
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 SNRScore : public Score |
---|
51 | { |
---|
52 | |
---|
53 | public: |
---|
54 | /// |
---|
55 | /// @brief Default Constructor. |
---|
56 | /// |
---|
57 | SNRScore(bool absolute=true); |
---|
58 | |
---|
59 | /// |
---|
60 | /// @brief The destructor. |
---|
61 | /// |
---|
62 | virtual ~SNRScore(void); |
---|
63 | |
---|
64 | /** |
---|
65 | SNRScore is defined as \f$ \frac{m_x-m_y}{s_x+s_y} \f$ where \f$ m |
---|
66 | \f$ and \f$ s \f$ are mean and standard deviation, |
---|
67 | respectively. @see Averager |
---|
68 | |
---|
69 | @return SNRScore score. If absolute=true absolute value of SNRScore is |
---|
70 | returned |
---|
71 | */ |
---|
72 | double score(const classifier::Target& target, |
---|
73 | const utility::VectorBase& value) const; |
---|
74 | |
---|
75 | /** |
---|
76 | SNRScore is defined as \f$ \frac{m_x-m_y}{s_x+s_y} \f$ where \f$ m |
---|
77 | \f$ and \f$ s \f$ are weighted versions of mean and standard |
---|
78 | deviation, respectively. @see AveragerWeighted |
---|
79 | |
---|
80 | @return SNRScore score. If absolute=true absolute value of SNRScore is |
---|
81 | returned |
---|
82 | */ |
---|
83 | double score(const classifier::Target& target, |
---|
84 | const classifier::DataLookupWeighted1D& value) const; |
---|
85 | |
---|
86 | /** |
---|
87 | SNRScore is defined as \f$ \frac{m_x-m_y}{s_x+s_y} \f$ where \f$ m |
---|
88 | \f$ and \f$ s \f$ are weighted versions of mean and standard |
---|
89 | deviation, respectively. @see AveragerWeighted |
---|
90 | |
---|
91 | @return SNRScore score. If absolute=true absolute value of SNRScore is |
---|
92 | returned |
---|
93 | */ |
---|
94 | double score(const classifier::Target& target, |
---|
95 | const utility::VectorBase& value, |
---|
96 | const utility::VectorBase& weight) const; |
---|
97 | |
---|
98 | }; |
---|
99 | |
---|
100 | |
---|
101 | }}} // of namespace statistics, yat, and theplu |
---|
102 | |
---|
103 | #endif |
---|