Class: HybridForest::Forests::ForestGrowers::CARTGrower
- Inherits:
-
Object
- Object
- HybridForest::Forests::ForestGrowers::CARTGrower
- Defined in:
- lib/hybridforest/forests/forest_growers/cart_grower.rb
Instance Method Summary collapse
Instance Method Details
#grow_forest(instances, number_of_trees) ⇒ Object
8 9 10 11 12 13 14 15 |
# File 'lib/hybridforest/forests/forest_growers/cart_grower.rb', line 8 def grow_forest(instances, number_of_trees) forest = [] number_of_trees.times do sample = HybridForest::Utils.random_sample(data: instances, size: instances.size) forest << HybridForest::Trees::CARTTree.new.fit(sample) end forest end |