summaryrefslogtreecommitdiff
path: root/lib/validation_db.rb
diff options
context:
space:
mode:
authorMartin Gütlein <martin.guetlein@gmail.com>2010-03-08 17:01:23 +0100
committerMartin Gütlein <martin.guetlein@gmail.com>2010-03-08 17:01:23 +0100
commit9c41e91c6a6067d8b254e0ef5da66c752fabdb4d (patch)
tree74d4e9702bed59f2d6d5b3fd035e88020dba9f79 /lib/validation_db.rb
parente93ada015dbe91cff5b72eb8628c4f52814e3bdb (diff)
fixed: percent float instead of int, sum of number counts for cv
Diffstat (limited to 'lib/validation_db.rb')
-rw-r--r--lib/validation_db.rb36
1 files changed, 24 insertions, 12 deletions
diff --git a/lib/validation_db.rb b/lib/validation_db.rb
index 01607ce..8f4a540 100644
--- a/lib/validation_db.rb
+++ b/lib/validation_db.rb
@@ -3,33 +3,45 @@
require lib
end
+require "lib/merge.rb"
+
module Lib
- VAL_PROPS = [ :id, :uri, :model_uri, :training_dataset_uri, :prediction_feature,
- :test_dataset_uri, :prediction_dataset_uri,
- :created_at, :real_runtime, # :cpu_runtime,
- :num_instances, :num_without_class, :percent_without_class, :num_unpredicted, :percent_unpredicted ]
+ VAL_PROPS_GENERAL = [ :id, :uri, :model_uri, :training_dataset_uri, :prediction_feature,
+ :test_dataset_uri, :prediction_dataset_uri, :created_at ]
+ VAL_PROPS_SUM = [ :num_instances, :num_without_class, :num_unpredicted ]
+ VAL_PROPS_AVG = [:real_runtime, :percent_without_class, :percent_unpredicted ]
+ VAL_PROPS = VAL_PROPS_GENERAL + VAL_PROPS_SUM + VAL_PROPS_AVG
# :crossvalidation_info
VAL_CV_PROPS = [ :crossvalidation_id, :crossvalidation_fold ]
# :classification_statistics
- VAL_CLASS_PROPS_SINGLE = [ :num_correct, :num_incorrect, :percent_correct, :percent_incorrect ]
+ VAL_CLASS_PROPS_SINGLE_SUM = [ :num_correct, :num_incorrect, :confusion_matrix ]
+ VAL_CLASS_PROPS_SINGLE_AVG = [ :percent_correct, :percent_incorrect ]
+ VAL_CLASS_PROPS_SINGLE = VAL_CLASS_PROPS_SINGLE_SUM + VAL_CLASS_PROPS_SINGLE_AVG
+
# :class_value_statistics
- VAL_CLASS_PROPS_PER_CLASS = [ :area_under_roc, :false_negative_rate, :false_positive_rate,
- :f_measure, :num_false_positives, :num_false_negatives,
- :num_true_positives, :num_true_negatives, :precision,
+ VAL_CLASS_PROPS_PER_CLASS_SUM = [ :num_false_positives, :num_false_negatives,
+ :num_true_positives, :num_true_negatives ]
+ VAL_CLASS_PROPS_PER_CLASS_AVG = [ :area_under_roc, :false_negative_rate, :false_positive_rate,
+ :f_measure, :precision,
:recall, :true_negative_rate, :true_positive_rate ]
- VAL_CLASS_PROPS = VAL_CLASS_PROPS_SINGLE + VAL_CLASS_PROPS_PER_CLASS + [ :confusion_matrix ]
+ VAL_CLASS_PROPS_PER_CLASS = VAL_CLASS_PROPS_PER_CLASS_SUM + VAL_CLASS_PROPS_PER_CLASS_AVG
+
+ VAL_CLASS_PROPS = VAL_CLASS_PROPS_SINGLE + VAL_CLASS_PROPS_PER_CLASS
VAL_CLASS_PROPS_EXTENDED = VAL_CLASS_PROPS + [:accuracy]
# :regression_statistics
VAL_REGR_PROPS = [ :root_mean_squared_error, :mean_absolute_error, :r_square ]
-
CROSS_VAL_PROPS = [:algorithm_uri, :dataset_uri, :num_folds, :stratified, :random_seed]
ALL_PROPS = VAL_PROPS + VAL_CV_PROPS + VAL_CLASS_PROPS_EXTENDED + VAL_REGR_PROPS + CROSS_VAL_PROPS
+ VAL_MERGE_GENERAL = VAL_PROPS_GENERAL + VAL_CV_PROPS + [:classification_statistics, :regression_statistics] + CROSS_VAL_PROPS
+ VAL_MERGE_SUM = VAL_PROPS_SUM + VAL_CLASS_PROPS_SINGLE_SUM + VAL_CLASS_PROPS_PER_CLASS_SUM
+ VAL_MERGE_AVG = VAL_PROPS_AVG + VAL_CLASS_PROPS_SINGLE_AVG + VAL_CLASS_PROPS_PER_CLASS_AVG + VAL_REGR_PROPS
+
class Validation
include DataMapper::Resource
@@ -45,9 +57,9 @@ module Lib
property :num_instances, Integer
property :num_without_class, Integer
- property :percent_without_class, Integer
+ property :percent_without_class, Float
property :num_unpredicted, Integer
- property :percent_unpredicted, Integer
+ property :percent_unpredicted, Float
property :classification_statistics, Object #Hash
property :regression_statistics, Object