Class: Rumale::Tree::VRTreeRegressor
- Inherits:
-
DecisionTreeRegressor
- Object
- Base::Estimator
- BaseDecisionTree
- DecisionTreeRegressor
- Rumale::Tree::VRTreeRegressor
- Defined in:
- rumale-tree/lib/rumale/tree/vr_tree_regressor.rb
Overview
VRTreeRegressor is a class that implements Variable-Random (VR) tree for regression.
Reference
-
Liu, F. T., Ting, K. M., Yu, Y., and Zhou, Z. H., “Spectrum of Variable-Random Trees,” Journal of Artificial Intelligence Research, vol. 32, pp. 355–384, 2008.
Instance Attribute Summary collapse
-
#feature_importances ⇒ Numo::DFloat
readonly
Return the importance for each feature.
-
#leaf_values ⇒ Numo::DFloat
readonly
Return the values 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: 'mse', alpha: 0.5, max_depth: nil, max_leaf_nodes: nil, min_samples_leaf: 1, max_features: nil, random_seed: nil) ⇒ VRTreeRegressor
constructor
Create a new regressor with variable-random tree algorithm.
Methods inherited from DecisionTreeRegressor
Methods included from Base::Regressor
Methods inherited from BaseDecisionTree
Constructor Details
#initialize(criterion: 'mse', alpha: 0.5, max_depth: nil, max_leaf_nodes: nil, min_samples_leaf: 1, max_features: nil, random_seed: nil) ⇒ VRTreeRegressor
Create a new regressor with variable-random tree algorithm.
51 52 53 54 55 56 |
# File 'rumale-tree/lib/rumale/tree/vr_tree_regressor.rb', line 51 def initialize(criterion: 'mse', alpha: 0.5, max_depth: nil, max_leaf_nodes: nil, min_samples_leaf: 1, max_features: nil, random_seed: nil) super(criterion: criterion, max_depth: max_depth, max_leaf_nodes: max_leaf_nodes, min_samples_leaf: min_samples_leaf, max_features: max_features, random_seed: random_seed) @params[:alpha] = alpha.clamp(0.0, 1.0) end |
Instance Attribute Details
#feature_importances ⇒ Numo::DFloat (readonly)
Return the importance for each feature.
23 24 25 |
# File 'rumale-tree/lib/rumale/tree/vr_tree_regressor.rb', line 23 def feature_importances @feature_importances end |
#leaf_values ⇒ Numo::DFloat (readonly)
Return the values assigned each leaf.
35 36 37 |
# File 'rumale-tree/lib/rumale/tree/vr_tree_regressor.rb', line 35 def leaf_values @leaf_values end |
#rng ⇒ Random (readonly)
Return the random generator for random selection of feature index.
31 32 33 |
# File 'rumale-tree/lib/rumale/tree/vr_tree_regressor.rb', line 31 def rng @rng end |
#tree ⇒ Node (readonly)
Return the learned tree.
27 28 29 |
# File 'rumale-tree/lib/rumale/tree/vr_tree_regressor.rb', line 27 def tree @tree end |