diff options
author | Martin Gütlein <martin.guetlein@gmail.com> | 2010-03-23 13:00:55 +0100 |
---|---|---|
committer | Martin Gütlein <martin.guetlein@gmail.com> | 2010-03-23 13:00:55 +0100 |
commit | 54d1c336501dd34785ca29a3393a9fd347097482 (patch) | |
tree | 9a3764deb28e9db0b09ae5ba284a8df7c7528325 /lib/model.rb | |
parent | 420efdf93cc335c8adbdba38a71fa36b797188b0 (diff) |
added amit dataset parsing, static lazar feature modifier
Diffstat (limited to 'lib/model.rb')
-rw-r--r-- | lib/model.rb | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/lib/model.rb b/lib/model.rb index 6c48734..b4ef86c 100644 --- a/lib/model.rb +++ b/lib/model.rb @@ -2,7 +2,9 @@ module OpenTox module Model class Lazar - include Owl + include Owl + + PREDICTION_FEATURE_MODIFIER = "_lazar_prediction" # Create a new prediction model from a dataset def initialize @@ -24,7 +26,7 @@ module OpenTox lazar.algorithm = File.join(@@config[:services]["opentox-algorithm"],"lazar") lazar.trainingDataset = yaml[:activity_dataset] lazar.dependentVariables = yaml[:endpoint] - lazar.predictedVariables = yaml[:endpoint] + "_lazar_prediction" + lazar.predictedVariables = yaml[:endpoint] + PREDICTION_FEATURE_MODIFIER lazar end @@ -35,7 +37,8 @@ module OpenTox def self.find(uri) yaml = RestClient.get(uri, :accept => "application/x-yaml") OpenTox::Model::Lazar.from_yaml(yaml) - end + end + # Predict a compound def predict(compound) @@ -80,7 +83,7 @@ module OpenTox def trainingDataset=(trainingDataset) me = @model.subject(RDF['type'],OT[self.owl_class]) - @model.add me, OT['trainingDataset'], Redland::Uri.new(trainingDataset) # untyped individual comes from this line, why?? + @model.add me, OT['trainingDataset'], Redland::Uri.new(trainingDataset) # untyped individual comes from this line, why?? @model.add Redland::Uri.new(trainingDataset), RDF['type'], OT['Dataset'] end @@ -100,7 +103,8 @@ module OpenTox me = @model.subject(RDF['type'],OT[self.owl_class]) @model.add me, OT['predictedVariables'], Redland::Uri.new(predictedVariables) # untyped individual comes from this line, why?? @model.add Redland::Uri.new(predictedVariables), RDF['type'], OT['Feature'] - end + end + end end end |