680 |
11 Oct 06 |
jari |
1 |
#ifndef _theplu_yat_statistics_snr |
680 |
11 Oct 06 |
jari |
2 |
#define _theplu_yat_statistics_snr |
529 |
01 Mar 06 |
markus |
3 |
|
616 |
31 Aug 06 |
jari |
// $Id$ |
616 |
31 Aug 06 |
jari |
5 |
|
675 |
10 Oct 06 |
jari |
6 |
/* |
4359 |
23 Aug 23 |
peter |
Copyright (C) 2006 Jari Häkkinen, Peter Johansson, Markus Ringnér |
4359 |
23 Aug 23 |
peter |
Copyright (C) 2007 Peter Johansson, Markus Ringnér |
2119 |
12 Dec 09 |
peter |
Copyright (C) 2008 Jari Häkkinen, Peter Johansson |
529 |
01 Mar 06 |
markus |
10 |
|
1437 |
25 Aug 08 |
peter |
This file is part of the yat library, http://dev.thep.lu.se/yat |
675 |
10 Oct 06 |
jari |
12 |
|
675 |
10 Oct 06 |
jari |
The yat library is free software; you can redistribute it and/or |
675 |
10 Oct 06 |
jari |
modify it under the terms of the GNU General Public License as |
1486 |
09 Sep 08 |
jari |
published by the Free Software Foundation; either version 3 of the |
675 |
10 Oct 06 |
jari |
License, or (at your option) any later version. |
675 |
10 Oct 06 |
jari |
17 |
|
675 |
10 Oct 06 |
jari |
The yat library is distributed in the hope that it will be useful, |
675 |
10 Oct 06 |
jari |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
675 |
10 Oct 06 |
jari |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
675 |
10 Oct 06 |
jari |
General Public License for more details. |
675 |
10 Oct 06 |
jari |
22 |
|
675 |
10 Oct 06 |
jari |
You should have received a copy of the GNU General Public License |
1487 |
10 Sep 08 |
jari |
along with yat. If not, see <http://www.gnu.org/licenses/>. |
675 |
10 Oct 06 |
jari |
25 |
*/ |
675 |
10 Oct 06 |
jari |
26 |
|
680 |
11 Oct 06 |
jari |
27 |
#include "Score.h" |
675 |
10 Oct 06 |
jari |
28 |
|
529 |
01 Mar 06 |
markus |
29 |
#include <gsl/gsl_cdf.h> |
529 |
01 Mar 06 |
markus |
30 |
|
529 |
01 Mar 06 |
markus |
31 |
namespace theplu { |
856 |
05 Sep 07 |
markus |
32 |
namespace yat { |
856 |
05 Sep 07 |
markus |
33 |
namespace utility { |
1023 |
01 Feb 08 |
peter |
34 |
class VectorBase; |
856 |
05 Sep 07 |
markus |
35 |
} |
856 |
05 Sep 07 |
markus |
36 |
namespace classifier { |
856 |
05 Sep 07 |
markus |
37 |
class DataLookWeighted1D; |
856 |
05 Sep 07 |
markus |
38 |
} |
4200 |
19 Aug 22 |
peter |
39 |
namespace statistics { |
529 |
01 Mar 06 |
markus |
40 |
|
856 |
05 Sep 07 |
markus |
41 |
/** |
4200 |
19 Aug 22 |
peter |
@brief Class for score based on signal-to-noise ratio (SNRScore). |
4200 |
19 Aug 22 |
peter |
43 |
|
856 |
05 Sep 07 |
markus |
Also |
856 |
05 Sep 07 |
markus |
sometimes referred to as Golub score. The score is the ratio |
856 |
05 Sep 07 |
markus |
between difference in mean and the sum of standard deviations |
856 |
05 Sep 07 |
markus |
for two groups: \f$ \frac{ m_x-m_y}{ s_x + s_y} \f$ where \f$ |
856 |
05 Sep 07 |
markus |
s \f$ is standard deviation. |
856 |
05 Sep 07 |
markus |
49 |
*/ |
856 |
05 Sep 07 |
markus |
50 |
class SNRScore : public Score |
856 |
05 Sep 07 |
markus |
51 |
{ |
4200 |
19 Aug 22 |
peter |
52 |
|
856 |
05 Sep 07 |
markus |
53 |
public: |
856 |
05 Sep 07 |
markus |
54 |
/// |
856 |
05 Sep 07 |
markus |
/// @brief Default Constructor. |
856 |
05 Sep 07 |
markus |
56 |
/// |
856 |
05 Sep 07 |
markus |
57 |
SNRScore(bool absolute=true); |
4200 |
19 Aug 22 |
peter |
58 |
|
856 |
05 Sep 07 |
markus |
59 |
/// |
856 |
05 Sep 07 |
markus |
/// @brief The destructor. |
856 |
05 Sep 07 |
markus |
61 |
/// |
856 |
05 Sep 07 |
markus |
62 |
virtual ~SNRScore(void); |
4200 |
19 Aug 22 |
peter |
63 |
|
856 |
05 Sep 07 |
markus |
64 |
/** |
856 |
05 Sep 07 |
markus |
SNRScore is defined as \f$ \frac{m_x-m_y}{s_x+s_y} \f$ where \f$ m |
856 |
05 Sep 07 |
markus |
\f$ and \f$ s \f$ are mean and standard deviation, |
856 |
05 Sep 07 |
markus |
respectively. @see Averager |
4200 |
19 Aug 22 |
peter |
68 |
|
856 |
05 Sep 07 |
markus |
@return SNRScore score. If absolute=true absolute value of SNRScore is |
856 |
05 Sep 07 |
markus |
returned |
856 |
05 Sep 07 |
markus |
71 |
*/ |
4200 |
19 Aug 22 |
peter |
72 |
double score(const classifier::Target& target, |
4200 |
19 Aug 22 |
peter |
73 |
const utility::VectorBase& value) const; |
4200 |
19 Aug 22 |
peter |
74 |
|
856 |
05 Sep 07 |
markus |
75 |
/** |
856 |
05 Sep 07 |
markus |
SNRScore is defined as \f$ \frac{m_x-m_y}{s_x+s_y} \f$ where \f$ m |
856 |
05 Sep 07 |
markus |
\f$ and \f$ s \f$ are weighted versions of mean and standard |
856 |
05 Sep 07 |
markus |
deviation, respectively. @see AveragerWeighted |
4200 |
19 Aug 22 |
peter |
79 |
|
856 |
05 Sep 07 |
markus |
@return SNRScore score. If absolute=true absolute value of SNRScore is |
856 |
05 Sep 07 |
markus |
returned |
856 |
05 Sep 07 |
markus |
82 |
*/ |
856 |
05 Sep 07 |
markus |
83 |
double score(const classifier::Target& target, |
4200 |
19 Aug 22 |
peter |
84 |
const classifier::DataLookupWeighted1D& value) const; |
4200 |
19 Aug 22 |
peter |
85 |
|
856 |
05 Sep 07 |
markus |
86 |
/** |
856 |
05 Sep 07 |
markus |
SNRScore is defined as \f$ \frac{m_x-m_y}{s_x+s_y} \f$ where \f$ m |
856 |
05 Sep 07 |
markus |
\f$ and \f$ s \f$ are weighted versions of mean and standard |
856 |
05 Sep 07 |
markus |
deviation, respectively. @see AveragerWeighted |
4200 |
19 Aug 22 |
peter |
90 |
|
856 |
05 Sep 07 |
markus |
@return SNRScore score. If absolute=true absolute value of SNRScore is |
856 |
05 Sep 07 |
markus |
returned |
856 |
05 Sep 07 |
markus |
93 |
*/ |
4200 |
19 Aug 22 |
peter |
94 |
double score(const classifier::Target& target, |
4200 |
19 Aug 22 |
peter |
95 |
const utility::VectorBase& value, |
4200 |
19 Aug 22 |
peter |
96 |
const utility::VectorBase& weight) const; |
4200 |
19 Aug 22 |
peter |
97 |
|
856 |
05 Sep 07 |
markus |
98 |
}; |
4200 |
19 Aug 22 |
peter |
99 |
|
4200 |
19 Aug 22 |
peter |
100 |
|
856 |
05 Sep 07 |
markus |
101 |
}}} // of namespace statistics, yat, and theplu |
529 |
01 Mar 06 |
markus |
102 |
|
529 |
01 Mar 06 |
markus |
103 |
#endif |