Class: OpenTox::Model::LazarClassification
- Defined in:
- lib/model.rb
Class Method Summary collapse
Methods inherited from Lazar
#initialize, #predict, #predict_compound, #training_activities
Methods inherited from Model
Constructor Details
This class inherits a constructor from OpenTox::Model::Lazar
Class Method Details
.create(training_dataset, params = {}) ⇒ Object
135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 |
# File 'lib/model.rb', line 135 def self.create training_dataset, params={} model = self.new training_dataset, params model.prediction_algorithm = "OpenTox::Algorithm::Classification.weighted_majority_vote" unless model.prediction_algorithm model.neighbor_algorithm ||= "fingerprint_neighbors" model.neighbor_algorithm_parameters ||= {} { :type => "MP2D", :training_dataset_id => training_dataset.id, :min_sim => 0.1 }.each do |key,value| model.neighbor_algorithm_parameters[key] ||= value end model.save model end |