Phpml\SupportVectorMachine\SupportVectorMachine::__construct PHP Method

__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
    public function __construct(int $type, int $kernel, float $cost = 1.0, float $nu = 0.5, int $degree = 3, float $gamma = null, float $coef0 = 0.0, float $epsilon = 0.1, float $tolerance = 0.001, int $cacheSize = 100, bool $shrinking = true, bool $probabilityEstimates = false)
    {
        $this->type = $type;
        $this->kernel = $kernel;
        $this->cost = $cost;
        $this->nu = $nu;
        $this->degree = $degree;
        $this->gamma = $gamma;
        $this->coef0 = $coef0;
        $this->epsilon = $epsilon;
        $this->tolerance = $tolerance;
        $this->cacheSize = $cacheSize;
        $this->shrinking = $shrinking;
        $this->probabilityEstimates = $probabilityEstimates;
        $rootPath = realpath(implode(DIRECTORY_SEPARATOR, [dirname(__FILE__), '..', '..', '..'])) . DIRECTORY_SEPARATOR;
        $this->binPath = $rootPath . 'bin' . DIRECTORY_SEPARATOR . 'libsvm' . DIRECTORY_SEPARATOR;
        $this->varPath = $rootPath . 'var' . DIRECTORY_SEPARATOR;
    }

Usage Example

Example #1
0
 /**
  * @param int        $kernel
  * @param int        $degree
  * @param float      $epsilon
  * @param float      $cost
  * @param float|null $gamma
  * @param float      $coef0
  * @param float      $tolerance
  * @param int        $cacheSize
  * @param bool       $shrinking
  */
 public function __construct(int $kernel = Kernel::RBF, int $degree = 3, float $epsilon = 0.1, float $cost = 1.0, float $gamma = null, float $coef0 = 0.0, float $tolerance = 0.001, int $cacheSize = 100, bool $shrinking = true)
 {
     parent::__construct(Type::EPSILON_SVR, $kernel, $cost, 0.5, $degree, $gamma, $coef0, $epsilon, $tolerance, $cacheSize, $shrinking, false);
 }
All Usage Examples Of Phpml\SupportVectorMachine\SupportVectorMachine::__construct