diff options
author | mguetlein <martin.guetlein@gmail.com> | 2010-09-07 09:25:39 +0200 |
---|---|---|
committer | mguetlein <martin.guetlein@gmail.com> | 2010-09-07 09:25:39 +0200 |
commit | 7d69d09e79882cb826dacac2b6474fade13e8690 (patch) | |
tree | c1acc2b07627bbb787a1e4d24a425c90283277aa /test | |
parent | 9ec38f1ebaffa51cac69e5e1a09c988556a690a1 (diff) |
add validation to qmrf-report, bootstrapping
Diffstat (limited to 'test')
-rw-r--r-- | test/test_examples.rb | 28 | ||||
-rw-r--r-- | test/test_examples_util.rb | 16 |
2 files changed, 43 insertions, 1 deletions
diff --git a/test/test_examples.rb b/test/test_examples.rb index d7edba0..8927fb1 100644 --- a/test/test_examples.rb +++ b/test/test_examples.rb @@ -81,6 +81,30 @@ module ValidationExamples end ######################################################################################################## + + class HamsterBootstrapping < BootstrappingValidation + def initialize + @dataset_file = File.new("data/hamster_carcinogenicity.yaml","r") + @prediction_feature = "http://localhost/toxmodel/feature#Hamster%20Carcinogenicity%20(DSSTOX/CPDB)" + end + end + + class LazarHamsterBootstrapping < HamsterBootstrapping + def initialize + @algorithm_uri = File.join(@@config[:services]["opentox-algorithm"],"lazar") + @algorithm_params = "feature_generation_uri="+File.join(@@config[:services]["opentox-algorithm"],"fminer") + super + end + end + + class MajorityHamsterBootstrapping < HamsterBootstrapping + def initialize + @algorithm_uri = File.join(@@config[:services]["opentox-majority"],"/class/algorithm") + super + end + end + + ######################################################################################################## class HamsterTrainingTest < TrainingTestValidation def initialize @@ -303,6 +327,10 @@ module ValidationExamples "10a" => [ ISTLazarISTEpaCrossvalidation ], "11b" => [ MajorityISTRatLiverCrossvalidation ], + + "12" => [ LazarHamsterBootstrapping, MajorityHamsterBootstrapping ], + "12a" => [ LazarHamsterBootstrapping ], + "12b" => [ MajorityHamsterBootstrapping ], } def self.list diff --git a/test/test_examples_util.rb b/test/test_examples_util.rb index b18607d..c5a9900 100644 --- a/test/test_examples_util.rb +++ b/test/test_examples_util.rb @@ -40,7 +40,7 @@ module ValidationExamples $test_case.post uri,params return wait($test_case.last_response.body) else - return OpenTox::RestClientWrapper.post(File.join(@@config[:services]["opentox-validation"],uri),params) + return OpenTox::RestClientWrapper.post(File.join(@@config[:services]["opentox-validation"],uri),params).to_s end end @@ -323,6 +323,20 @@ module ValidationExamples end end + class BootstrappingValidation < ValidationExample + def params + [:algorithm_uri, :dataset_uri, :prediction_feature] + end + + def opt_params + [ :algorithm_params, :random_seed ] + end + + def validation_type + "bootstrapping" + end + end + class CrossValidation < ValidationExample def params [:algorithm_uri, :dataset_uri, :prediction_feature] |