|
| __construct (int $numClassifier=50) |
| Creates an ensemble classifier with given number of base classifiers Default number of base classifiers is 50.
|
|
| predict (array $samples) |
|
| setClassifer (string $classifier, array $classifierOptions=[]) |
| This method is used to set the base classifier.
|
|
| setSubsetRatio (float $ratio) |
| This method determines the ratio of samples used to create the 'bootstrap' subset, e.g., random samples drawn from the original dataset with replacement (allow repeats), to train each base classifier.
|
|
| train (array $samples, array $targets) |
|
|
string | $classifier = DecisionTree::class |
|
array | $classifierOptions = ['maxDepth' => 20] |
|
array | $classifiers = [] |
|
int | $featureCount = 0 |
|
int | $numClassifier |
|
int | $numSamples |
|
float | $subsetRatio = 0.7 |
|
◆ __construct()
Phpml\Classification\Ensemble\Bagging::__construct |
( |
int | $numClassifier = 50 | ) |
|
Creates an ensemble classifier with given number of base classifiers Default number of base classifiers is 50.
The more number of base classifiers, the better performance but at the cost of procesing time
Reimplemented in Phpml\Classification\Ensemble\RandomForest.
◆ initSingleClassifier()
Phpml\Classification\Ensemble\Bagging::initSingleClassifier |
( |
Classifier | $classifier | ) |
|
|
protected |
◆ predict()
Phpml\Estimator::predict |
( |
array | $samples | ) |
|
|
inherited |
◆ predictSample()
Phpml\Classification\Ensemble\Bagging::predictSample |
( |
array | $sample | ) |
|
|
protected |
◆ setClassifer()
Phpml\Classification\Ensemble\Bagging::setClassifer |
( |
string | $classifier, |
|
|
array | $classifierOptions = [] ) |
This method is used to set the base classifier.
Default value is DecisionTree\class, but any class that implements the Classifier can be used.
While giving the parameters of the classifier, the values should be given in the order they are in the constructor of the classifier and parameter names are neglected.
- Return values
-
Reimplemented in Phpml\Classification\Ensemble\RandomForest.
◆ setSubsetRatio()
Phpml\Classification\Ensemble\Bagging::setSubsetRatio |
( |
float | $ratio | ) |
|
This method determines the ratio of samples used to create the 'bootstrap' subset, e.g., random samples drawn from the original dataset with replacement (allow repeats), to train each base classifier.
- Return values
-
- Exceptions
-
◆ train()
Phpml\Classification\Ensemble\Bagging::train |
( |
array | $samples, |
|
|
array | $targets ) |
The documentation for this class was generated from the following file:
- lib/mlbackend/php/phpml/src/Phpml/Classification/Ensemble/Bagging.php