Class: NexosisApi::ModelSummary
- Inherits:
-
Object
- Object
- NexosisApi::ModelSummary
- Defined in:
- lib/nexosis_api/model_summary.rb
Overview
class to hold the parsed results of model summary json
Instance Attribute Summary collapse
-
#algorithm ⇒ NexosisApi::Algorithm
Information about the algorithm used to create the model.
-
#column_metadata ⇒ Array of NexosisApi::Column
Descriptive information about the columns.
-
#created_date ⇒ DateTime
The date on which this model was created.
-
#datasource_name ⇒ String
The data source used to create this model.
-
#metrics ⇒ Array of NexosisApi::Metric
Algorithm and model specific metrics which may be of interest.
-
#model_id ⇒ String
Unique model id for this model in uuid/guid format.
-
#prediction_domain ⇒ String
readonly
The type of prediction performed.
-
#session_id ⇒ String
Unique id of the session used to create this model instance.
Instance Method Summary collapse
-
#initialize(model_hash) ⇒ ModelSummary
constructor
A new instance of ModelSummary.
Constructor Details
#initialize(model_hash) ⇒ ModelSummary
Returns a new instance of ModelSummary.
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/nexosis_api/model_summary.rb', line 5 def initialize(model_hash) model_hash.each do |k, v| k = k.to_s if (k == 'modelId') @model_id = v elsif (k == 'predictionDomain') @prediction_domain = v elsif (k == 'dataSourceName') @datasource_name = v elsif (k == 'createdDate') @created_date = DateTime.parse(v) unless v.nil? elsif (k == 'algorithm') @algorithm = NexosisApi::Algorithm.new(v) unless v.nil? elsif (k == 'columns') @column_metadata = v.reject { |_key, value| value.nil? } .map do |col_key, col_val| NexosisApi::Column.new(col_key, col_val) end elsif (k == 'metrics') @metrics = v.reject { |_key, value| value.nil? } .map do |col_key, col_val| NexosisApi::Metric.new(col_key, col_val) end elsif (k == 'sessionId') @session_id = v end end end |
Instance Attribute Details
#algorithm ⇒ NexosisApi::Algorithm
Information about the algorithm used to create the model
56 57 58 |
# File 'lib/nexosis_api/model_summary.rb', line 56 def algorithm @algorithm end |
#column_metadata ⇒ Array of NexosisApi::Column
Descriptive information about the columns
60 61 62 |
# File 'lib/nexosis_api/model_summary.rb', line 60 def @column_metadata end |
#created_date ⇒ DateTime
The date on which this model was created.
52 53 54 |
# File 'lib/nexosis_api/model_summary.rb', line 52 def created_date @created_date end |
#datasource_name ⇒ String
The data source used to create this model
48 49 50 |
# File 'lib/nexosis_api/model_summary.rb', line 48 def datasource_name @datasource_name end |
#metrics ⇒ Array of NexosisApi::Metric
Algorithm and model specific metrics which may be of interest
64 65 66 |
# File 'lib/nexosis_api/model_summary.rb', line 64 def metrics @metrics end |
#model_id ⇒ String
Unique model id for this model in uuid/guid format.
36 37 38 |
# File 'lib/nexosis_api/model_summary.rb', line 36 def model_id @model_id end |
#prediction_domain ⇒ String (readonly)
The type of prediction performed
44 45 46 |
# File 'lib/nexosis_api/model_summary.rb', line 44 def prediction_domain @prediction_domain end |
#session_id ⇒ String
Unique id of the session used to create this model instance
40 41 42 |
# File 'lib/nexosis_api/model_summary.rb', line 40 def session_id @session_id end |