summaryrefslogtreecommitdiff
path: root/lazar.rb
diff options
context:
space:
mode:
authorMartin Gütlein <martin.guetlein@gmail.com>2010-02-17 10:01:06 +0100
committerMartin Gütlein <martin.guetlein@gmail.com>2010-02-17 10:01:06 +0100
commit76a9e2d17c2130829d5772c9c8d55072ab40ab58 (patch)
tree736670ea330c651880ff4396e139f0b00e701fbd /lazar.rb
parenta787ecc2bff70ee705f09d3ba9b38b24394f5075 (diff)
migrate when delete_all, dataset prediction fixed
Diffstat (limited to 'lazar.rb')
-rw-r--r--lazar.rb9
1 files changed, 6 insertions, 3 deletions
diff --git a/lazar.rb b/lazar.rb
index 4c10c04..9014d3b 100644
--- a/lazar.rb
+++ b/lazar.rb
@@ -3,9 +3,11 @@ class Lazar < Model
attr_accessor :dataset, :predictions
def classify(compound_uri)
-
- @dataset = OpenTox::Dataset.new
- @predictions = {}
+
+ unless @dataset
+ @dataset = OpenTox::Dataset.new
+ @predictions = {}
+ end
lazar = YAML.load yaml
compound = OpenTox::Compound.new(:uri => compound_uri)
compound_matches = compound.match lazar[:features]
@@ -50,6 +52,7 @@ class Lazar < Model
:features => compound_matches
} } }
end
+
end
def database_activity?(compound_uri)