diff options
author | Christoph Helma <helma@in-silico.ch> | 2015-08-24 12:17:07 +0200 |
---|---|---|
committer | Christoph Helma <helma@in-silico.ch> | 2015-08-24 12:17:07 +0200 |
commit | 8c6c59980bc82dc2177147f2fe34adf8bfbc1539 (patch) | |
tree | 35fb78389a9ac2d54d4d2190c41a8269a754f205 /lib/model.rb | |
parent | 398d8ca681db3aa0a0552eee026705e60dd8449d (diff) |
Model::Prediction with tests, initial indexesv0.0.8
Diffstat (limited to 'lib/model.rb')
-rw-r--r-- | lib/model.rb | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/lib/model.rb b/lib/model.rb index bf8c549..185d70f 100644 --- a/lib/model.rb +++ b/lib/model.rb @@ -19,6 +19,8 @@ module OpenTox # prediction feature field :prediction_feature_id, type: BSON::ObjectId + #belongs_to :prediction + attr_accessor :prediction_dataset attr_accessor :training_dataset @@ -156,11 +158,10 @@ module OpenTox end - class PredictionModel + class Prediction include OpenTox include Mongoid::Document include Mongoid::Timestamps - store_in collection: "models" # TODO field Validations field :endpoint, type: String @@ -169,6 +170,14 @@ module OpenTox field :unit, type: String field :model_id, type: BSON::ObjectId field :crossvalidation_id, type: BSON::ObjectId + + def predict object + Model::Lazar.find(model_id).predict object + end + + def crossvalidation + CrossValidation.find crossvalidation_id + end end end |