1<span style="float:right;"><a href="https://github.com/RubixML/ML/blob/master/src/BootstrapAggregator.php">[source]</a></span>
2
3# Bootstrap Aggregator
4Bootstrap Aggregating (or *bagging* for short) is a model averaging technique designed to improve the stability and performance of a user-specified base estimator by training a number of them on a unique *bootstrapped* training set sampled at random with replacement. Bagging works especially well with estimators that tend to have high prediction variance by reducing the variance through averaging.
5
6**Interfaces:** [Estimator](estimator.md), [Learner](learner.md), [Parallel](parallel.md), [Persistable](persistable.md)
7
8**Data Type Compatibility:** Depends on base learner
9
10## Parameters
11| # | Name | Default | Type | Description |
12|---|---|---|---|---|
13| 1 | base | | Learner | The base learner. |
14| 2 | estimators | 10 | int | The number of base learners to train in the ensemble. |
15| 3 | ratio | 0.5 | float | The ratio of samples from the training set to randomly subsample to train each base learner. |
16
17## Example
18```php
19use Rubix\ML\BootstrapAggregator;
20use Rubix\ML\Regressors\RegressionTree;
21
22$estimator = new BootstrapAggregator(new RegressionTree(10), 300, 0.2);
23```
24
25## Additional Methods
26This meta estimator does not have any additional methods.
27
28## References
29[^1]: L. Breiman. (1996). Bagging Predictors.