PHP Class MCordingley\Regression\Algorithm\GradientDescent\Gradient\Regularized

Inheritance: implements MCordingley\Regression\Algorithm\GradientDescent\Gradient\Gradient
Afficher le fichier Open project: mcordingley/regression Class Usage Examples

Méthodes publiques

Méthode Description
__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.

Method Details

__construct() public méthode

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

cost() public méthode

public cost ( array $coefficients, array $features, float $outcome ) : float
$coefficients array
$features array
$outcome float
Résultat float

gradient() public méthode

public gradient ( array $coefficients, array $features, float $outcome ) : array
$coefficients array
$features array
$outcome float
Résultat array

ignoreFirstFeature() public méthode

Ignore the first feature when regularizing, as that is usually the bias (or intercept) term.
public ignoreFirstFeature ( boolean $ignoreFirst = true ) : self
$ignoreFirst boolean
Résultat self

setLambda() public méthode

Sets the regularization cost parameter. Default value is 1.0
public setLambda ( float $lambda ) : self
$lambda float
Résultat self

setLevel() public méthode

Sets regularization level. e.g. L1 and L2. The default value is 2.
public setLevel ( integer $level ) : self
$level integer
Résultat self