Class: NexosisApi::FeatureImportance

Inherits:
SessionResponse show all
Defined in:
lib/nexosis_api/feature_importance.rb

Overview

Class to hold the parse results of a request for Feature Importance scores

Since:

  • 2.4.0

Instance Attribute Summary collapse

Attributes inherited from SessionResponse

#datasets_allotted, #datasets_current, #predictions_allotted, #predictions_current, #sessions_allotted, #sessions_current

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

Constructor Details

#initialize(session_hash) ⇒ FeatureImportance

Returns a new instance of FeatureImportance.

Since:

  • 2.4.0



5
6
7
8
# File 'lib/nexosis_api/feature_importance.rb', line 5

def initialize(session_hash)
  @scores = NexosisApi::PagedArray.new(session_hash, session_hash.fetch(:featureImportance) { |k| session_hash.fetch(k.to_s) }.to_a)
  super(session_hash.reject { |k, _v| k.to_s.casecmp('featureimportance').zero? })
end

Instance Attribute Details

#scoresObject (readonly)

A paged array of scores where each element of the array is a two item array of the form [col_name, score]

Returns:

  • NexosisApi::PagedArray

Since:

  • 2.4.0



12
13
14
# File 'lib/nexosis_api/feature_importance.rb', line 12

def scores
  @scores
end