summaryrefslogtreecommitdiff
path: root/report/validation_data.rb
diff options
context:
space:
mode:
authormguetlein <martin.guetlein@gmail.com>2010-12-09 16:39:22 +0100
committermguetlein <martin.guetlein@gmail.com>2010-12-09 16:39:22 +0100
commit3fd24182bee64ea2252aa494e5930c9c9924d1d2 (patch)
tree9af11d6624bfe0566f768b0a0a227d50216327dc /report/validation_data.rb
parent7459525cbf5cc8ed4afcbaa3a0749828098a8f48 (diff)
add significance tests to reports, some more report modifications
Diffstat (limited to 'report/validation_data.rb')
-rw-r--r--report/validation_data.rb10
1 files changed, 9 insertions, 1 deletions
diff --git a/report/validation_data.rb b/report/validation_data.rb
index bd04554..d558c88 100644
--- a/report/validation_data.rb
+++ b/report/validation_data.rb
@@ -302,6 +302,12 @@ module Reports
col_values = get_values(attribute_col)
#puts col_values.inspect
+ # get domain for classification attribute, i.e. ["true","false"]
+ class_domain = get_domain_for_attr(attribute_val)
+ # or the attribute has a complementary value, i.e. true_positive_rate
+ # -> domain is reduced to one class value
+ first_value_elem = (class_domain.size==1 && class_domain[0]!=nil)
+
cell_values = {}
row_values.each do |row|
col_values.each do |col|
@@ -309,7 +315,9 @@ module Reports
@validations.each do |v|
if v.send(attribute_row)==row and v.send(attribute_col)==col
raise "two validation have equal row and column values"if val!=nil
- val = v.send(attribute_val).to_nice_s
+ val = v.send(attribute_val)
+ val = val[class_domain[0]] if first_value_elem
+ val = val.to_nice_s
end
end
cell_values[row] = [] if cell_values[row]==nil