Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.10.x will end 8 November 2021 (12 months).
  • Bug fixes for security issues in 3.10.x will end 9 May 2022 (18 months).
  • PHP version: minimum PHP 7.2.0 Note: minimum PHP version has increased since Moodle 3.8. PHP 7.3.x and 7.4.x are supported too.

(no description)

File Size: 252 lines (7 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

AdaBoost:: (9 methods):
  __construct()
  setBaseClassifier()
  train()
  predictSample()
  getBestClassifier()
  resample()
  evaluateClassifier()
  calculateAlpha()
  updateWeights()


Class: AdaBoost  - X-Ref

__construct(int $maxIterations = 50)   X-Ref
ADAptive BOOSTing (AdaBoost) is an ensemble algorithm to
improve classification performance of 'weak' classifiers such as
DecisionStump (default base classifier of AdaBoost).


setBaseClassifier(string $baseClassifier = DecisionStump::class, array $classifierOptions = [])   X-Ref
Sets the base classifier that will be used for boosting (default = DecisionStump)


train(array $samples, array $targets)   X-Ref


predictSample(array $sample)   X-Ref

return: mixed

getBestClassifier()   X-Ref
Returns the classifier with the lowest error rate with the
consideration of current sample weights


resample()   X-Ref
Resamples the dataset in accordance with the weights and
returns the new dataset


evaluateClassifier(Classifier $classifier)   X-Ref
Evaluates the classifier and returns the classification error rate


calculateAlpha(float $errorRate)   X-Ref
Calculates alpha of a classifier


updateWeights(Classifier $classifier, float $alpha)   X-Ref
Updates the sample weights