summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristoph Helma <helma@in-silico.ch>2017-01-11 08:24:23 +0100
committerChristoph Helma <helma@in-silico.ch>2017-01-11 08:24:23 +0100
commited0d7edee4ac9831b58a01555de8bdba3534495e (patch)
tree6eae2f15554e6780576eac4bdd79a6a8422977ba
parentb5d6446f058916d018139948002b6e9d1162d4fe (diff)
model documentation updated
-rw-r--r--README.md2
-rw-r--r--lib/model.rb12
2 files changed, 9 insertions, 5 deletions
diff --git a/README.md b/README.md
index 7e0e420..28ed18f 100644
--- a/README.md
+++ b/README.md
@@ -87,7 +87,7 @@ Execute the following commands either from an interactive Ruby shell or a Ruby s
#### Experiment with other datasets, endpoints and algorithms
- You can pass training_dataset, prediction_feature and algorithms parameters to the `Model::Validation.create_from_enanomapper` command. The [API documentation](http://rdoc.info/gems/lazar) provides detailed instructions.
+ You can pass training_dataset, prediction_feature and algorithms parameters to the `Model::Validation.create_from_enanomapper` command. The [API documentation](http://rdoc.info/gems/lazar) provides detailed instructions. Detailed documentation and validation results can be found in this [publication](https://github.com/enanomapper/nano-lazar-paper/blob/master/nano-lazar.pdf).
Documentation
-------------
diff --git a/lib/model.rb b/lib/model.rb
index 321636d..64edb76 100644
--- a/lib/model.rb
+++ b/lib/model.rb
@@ -28,11 +28,14 @@ module OpenTox
field :version, type: Hash, default:{}
# Create a lazar model
- # @param [OpenTox::Dataset, nil] training_dataset
+ # @param [OpenTox::Dataset] training_dataset
# @param [OpenTox::Feature, nil] prediction_feature
- # @param [Hash] algorithms
+ # By default the first feature of the training dataset will be predicted, specify a prediction_feature if you want to predict another feature
+ # @param [Hash, nil] algorithms
+ # Default algorithms will be used, if no algorithms parameter is provided. The algorithms hash has the following keys: :descriptors (specifies the descriptors to be used for similarity calculations and local QSAR models), :similarity (similarity algorithm and threshold), :feature_selection (feature selection algorithm), :prediction (local QSAR algorithm). Default parameters are used for unspecified keys.
+ #
# @return [OpenTox::Model::Lazar]
- def self.create prediction_feature:nil, training_dataset:nil, algorithms:{}
+ def self.create prediction_feature:nil, training_dataset:, algorithms:{}
bad_request_error "Please provide a prediction_feature and/or a training_dataset." unless prediction_feature or training_dataset
prediction_feature = training_dataset.features.first unless prediction_feature
# TODO: prediction_feature without training_dataset: use all available data
@@ -185,7 +188,7 @@ module OpenTox
model
end
- # Predict a substance
+ # Predict a substance (compound or nanoparticle)
# @param [OpenTox::Substance]
# @return [Hash]
def predict_substance substance
@@ -449,6 +452,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
# @param [OpenTox::Dataset, nil] training_dataset
# @param [OpenTox::Feature, nil] prediction_feature
# @param [Hash, nil] algorithms