summaryrefslogtreecommitdiff
path: root/report/plot_factory.rb
diff options
context:
space:
mode:
authormguetlein <martin.guetlein@gmail.com>2010-05-07 14:10:27 +0200
committermguetlein <martin.guetlein@gmail.com>2010-05-07 14:10:27 +0200
commit6f437cd052fef1dfcdf2317688a78442d2d8a1f7 (patch)
tree91aa05c488293b22d07222a1629a1093013245c7 /report/plot_factory.rb
parent3c7ab47857f9f86caca6cdddfe7f6ef8672db797 (diff)
fix feature encoding, add comparables report to nightly
Diffstat (limited to 'report/plot_factory.rb')
-rw-r--r--report/plot_factory.rb18
1 files changed, 18 insertions, 0 deletions
diff --git a/report/plot_factory.rb b/report/plot_factory.rb
index e248540..c5ea59f 100644
--- a/report/plot_factory.rb
+++ b/report/plot_factory.rb
@@ -188,6 +188,24 @@ module Reports
a = roc_values[:actual_values]
raise "no prediction values for roc-plot" if p.size==0
+ # hack for painting perfect/worst roc curve, otherwhise fp/tp-rate will always be 100%
+ # determine if perfect/worst roc curve
+ fp_found = false
+ tp_found = false
+ (0..p.size-1).each do |i|
+ if a[i]!=p[i]
+ fp_found |= true
+ else
+ tp_found |=true
+ end
+ break if tp_found and fp_found
+ end
+ unless fp_found and tp_found #if perfect/worst add wrong/right instance with lowest confidence
+ a << (tp_found ? 0 : 1)
+ p << 1
+ c << -Float::MAX
+ end
+
(0..p.size-2).each do |i|
((i+1)..p.size-1).each do |j|
if c[i]<c[j]