1 | #ifndef _theplu_statistics_snr |
---|
2 | #define _theplu_statistics_snr |
---|
3 | |
---|
4 | // $Id: SNR.h 675 2006-10-10 12:08:45Z jari $ |
---|
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 "yat/statistics/Score.h" |
---|
28 | |
---|
29 | #include <gsl/gsl_cdf.h> |
---|
30 | |
---|
31 | namespace theplu { |
---|
32 | namespace utility { |
---|
33 | class vector; |
---|
34 | } |
---|
35 | namespace classifier { |
---|
36 | class DataLookWeighted1D; |
---|
37 | } |
---|
38 | namespace statistics { |
---|
39 | |
---|
40 | /** |
---|
41 | @brief Class for score based on signal-to-noise ratio (SNR). |
---|
42 | |
---|
43 | Also |
---|
44 | sometimes referred to as Golub score. The score is the ratio |
---|
45 | between difference in mean and the sum of standard deviations |
---|
46 | for two groups. \f$ \frac{ \frac{1}{n_x}\sum x_i - |
---|
47 | \frac{1}{n_y}\sum y_i }{ \sigma_x + \sigma_y} \f$ where \f$ |
---|
48 | \sigma \f$ is standard deviation. |
---|
49 | */ |
---|
50 | class SNR : public Score |
---|
51 | { |
---|
52 | |
---|
53 | public: |
---|
54 | /// |
---|
55 | /// Default Constructor. |
---|
56 | /// |
---|
57 | SNR(bool absolute=true); |
---|
58 | |
---|
59 | /// |
---|
60 | /// Calculates the value of SNR score. @return SNR score if |
---|
61 | /// absolute=true absolute value of t-score is returned |
---|
62 | /// |
---|
63 | double score(const classifier::Target& target, |
---|
64 | const utility::vector& value); |
---|
65 | |
---|
66 | /// |
---|
67 | /// Weighted version of SNR @return t-score if absolute=true |
---|
68 | /// absolute value of t-score is returned. |
---|
69 | /// |
---|
70 | double score(const classifier::Target& target, |
---|
71 | const classifier::DataLookupWeighted1D& value); |
---|
72 | |
---|
73 | /// |
---|
74 | /// Weighted version of SNR @return t-score if absolute=true |
---|
75 | /// absolute value of t-score is returned. |
---|
76 | /// |
---|
77 | double score(const classifier::Target& target, |
---|
78 | const utility::vector& value, |
---|
79 | const utility::vector& weight); |
---|
80 | private: |
---|
81 | double score_; |
---|
82 | }; |
---|
83 | |
---|
84 | }} // of namespace statistics and namespace theplu |
---|
85 | |
---|
86 | #endif |
---|
87 | |
---|