|
| __construct (float $learningRate=0.001, int $maxIterations=1000, bool $normalizeInputs=true, int $trainingType=self::BATCH_TRAINING) |
| Initalize an Adaline (ADAptive LInear NEuron) classifier with given learning rate and maximum number of iterations used while training the classifier
|
|
| getCostValues () |
| Returns the cost values obtained during the training.
|
|
| partialTrain (array $samples, array $targets, array $labels=[]) |
|
| predict (array $samples) |
|
| setEarlyStop (bool $enable=true) |
| Normally enabling early stopping for the optimization procedure may help saving processing time while in some cases it may result in premature convergence.
|
|
| train (array $samples, array $targets) |
|
| trainBinary (array $samples, array $targets, array $labels) |
|
|
const | BATCH_TRAINING = 1 |
|
const | ONLINE_TRAINING = 2 |
| Online training: Stochastic gradient descent learning.
|
|
|
| checkNormalizedSample (array $sample) |
| Checks if the sample should be normalized and if so, returns the normalized sample.
|
|
| output (array $sample) |
| Calculates net output of the network as a float value for the given input.
|
|
| outputClass (array $sample) |
| Returns the class value (either -1 or 1) for the given input.
|
|
| predictProbability (array $sample, $label) |
| Returns the probability of the sample of belonging to the given label.
|
|
| predictSampleBinary (array $sample) |
|
| resetBinary () |
|
| runGradientDescent (array $samples, array $targets, Closure $gradientFunc, bool $isBatch=false) |
| Executes a Gradient Descent algorithm for the given cost function.
|
|
| runTraining (array $samples, array $targets) |
| Adapts the weights with respect to given samples and targets by use of gradient descent learning rule.
|
|
|
bool | $enableEarlyStop = true |
|
int | $featureCount = 0 |
|
array | $labels = [] |
|
float | $learningRate |
|
int | $maxIterations |
|
Normalizer | $normalizer |
|
Optimizer GD StochasticGD null | $optimizer |
|
string int | $trainingType |
| Training type may be either 'Batch' or 'Online' learning.
|
|
array | $weights = [] |
|
◆ __construct()
Phpml\Classification\Linear\Adaline::__construct |
( |
float | $learningRate = 0.001, |
|
|
int | $maxIterations = 1000, |
|
|
bool | $normalizeInputs = true, |
|
|
int | $trainingType = self::BATCH_TRAINING ) |
Initalize an Adaline (ADAptive LInear NEuron) classifier with given learning rate and maximum number of iterations used while training the classifier
Learning rate should be a float value between 0.0(exclusive) and 1.0 (inclusive)
Maximum number of iterations can be an integer value greater than 0
If normalizeInputs is set to true, then every input given to the algorithm will be standardized by use of standard deviation and mean calculation
- Exceptions
-
◆ output()
Phpml\Classification\Linear\Perceptron::output |
( |
array | $sample | ) |
|
|
protectedinherited |
Calculates net output of the network as a float value for the given input.
- Return values
-
◆ partialTrain()
Phpml\Classification\Linear\Perceptron::partialTrain |
( |
array | $samples, |
|
|
array | $targets, |
|
|
array | $labels = [] ) |
|
inherited |
◆ predict()
Phpml\Estimator::predict |
( |
array | $samples | ) |
|
|
inherited |
◆ predictProbability()
Phpml\Classification\Linear\Perceptron::predictProbability |
( |
array | $sample, |
|
|
| $label ) |
|
protectedinherited |
Returns the probability of the sample of belonging to the given label.
The probability is simply taken as the distance of the sample to the decision plane.
- Parameters
-
◆ predictSampleBinary()
Phpml\Classification\Linear\Perceptron::predictSampleBinary |
( |
array | $sample | ) |
|
|
protectedinherited |
◆ runTraining()
Phpml\Classification\Linear\Adaline::runTraining |
( |
array | $samples, |
|
|
array | $targets ) |
|
protected |
◆ setEarlyStop()
Phpml\Classification\Linear\Perceptron::setEarlyStop |
( |
bool | $enable = true | ) |
|
|
inherited |
Normally enabling early stopping for the optimization procedure may help saving processing time while in some cases it may result in premature convergence.
If "false" is given, the optimization procedure will always be executed for $maxIterations times
- Return values
-
◆ train()
Phpml\Estimator::train |
( |
array | $samples, |
|
|
array | $targets ) |
|
inherited |
The documentation for this class was generated from the following file:
- lib/mlbackend/php/phpml/src/Phpml/Classification/Linear/Adaline.php