Class: Rumale::Tree::Node
- Inherits:
-
Object
- Object
- Rumale::Tree::Node
- Defined in:
- rumale-tree/lib/rumale/tree/node.rb
Overview
Node is a class that implements node used for construction of decision tree. This class is used for internal data structures.
Instance Method Summary collapse
-
#initialize(depth: 0, impurity: 0.0, n_samples: 0, probs: 0.0, leaf: false, leaf_id: nil, left: nil, right: nil, feature_id: 0, threshold: 0.0) ⇒ Node
constructor
Create a new node for decision tree.
Constructor Details
#initialize(depth: 0, impurity: 0.0, n_samples: 0, probs: 0.0, leaf: false, leaf_id: nil, left: nil, right: nil, feature_id: 0, threshold: 0.0) ⇒ Node
Create a new node for decision tree.
23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'rumale-tree/lib/rumale/tree/node.rb', line 23 def initialize(depth: 0, impurity: 0.0, n_samples: 0, probs: 0.0, leaf: false, leaf_id: nil, left: nil, right: nil, feature_id: 0, threshold: 0.0) @depth = depth @impurity = impurity @n_samples = n_samples @probs = probs @leaf = leaf @leaf_id = leaf_id @left = left @right = right @feature_id = feature_id @threshold = threshold end |