PHP Класс MCordingley\Regression\Algorithm\GradientDescent\Gradient\Regularized

Наследование: implements MCordingley\Regression\Algorithm\GradientDescent\Gradient\Gradient
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
__construct ( MCordingley\Regression\Algorithm\GradientDescent\Gradient\Gradient $gradient )
cost ( array $coefficients, array $features, float $outcome ) : float
gradient ( array $coefficients, array $features, float $outcome ) : array
ignoreFirstFeature ( boolean $ignoreFirst = true ) : self Ignore the first feature when regularizing, as that is usually the bias (or intercept) term.
setLambda ( float $lambda ) : self Sets the regularization cost parameter. Default value is 1.0
setLevel ( integer $level ) : self Sets regularization level. e.g. L1 and L2. The default value is 2.

Описание методов

__construct() публичный Метод

public __construct ( MCordingley\Regression\Algorithm\GradientDescent\Gradient\Gradient $gradient )
$gradient MCordingley\Regression\Algorithm\GradientDescent\Gradient\Gradient

cost() публичный Метод

public cost ( array $coefficients, array $features, float $outcome ) : float
$coefficients array
$features array
$outcome float
Результат float

gradient() публичный Метод

public gradient ( array $coefficients, array $features, float $outcome ) : array
$coefficients array
$features array
$outcome float
Результат array

ignoreFirstFeature() публичный Метод

Ignore the first feature when regularizing, as that is usually the bias (or intercept) term.
public ignoreFirstFeature ( boolean $ignoreFirst = true ) : self
$ignoreFirst boolean
Результат self

setLambda() публичный Метод

Sets the regularization cost parameter. Default value is 1.0
public setLambda ( float $lambda ) : self
$lambda float
Результат self

setLevel() публичный Метод

Sets regularization level. e.g. L1 and L2. The default value is 2.
public setLevel ( integer $level ) : self
$level integer
Результат self