PHP Class Phpml\SupportVectorMachine\SupportVectorMachine

Mostra file Open project: php-ai/php-ml Class Usage Examples

Public Methods

Method Description
__construct ( integer $type, integer $kernel, float $cost = 1, float $nu = 0.5, integer $degree = 3, float $gamma = null, float $coef0, float $epsilon = 0.1, float $tolerance = 0.001, integer $cacheSize = 100, boolean $shrinking = true, boolean $probabilityEstimates = false )
getModel ( ) : string
predict ( array $samples ) : array
train ( array $samples, array $labels )

Private Methods

Method Description
buildTrainCommand ( string $trainingSetFileName, string $modelFileName ) : string
getOSExtension ( ) : string

Method Details

__construct() public method

public __construct ( integer $type, integer $kernel, float $cost = 1, float $nu = 0.5, integer $degree = 3, float $gamma = null, float $coef0, float $epsilon = 0.1, float $tolerance = 0.001, integer $cacheSize = 100, boolean $shrinking = true, boolean $probabilityEstimates = false )
$type integer
$kernel integer
$cost float
$nu float
$degree integer
$gamma float
$coef0 float
$epsilon float
$tolerance float
$cacheSize integer
$shrinking boolean
$probabilityEstimates boolean

getModel() public method

public getModel ( ) : string
return string

predict() public method

public predict ( array $samples ) : array
$samples array
return array

train() public method

public train ( array $samples, array $labels )
$samples array
$labels array