Class: NexosisApi::SessionResult
- Defined in:
- lib/nexosis_api/session_result.rb
Overview
Class for parsing the results of a completed session
Instance Attribute Summary collapse
-
#data ⇒ NexosisApi::PagedArray of Hash
The result data in a hash with the name of the target column will contain the test data and results.
-
#metrics ⇒ NexosisApi::ImpactMetric
The impact analysis if this session type is impact.
Attributes inherited from Session
#column_metadata, #datasource_name, #end_date, #extra_parameters, #links, #messages, #model_id, #name, #prediction_domain, #prediction_intervals, #requested_date, #result_interval, #session_id, #start_date, #status, #status_history, #supports_feature_importance, #target_column, #type
Instance Method Summary collapse
-
#initialize(session_hash) ⇒ SessionResult
constructor
A new instance of SessionResult.
Constructor Details
#initialize(session_hash) ⇒ SessionResult
Returns a new instance of SessionResult.
4 5 6 7 8 9 10 11 12 13 14 15 |
# File 'lib/nexosis_api/session_result.rb', line 4 def initialize(session_hash) session_hash.each do |k, v| if k.to_s == 'metrics' && session_hash['type'] == 'impact' instance_variable_set("@#{k}", NexosisApi::ImpactMetric.new(v)) unless v.nil? elsif k.to_s == 'metrics' @metrics = v.map { |key, value| NexosisApi::Metric.new(key.to_s, value) } unless v.nil? elsif k.to_s == 'data' @data = NexosisApi::PagedArray.new(session_hash, v) end end super(session_hash.reject { |k, _v| k.to_s == 'data' || k.to_s == 'metrics' }) end |
Instance Attribute Details
#data ⇒ NexosisApi::PagedArray of Hash
When retrieving a model creation session this field
The result data in a hash with the name of the target column will contain the test data and results.
25 26 27 |
# File 'lib/nexosis_api/session_result.rb', line 25 def data @data end |
#metrics ⇒ NexosisApi::ImpactMetric
The impact analysis if this session type is impact
19 20 21 |
# File 'lib/nexosis_api/session_result.rb', line 19 def metrics @metrics end |