summaryrefslogtreecommitdiff
path: root/lib/model.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/model.rb')
-rw-r--r--lib/model.rb13
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