1 | #ifndef _theplu_yat_statistics_wilcoxonfoldchange_ |
---|
2 | #define _theplu_yat_statistics_wilcoxonfoldchange_ |
---|
3 | |
---|
4 | // $Id: WilcoxonFoldChange.h 1486 2008-09-09 21:17:19Z jari $ |
---|
5 | |
---|
6 | /* |
---|
7 | Copyright (C) 2005 Peter Johansson |
---|
8 | Copyright (C) 2006, 2007 Jari Häkkinen, Peter Johansson |
---|
9 | Copyright (C) 2008 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 this program; if not, write to the Free Software |
---|
25 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA |
---|
26 | 02111-1307, USA. |
---|
27 | */ |
---|
28 | |
---|
29 | #include "Score.h" |
---|
30 | |
---|
31 | namespace theplu { |
---|
32 | namespace yat { |
---|
33 | namespace utility { |
---|
34 | class VectorBase; |
---|
35 | } |
---|
36 | namespace statistics { |
---|
37 | |
---|
38 | /** |
---|
39 | @brief WilcoxonFoldChange |
---|
40 | |
---|
41 | WilcoxonFoldChange is calculated as follows: Having \f$ n_+ \f$ |
---|
42 | samples from class + and \f$ n_- \f$ from class -, all \f$ n_+ |
---|
43 | n_- \f$ pairwise distances are calculated, and the |
---|
44 | WilcoxonFoldChange is the median of these values. |
---|
45 | */ |
---|
46 | class WilcoxonFoldChange : public Score |
---|
47 | { |
---|
48 | public: |
---|
49 | |
---|
50 | /// |
---|
51 | /// @brief Default Constructor |
---|
52 | /// |
---|
53 | WilcoxonFoldChange(bool absolute=true); |
---|
54 | |
---|
55 | /// |
---|
56 | /// @return median of all pairwise differences |
---|
57 | /// |
---|
58 | /// @param target defining the two groups (Target.binary() ) |
---|
59 | /// @param value vector of the values |
---|
60 | /// |
---|
61 | double score(const classifier::Target& target, |
---|
62 | const utility::VectorBase& value) const; |
---|
63 | |
---|
64 | /// |
---|
65 | /// @return weighted median of all pairwise differences |
---|
66 | /// |
---|
67 | /// For each pair a DataWeight is created with value = value(i) - |
---|
68 | /// value(j) and weight = weight(i)*weight(j) where sample i and |
---|
69 | /// sample j come from different groups. |
---|
70 | /// |
---|
71 | /// @param target defining the two groups |
---|
72 | /// @param value vector of the values |
---|
73 | /// @param weight vector of accompanied weight to the values |
---|
74 | /// |
---|
75 | /// @note not implemented |
---|
76 | /// |
---|
77 | double score(const classifier::Target& target, |
---|
78 | const utility::VectorBase& value, |
---|
79 | const utility::VectorBase& weight) const; |
---|
80 | |
---|
81 | private: |
---|
82 | |
---|
83 | /// |
---|
84 | /// @brief Copy Constructor |
---|
85 | /// |
---|
86 | WilcoxonFoldChange(const WilcoxonFoldChange&); |
---|
87 | |
---|
88 | /// |
---|
89 | /// @brief Assignment operator |
---|
90 | /// |
---|
91 | WilcoxonFoldChange& operator=(const WilcoxonFoldChange&); |
---|
92 | }; |
---|
93 | |
---|
94 | }}} // of namespace statistics, yat, and theplu |
---|
95 | |
---|
96 | #endif |
---|