Class: ModelFox::FeatureContributions
- Inherits:
-
Object
- Object
- ModelFox::FeatureContributions
- Defined in:
- lib/modelfox/modelfox.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
-
#baseline ⇒ Object
readonly
This is the value the model would output if all features had baseline values.
-
#entries ⇒ Object
readonly
This list will contain one entry for each of the model’s features.
-
#output ⇒ Object
readonly
This is the value the model output.
Instance Method Summary collapse
-
#initialize(baseline:, output:, entries:) ⇒ FeatureContributions
constructor
A new instance of FeatureContributions.
Constructor Details
#initialize(baseline:, output:, entries:) ⇒ FeatureContributions
Returns a new instance of FeatureContributions.
96 97 98 99 100 |
# File 'lib/modelfox/modelfox.rb', line 96 def initialize(baseline:, output:, entries:) @baseline = baseline @output = output @entries = entries end |
Instance Attribute Details
#baseline ⇒ Object (readonly)
This is the value the model would output if all features had baseline values.
91 92 93 |
# File 'lib/modelfox/modelfox.rb', line 91 def baseline @baseline end |
#entries ⇒ Object (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/modelfox/modelfox.rb', line 95 def entries @entries end |
#output ⇒ Object (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/modelfox/modelfox.rb', line 93 def output @output end |