diff options
author | mguetlein <martin.guetlein@gmail.com> | 2010-11-30 10:02:15 +0100 |
---|---|---|
committer | mguetlein <martin.guetlein@gmail.com> | 2010-11-30 10:02:15 +0100 |
commit | 3f150eb2aae74d8b9ba43c32a5ae655a3a7f71bf (patch) | |
tree | 5a081bdcf966a1e5918ca120a52b36b2e469bd6d | |
parent | 65ec4bc561e10a895558876b551a3a5a5e05050d (diff) |
fix validation_type for example
-rw-r--r-- | example.rb | 4 | ||||
-rw-r--r-- | validation/validation_service.rb | 7 | ||||
-rw-r--r-- | validation/validation_test.rb | 4 |
3 files changed, 11 insertions, 4 deletions
@@ -81,6 +81,7 @@ class Example split_params = Validation::Util.train_test_dataset_split(data_uri, URI.decode(@@feature), 0.9, 1) v = Validation::Validation.new :training_dataset_uri => split_params[:training_dataset_uri], + :validation_type => "test_set_validation", :test_dataset_uri => split_params[:test_dataset_uri], :test_target_dataset_uri => data_uri, :prediction_feature => URI.decode(@@feature), @@ -104,8 +105,7 @@ class Example log "build qmrf" t = ReachReports.create_report("QMRF",{:model_uri=>@@model}) - log Lib::TestUtil.wait_for_task(t) - #qmrf = OpenTox::RestClientWrapper.post(File.join(@@config[:services]["opentox-validation"],"reach_report/QMRF"),{:model_uri=>@@model}) + Lib::TestUtil.wait_for_task(t) task.progress(100) log "done" diff --git a/validation/validation_service.rb b/validation/validation_service.rb index 0907edb..d549896 100644 --- a/validation/validation_service.rb +++ b/validation/validation_service.rb @@ -43,6 +43,13 @@ module Validation raise "internal error, validation-id not set "+to_yaml if self.id==nil end + def save! + # make sure that non-temporary validation objects have a valiation_type + # (a temporary validation object is created for crossvaldiation/statistics) + $sinatra.halt 500,"validation_type missing" unless self.validation_type + super + end + # deletes a validation # PENDING: model and referenced datasets are deleted as well, keep it that way? def delete diff --git a/validation/validation_test.rb b/validation/validation_test.rb index 1bdbf90..b1fbf25 100644 --- a/validation/validation_test.rb +++ b/validation/validation_test.rb @@ -80,7 +80,7 @@ class ValidationTest < Test::Unit::TestCase # #:classification=>"true"} # puts last_response.body - run_test("1b","http://localhost/validation/28")#,"http://localhost/validation/394"); + #run_test("1b","http://localhost/validation/28")#,"http://localhost/validation/394"); #run_test("7b","http://localhost/validation/21") @@ -96,7 +96,7 @@ class ValidationTest < Test::Unit::TestCase #puts Nightly.build_nightly("1") - # prepare_examples + prepare_examples #do_test_examples # USES CURL, DO NOT FORGET TO RESTART VALIDATION SERVICE #do_test_examples_ortona end |