diff options
author | Christoph Helma <helma@in-silico.ch> | 2016-06-01 10:37:00 +0200 |
---|---|---|
committer | Christoph Helma <helma@in-silico.ch> | 2016-06-01 10:37:00 +0200 |
commit | 65b69d4c35890a7a2d2992108f0cf4eb5202dd1b (patch) | |
tree | d8583d3e745cc21a6897081d28e157f5c0c16024 /lib/crossvalidation.rb | |
parent | b515a0cfedb887a2af753db6e4a08ae1af430cad (diff) |
validation tests fixed
Diffstat (limited to 'lib/crossvalidation.rb')
-rw-r--r-- | lib/crossvalidation.rb | 24 |
1 files changed, 8 insertions, 16 deletions
diff --git a/lib/crossvalidation.rb b/lib/crossvalidation.rb index 22071d8..15e25a5 100644 --- a/lib/crossvalidation.rb +++ b/lib/crossvalidation.rb @@ -3,23 +3,7 @@ module OpenTox module Validation class CrossValidation < Validation field :validation_ids, type: Array, default: [] - field :model_id, type: BSON::ObjectId field :folds, type: Integer, default: 10 - field :nr_instances, type: Integer, default: 0 - field :nr_unpredicted, type: Integer, default: 0 - field :predictions, type: Hash, default: {} - - def time - finished_at - created_at - end - - def validations - validation_ids.collect{|vid| TrainTest.find vid} - end - - def model - Model::Lazar.find model_id - end def self.create model, n=10 klass = ClassificationCrossValidation if model.is_a? Model::LazarClassification @@ -55,6 +39,14 @@ module OpenTox cv.update_attributes(finished_at: Time.now) cv end + + def time + finished_at - created_at + end + + def validations + validation_ids.collect{|vid| TrainTest.find vid} + end end class ClassificationCrossValidation < CrossValidation |