Class: ModelFox::OneHotEncodedFeatureContribution

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

Overview

This describes the contribution of a feature from a one hot encoded feature group.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(column_name:, variant:, feature_contribution_value:, feature_value:) ⇒ OneHotEncodedFeatureContribution

Returns a new instance of OneHotEncodedFeatureContribution.



143
144
145
146
147
148
# File 'lib/modelfox/modelfox.rb', line 143

def initialize(column_name:, variant:, feature_contribution_value:, feature_value:)
  @column_name = column_name
  @variant = variant
  @feature_contribution_value = feature_contribution_value
  @feature_value = feature_value
end

Instance Attribute Details

#column_nameObject (readonly)

This is the name of the source column for the feature group.



136
137
138
# File 'lib/modelfox/modelfox.rb', line 136

def column_name
  @column_name
end

#feature_contribution_valueObject (readonly)

This is the amount that the feature contributed to the output.b



142
143
144
# File 'lib/modelfox/modelfox.rb', line 142

def feature_contribution_value
  @feature_contribution_value
end

#feature_valueObject (readonly)

This is the value of the feature.



140
141
142
# File 'lib/modelfox/modelfox.rb', line 140

def feature_value
  @feature_value
end

#variantObject (readonly)

This is the enum variant the feature indicates the presence of.



138
139
140
# File 'lib/modelfox/modelfox.rb', line 138

def variant
  @variant
end