diff options
author | Christoph Helma <helma@in-silico.ch> | 2010-07-02 17:50:43 +0200 |
---|---|---|
committer | Christoph Helma <helma@in-silico.ch> | 2010-07-02 17:50:43 +0200 |
commit | 6b8b0a161f492f15c33d4f18e50b604e0fd547bc (patch) | |
tree | 09ac1eb87447abfa69ce446eef5ad930d4b2dc91 /model.rb | |
parent | 258e55e5cbd1355a30dad6bbe2a2638609db9a18 (diff) |
Initial regression validation display
Diffstat (limited to 'model.rb')
-rw-r--r-- | model.rb | 39 |
1 files changed, 23 insertions, 16 deletions
@@ -11,6 +11,7 @@ class ToxCreateModel property :validation_report_uri, String, :length => 255 property :warnings, Text, :length => 2**32-1 property :nr_compounds, Integer + property :type, String property :created_at, DateTime def status @@ -57,22 +58,7 @@ class ToxCreateModel end end - def type - lazar = RestClient.get(@uri, :accept => "application/x-yaml").body - #LOGGER.debug lazar - lazar = YAML.load(lazar) - #LOGGER.debug lazar.inspect - case lazar.dependentVariables - when /classification/ - return "classification" - when /regression/ - return "regression" - else - return "unknown" - end - end - - def validation + def classification_validation begin uri = File.join(@validation_uri, 'statistics') yaml = RestClient.get(uri).body @@ -109,11 +95,32 @@ class ToxCreateModel end end + def regression_validation + begin + uri = File.join(@validation_uri, 'statistics') + yaml = RestClient.get(uri).body + v = YAML.load(yaml) + rescue + "Service offline" + end + end + def process + if !@uri and status == "Completed" @uri = RestClient.get(File.join(@task_uri, 'resultURI')).body + lazar = YAML.load(RestClient.get(@uri, :accept => "application/x-yaml").body) + case lazar.dependentVariables + when /classification/ + @type = "classification" + when /regression/ + @type = "regression" + else + @type = "unknown" + end save end + if !@validation_uri and validation_status == "Completed" begin @validation_uri = RestClient.get(File.join(@validation_task_uri, 'resultURI')).body |