Class: NexosisApi::FeatureImportance
- Inherits:
-
SessionResponse
- Object
- Session
- SessionResponse
- NexosisApi::FeatureImportance
- Defined in:
- lib/nexosis_api/feature_importance.rb
Overview
Class to hold the parse results of a request for Feature Importance scores
Instance Attribute Summary collapse
-
#scores ⇒ Object
readonly
A paged array of scores where each element of the array is a two item array of the form [col_name, score].
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
-
#initialize(session_hash) ⇒ FeatureImportance
constructor
A new instance of FeatureImportance.
Constructor Details
#initialize(session_hash) ⇒ FeatureImportance
Returns a new instance of FeatureImportance.
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
#scores ⇒ Object (readonly)
A paged array of scores where each element of the array is a two item array of the form [col_name, score]
12 13 14 |
# File 'lib/nexosis_api/feature_importance.rb', line 12 def scores @scores end |