summaryrefslogtreecommitdiff
path: root/lib/model.rb
diff options
context:
space:
mode:
authorChristoph Helma <helma@in-silico.ch>2017-01-11 09:20:40 +0100
committerChristoph Helma <helma@in-silico.ch>2017-01-11 09:20:40 +0100
commit04ebe0640ab6e566dfc316f80a020d1e78b10924 (patch)
tree945f89f33fed9f868318e678af029f1c491eb2e2 /lib/model.rb
parented0d7edee4ac9831b58a01555de8bdba3534495e (diff)
validation documentation
Diffstat (limited to 'lib/model.rb')
-rw-r--r--lib/model.rb12
1 files changed, 10 insertions, 2 deletions
diff --git a/lib/model.rb b/lib/model.rb
index 64edb76..b18610d 100644
--- a/lib/model.rb
+++ b/lib/model.rb
@@ -320,7 +320,9 @@ module OpenTox
end
- def save # store independent_variables in GridFS to avoid Mongo database size limit problems
+ # Save the model
+ # Stores independent_variables in GridFS to avoid Mongo database size limit problems
+ def save
file = Mongo::Grid::File.new(Marshal.dump(@independent_variables), :filename => "#{id}.independent_variables")
self.independent_variables_id = $gridfs.insert_one(file)
super
@@ -357,6 +359,8 @@ module OpenTox
substance_ids.collect{|id| Substance.find(id)}
end
+ # Are fingerprints used as descriptors
+ # @return [TrueClass, FalseClass]
def fingerprints?
algorithms[:descriptors][:method] == "fingerprint" ? true : false
end
@@ -428,10 +432,14 @@ module OpenTox
repeated_crossvalidation.crossvalidations
end
+ # Is it a regression model
+ # @return [TrueClass, FalseClass]
def regression?
model.is_a? LazarRegression
end
+ # Is it a classification model
+ # @return [TrueClass, FalseClass]
def classification?
model.is_a? LazarClassification
end
@@ -452,7 +460,7 @@ module OpenTox
end
# Create and validate a nano-lazar model, import data from eNanoMapper if necessary
- # nano-lazar methods are described in detail in https://github.com/enanomapper/nano-lazar-paper/blob/master/nano-lazar.pdf
+ # nano-lazar methods are described in detail in https://github.com/enanomapper/nano-lazar-paper/blob/master/nano-lazar.pdf
# @param [OpenTox::Dataset, nil] training_dataset
# @param [OpenTox::Feature, nil] prediction_feature
# @param [Hash, nil] algorithms