From 8c6c59980bc82dc2177147f2fe34adf8bfbc1539 Mon Sep 17 00:00:00 2001 From: Christoph Helma Date: Mon, 24 Aug 2015 12:17:07 +0200 Subject: Model::Prediction with tests, initial indexes --- lib/model.rb | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'lib/model.rb') 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 -- cgit v1.2.3