Class: ModelFox::BagOfWordsFeatureContribution

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

Overview

This describes the contribution of a feature from a bag of words feature group.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(column_name:, ngram:, feature_contribution_value:, feature_value:) ⇒ BagOfWordsFeatureContribution

Returns a new instance of BagOfWordsFeatureContribution.



161
162
163
164
165
166
# File 'lib/modelfox/modelfox.rb', line 161

def initialize(column_name:, ngram:, feature_contribution_value:, feature_value:)
  @column_name = column_name
  @ngram = ngram
  @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.



154
155
156
# File 'lib/modelfox/modelfox.rb', line 154

def column_name
  @column_name
end

#feature_contribution_valueObject (readonly)

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



160
161
162
# File 'lib/modelfox/modelfox.rb', line 160

def feature_contribution_value
  @feature_contribution_value
end

#feature_valueObject (readonly)

This is the value of the feature.



158
159
160
# File 'lib/modelfox/modelfox.rb', line 158

def feature_value
  @feature_value
end

#ngramObject (readonly)

This is the ngram for the feature.



156
157
158
# File 'lib/modelfox/modelfox.rb', line 156

def ngram
  @ngram
end