diff options
author | mr <mr@mrautenberg.de> | 2010-12-14 12:31:57 +0100 |
---|---|---|
committer | mr <mr@mrautenberg.de> | 2010-12-14 12:31:57 +0100 |
commit | 5a01f50477e3fecd5921a8686c80045dbfcf799d (patch) | |
tree | 7e1977f8fc6ea0f20cf2af9e5daab046cd003952 | |
parent | 42423071defcc0798c4fd97a9817f77867d2ffcb (diff) |
remove token_id from tox_create_models
-rw-r--r-- | application.rb | 4 | ||||
-rw-r--r-- | model.rb | 4 |
2 files changed, 5 insertions, 3 deletions
diff --git a/application.rb b/application.rb index ecb4b7e..30458bc 100644 --- a/application.rb +++ b/application.rb @@ -140,8 +140,8 @@ post '/models' do # create a new model rescue => e error "Dataset creation failed with #{e.message}" end - @dataset.token_id = session[:token_id] if session[:token_id] - @dataset.save + token_id = session[:token_id] if session[:token_id] + @dataset.save(token_id) if @dataset.compounds.size < 10 error "Too few compounds to create a prediction model. Did you provide compounds in SMILES format and classification activities as described in the #{link_to "instructions", "/excel_format"}? As a rule of thumb you will need at least 100 training compounds for nongeneric datasets. A lower number could be sufficient for congeneric datasets." end @@ -38,9 +38,11 @@ class ToxCreateModel property :root_mean_squared_error, Float property :mean_absolute_error, Float - property :token_id, String, :length => 255 property :web_uri, String, :length => 255 + attr_accessor :token_id + @token_id = nil + after :save, :check_policy =begin |