class NexosisApi::ModelSummary
class to hold the parsed results of model summary json @since 1.3.0
Attributes
algorithm[RW]
Information about the algorithm used to create the model @return [NexosisApi::Algorithm]
column_metadata[RW]
Descriptive information about the columns @return [Array of NexosisApi::Column]
created_date[RW]
The date on which this model was created. @return [DateTime]
datasource_name[RW]
The data source used to create this model @return [String]
metrics[RW]
Algorithm
and model specific metrics which may be of interest @return [Array of NexosisApi::Metric]
model_id[RW]
Unique model id for this model in uuid/guid format. @return [String]
prediction_domain[R]
The type of prediction performed @return [String]
session_id[RW]
Unique id of the session used to create this model instance @return [String]
Public Class Methods
new(model_hash)
click to toggle source
# 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