Class: Tangram::FeatureContributions

Inherits:
Object
  • Object
show all
Defined in:
lib/tangram/tangram.rb

Overview

This is a description of the feature contributions for the prediction if the task is regression or binary classification, or for a single class if the task is multiclass classification.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(baseline:, output:, entries:) ⇒ FeatureContributions

Returns a new instance of FeatureContributions.


96
97
98
99
100
# File 'lib/tangram/tangram.rb', line 96

def initialize(baseline:, output:, entries:)
  @baseline = baseline
  @output = output
  @entries = entries
end

Instance Attribute Details

#baselineObject (readonly)

This is the value the model would output if all features had baseline values.


91
92
93
# File 'lib/tangram/tangram.rb', line 91

def baseline
  @baseline
end

#entriesObject (readonly)

This list will contain one entry for each of the model's features. Note that features are computed from columns, so there will likely be more features than columns.


95
96
97
# File 'lib/tangram/tangram.rb', line 95

def entries
  @entries
end

#outputObject (readonly)

This is the value the model output. Any difference from the `baseline_value` is because of the deviation of the features from their baseline values.


93
94
95
# File 'lib/tangram/tangram.rb', line 93

def output
  @output
end