Sha256: e29e3cdd54331510a7106d13c12507f6769337e3dccef8718844756c8a40b1d3
Contents?: true
Size: 1.1 KB
Versions: 74
Compression:
Stored size: 1.1 KB
Contents
# == Schema Information # # Table name: easy_ml_predictions # # id :bigint not null, primary key # model_id :bigint not null # model_history_id :bigint # prediction_type :string # prediction_value :jsonb # raw_input :jsonb # normalized_input :jsonb # created_at :datetime not null # updated_at :datetime not null # module EasyML class Prediction < ActiveRecord::Base self.table_name = "easy_ml_predictions" belongs_to :model belongs_to :model_history, optional: true validates :model_id, presence: true validates :prediction_type, presence: true, inclusion: { in: %w[regression classification] } validates :prediction_value, presence: true validates :raw_input, presence: true validates :normalized_input, presence: true def prediction prediction_value["value"] end def probabilities prediction_value["probabilities"] end def regression? prediction_type == "regression" end def classification? prediction_type == "classification" end end end
Version data entries
74 entries across 74 versions & 1 rubygems