Class: Weka::Core::Attribute

Inherits:
Object
  • Object
show all
Defined in:
lib/weka/core/attribute.rb

Instance Method Summary collapse

Instance Method Details

#internal_value_of(value) ⇒ Object

The order of the if statements is important here, because a date is also a numeric.



13
14
15
16
17
18
19
20
21
# File 'lib/weka/core/attribute.rb', line 13

def internal_value_of(value)
  if date?
    parse_date(value.to_s)
  elsif numeric?
    value.to_f
  elsif nominal?
    index_of_value(value.to_s)
  end
end

#valuesObject



7
8
9
# File 'lib/weka/core/attribute.rb', line 7

def values
  enumerate_values.to_a
end