PHP 클래스 MCordingley\Regression\Algorithm\GradientDescent\Gradient\Regularized

상속: implements MCordingley\Regression\Algorithm\GradientDescent\Gradient\Gradient
파일 보기 프로젝트 열기: mcordingley/regression 1 사용 예제들

공개 메소드들

메소드 설명
__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