Class: Rumale::Tree::ExtraTreeClassifier
- Inherits:
-
DecisionTreeClassifier
- Object
- Base::Estimator
- BaseDecisionTree
- DecisionTreeClassifier
- Rumale::Tree::ExtraTreeClassifier
- Defined in:
- rumale-tree/lib/rumale/tree/extra_tree_classifier.rb
Overview
ExtraTreeClassifier is a class that implements extra randomized tree for classification.
Reference
-
Geurts, P., Ernst, D., and Wehenkel, L., “Extremely randomized trees,” Machine Learning, vol. 63 (1), pp. 3–42, 2006.
Instance Attribute Summary collapse
-
#classes ⇒ Numo::Int32
readonly
Return the class labels.
-
#feature_importances ⇒ Numo::DFloat
readonly
Return the importance for each feature.
-
#leaf_labels ⇒ Numo::Int32
readonly
Return the labels assigned each leaf.
-
#rng ⇒ Random
readonly
Return the random generator for random selection of feature index.
-
#tree ⇒ Node
readonly
Return the learned tree.
Attributes inherited from Base::Estimator
Instance Method Summary collapse
-
#initialize(criterion: 'gini', max_depth: nil, max_leaf_nodes: nil, min_samples_leaf: 1, max_features: nil, random_seed: nil) ⇒ ExtraTreeClassifier
constructor
Create a new classifier with extra randomized tree algorithm.
Methods inherited from DecisionTreeClassifier
#fit, #predict, #predict_proba
Methods included from Base::Classifier
Methods inherited from BaseDecisionTree
Constructor Details
#initialize(criterion: 'gini', max_depth: nil, max_leaf_nodes: nil, min_samples_leaf: 1, max_features: nil, random_seed: nil) ⇒ ExtraTreeClassifier
Create a new classifier with extra randomized tree algorithm.
53 54 55 56 |
# File 'rumale-tree/lib/rumale/tree/extra_tree_classifier.rb', line 53 def initialize(criterion: 'gini', max_depth: nil, max_leaf_nodes: nil, min_samples_leaf: 1, max_features: nil, random_seed: nil) super end |
Instance Attribute Details
#classes ⇒ Numo::Int32 (readonly)
Return the class labels.
23 24 25 |
# File 'rumale-tree/lib/rumale/tree/extra_tree_classifier.rb', line 23 def classes @classes end |
#feature_importances ⇒ Numo::DFloat (readonly)
Return the importance for each feature.
27 28 29 |
# File 'rumale-tree/lib/rumale/tree/extra_tree_classifier.rb', line 27 def feature_importances @feature_importances end |
#leaf_labels ⇒ Numo::Int32 (readonly)
Return the labels assigned each leaf.
39 40 41 |
# File 'rumale-tree/lib/rumale/tree/extra_tree_classifier.rb', line 39 def leaf_labels @leaf_labels end |
#rng ⇒ Random (readonly)
Return the random generator for random selection of feature index.
35 36 37 |
# File 'rumale-tree/lib/rumale/tree/extra_tree_classifier.rb', line 35 def rng @rng end |
#tree ⇒ Node (readonly)
Return the learned tree.
31 32 33 |
# File 'rumale-tree/lib/rumale/tree/extra_tree_classifier.rb', line 31 def tree @tree end |