Class: HybridForest::Trees::Split
- Inherits:
-
Object
- Object
- HybridForest::Trees::Split
- Includes:
- Comparable
- Defined in:
- lib/hybridforest/trees/split.rb
Instance Attribute Summary collapse
-
#feature ⇒ Object
readonly
Returns the value of attribute feature.
-
#info_gain ⇒ Object
readonly
Returns the value of attribute info_gain.
-
#subsets ⇒ Object
readonly
Returns the value of attribute subsets.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
- #<=>(other) ⇒ Object
- #binary? ⇒ Boolean
-
#initialize(feature, info_gain: 0, subsets: [Rover::DataFrame.new, Rover::DataFrame.new], value: nil) ⇒ Split
constructor
A new instance of Split.
- #multiway? ⇒ Boolean
Constructor Details
#initialize(feature, info_gain: 0, subsets: [Rover::DataFrame.new, Rover::DataFrame.new], value: nil) ⇒ Split
Returns a new instance of Split.
10 11 12 13 14 15 |
# File 'lib/hybridforest/trees/split.rb', line 10 def initialize(feature, info_gain: 0, subsets: [Rover::DataFrame.new, Rover::DataFrame.new], value: nil) @feature = feature @value = value @subsets = subsets @info_gain = info_gain end |
Instance Attribute Details
#feature ⇒ Object (readonly)
Returns the value of attribute feature.
6 7 8 |
# File 'lib/hybridforest/trees/split.rb', line 6 def feature @feature end |
#info_gain ⇒ Object (readonly)
Returns the value of attribute info_gain.
6 7 8 |
# File 'lib/hybridforest/trees/split.rb', line 6 def info_gain @info_gain end |
#subsets ⇒ Object (readonly)
Returns the value of attribute subsets.
6 7 8 |
# File 'lib/hybridforest/trees/split.rb', line 6 def subsets @subsets end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
6 7 8 |
# File 'lib/hybridforest/trees/split.rb', line 6 def value @value end |
Instance Method Details
#<=>(other) ⇒ Object
17 18 19 |
# File 'lib/hybridforest/trees/split.rb', line 17 def <=>(other) info_gain <=> other.info_gain end |
#binary? ⇒ Boolean
21 22 23 |
# File 'lib/hybridforest/trees/split.rb', line 21 def binary? value ? true : false end |
#multiway? ⇒ Boolean
25 26 27 |
# File 'lib/hybridforest/trees/split.rb', line 25 def multiway? !binary? end |