Last change
on this file since 469 was
469,
checked in by Peter, 17 years ago
|
non compiling checking before revision after design meeting
|
-
Property svn:eol-style set to
native
-
Property svn:keywords set to
Id
|
File size:
1.1 KB
|
Line | |
---|
1 | // $Id: WilcoxonFoldChange.cc 469 2005-12-19 14:58:29Z peter $ |
---|
2 | |
---|
3 | #include <c++_tools/statistics/WilcoxonFoldChange.h> |
---|
4 | #include <c++_tools/classifier/VectorAbstract.h> |
---|
5 | #include <c++_tools/statistics/utility.h> |
---|
6 | #include <c++_tools/classifier/Target.h> |
---|
7 | |
---|
8 | #include <cmath> |
---|
9 | #include <vector> |
---|
10 | |
---|
11 | namespace theplu { |
---|
12 | namespace statistics { |
---|
13 | |
---|
14 | |
---|
15 | WilcoxonFoldChange::WilcoxonFoldChange(bool absolute) |
---|
16 | : Score(absolute) |
---|
17 | { |
---|
18 | } |
---|
19 | |
---|
20 | |
---|
21 | |
---|
22 | double WilcoxonFoldChange::score(const classifier::Target& target, |
---|
23 | const classifier::VectorAbstract& value) |
---|
24 | { |
---|
25 | std::vector<double> distance; |
---|
26 | //Peter, should reserve the vector to avoid reallocations |
---|
27 | weighted_=false; |
---|
28 | for (size_t i=0; i<target.size(); i++) { |
---|
29 | for (size_t j=0; i<j; j++) { |
---|
30 | if (target(i)==target(j)) continue; |
---|
31 | distance.push_back(value(i)-value(j)); |
---|
32 | } |
---|
33 | } |
---|
34 | if (absolute_) |
---|
35 | return fabs(median(distance)); |
---|
36 | return median(distance); |
---|
37 | } |
---|
38 | |
---|
39 | double WilcoxonFoldChange::score(const classifier::Target& target, |
---|
40 | const classifier::VectorAbstract& value, |
---|
41 | const classifier::VectorAbstract& weight) |
---|
42 | { |
---|
43 | return 0; |
---|
44 | } |
---|
45 | |
---|
46 | } // of namespace statistics |
---|
47 | } // of namespace theplu |
---|
Note: See
TracBrowser
for help on using the repository browser.