summaryrefslogtreecommitdiff
path: root/lib/model.rb
diff options
context:
space:
mode:
authorhelma@in-silico.ch <helma@in-silico.ch>2018-10-30 17:26:59 +0100
committerhelma@in-silico.ch <helma@in-silico.ch>2018-10-30 17:26:59 +0100
commitd61f78093f4ddf03c27a2c8ae0bab9c1f10c80f5 (patch)
tree5e04969abc61ba1cc0f889ea3a4b2496878741c1 /lib/model.rb
parentd7d57cb83dbc78b2aade173bde5fa893ebf634fe (diff)
tests fixed
Diffstat (limited to 'lib/model.rb')
-rw-r--r--lib/model.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/model.rb b/lib/model.rb
index 7eaa469..6d5cf7b 100644
--- a/lib/model.rb
+++ b/lib/model.rb
@@ -46,6 +46,7 @@ module OpenTox
model.prediction_feature_id = prediction_feature.id
model.training_dataset_id = training_dataset.id
model.name = "#{prediction_feature.name} (#{training_dataset.name})"
+
# git or gem versioning
dir = File.dirname(__FILE__)
path = File.expand_path("../", File.expand_path(dir))
@@ -485,6 +486,8 @@ module OpenTox
model.is_a? LazarClassification
end
+ # TODO from_pubchem_aid
+
# Create and validate a lazar model from a csv file with training data and a json file with metadata
# @param [File] CSV file with two columns. The first line should contain either SMILES or InChI (first column) and the endpoint (second column). The first column should contain either the SMILES or InChI of the training compounds, the second column the training compounds toxic activities (qualitative or quantitative). Use -log10 transformed values for regression datasets. Add metadata to a JSON file with the same basename containing the fields "species", "endpoint", "source" and "unit" (regression only). You can find example training data at https://github.com/opentox/lazar-public-data.
# @return [OpenTox::Model::Validation] lazar model with three independent 10-fold crossvalidations
@@ -533,6 +536,14 @@ module OpenTox
end
+ # TODO
+ def to_json
+ "{\n metadata:#{super},\n model:#{model.to_json}, repeated_crossvalidations:#{repeated_crossvalidations.to_json}\n}"
+ end
+
+ def from_json_file
+ end
+
end
end