Class: HexWrench::NominalFeature
- Defined in:
- lib/hexwrench/core/feature.rb,
lib/hexwrench/weka/feature.rb
Instance Attribute Summary collapse
-
#allowed_labels ⇒ Object
Returns the value of attribute allowed_labels.
Attributes inherited from Feature
Instance Method Summary collapse
-
#initialize(sym, resource, labels = []) ⇒ NominalFeature
constructor
A new instance of NominalFeature.
- #labels_fv ⇒ Object
Methods inherited from Feature
Constructor Details
#initialize(sym, resource, labels = []) ⇒ NominalFeature
Returns a new instance of NominalFeature.
44 45 46 47 |
# File 'lib/hexwrench/core/feature.rb', line 44 def initialize(sym, resource, labels = []) super(sym, resource) @allowed_labels = labels end |
Instance Attribute Details
#allowed_labels ⇒ Object
Returns the value of attribute allowed_labels.
43 44 45 |
# File 'lib/hexwrench/core/feature.rb', line 43 def allowed_labels @allowed_labels end |
Instance Method Details
#labels_fv ⇒ Object
14 15 16 17 18 19 20 |
# File 'lib/hexwrench/weka/feature.rb', line 14 def labels_fv unless @labels_fv @labels_fv = Weka::FastVector.new allowed_labels.each{|l| @labels_fv.add_element(l.to_s)} end @labels_fv end |