Class: OpenTox::Lazar

Inherits:
OpenTox show all
Defined in:
lib/opentox-ruby-api-wrapper.rb

Instance Attribute Summary

Attributes inherited from OpenTox

#uri

Instance Method Summary collapse

Methods inherited from OpenTox

#destroy, #finished?, #name, #uri_escape

Constructor Details

#initialize(params) ⇒ Lazar

Create a new prediction model from a dataset



156
157
158
159
160
161
162
# File 'lib/opentox-ruby-api-wrapper.rb', line 156

def initialize(params)
  if params[:uri]
    @uri = params[:uri]
  elsif params[:dataset_uri]
    @uri = RestClient.post ENV['OPENTOX_LAZAR'] + 'models' , :dataset_uri => params[:dataset_uri]
  end
end

Instance Method Details

#predict(compound) ⇒ Object

Predict a compound



165
166
167
# File 'lib/opentox-ruby-api-wrapper.rb', line 165

def predict(compound)
  LazarPrediction.new(:uri => RestClient.post(@uri, :compound_uri => compound.uri))
end