| 1 | <?php |
||
| 11 | class SupportVectorMachine implements Classifier |
||
| 12 | { |
||
| 13 | use Trainable, Predictable; |
||
| 14 | |||
| 15 | /** |
||
| 16 | * @var Kernel |
||
| 17 | */ |
||
| 18 | private $kernel; |
||
| 19 | |||
| 20 | /** |
||
| 21 | * @var float |
||
| 22 | */ |
||
| 23 | private $C; |
||
| 24 | |||
| 25 | /** |
||
| 26 | * @var float |
||
| 27 | */ |
||
| 28 | private $tolerance; |
||
| 29 | |||
| 30 | /** |
||
| 31 | * @var int |
||
| 32 | */ |
||
| 33 | private $upperBound; |
||
| 34 | |||
| 35 | /** |
||
| 36 | * @param Kernel $kernel |
||
| 37 | * @param float $C |
||
| 38 | * @param float $tolerance |
||
| 39 | * @param int $upperBound |
||
| 40 | */ |
||
| 41 | public function __construct(Kernel $kernel = null, float $C = 1.0, float $tolerance = .001, int $upperBound = 100) |
||
| 52 | |||
| 53 | /** |
||
| 54 | * @param array $sample |
||
| 55 | * |
||
| 56 | * @return mixed |
||
| 57 | */ |
||
| 58 | protected function predictSample(array $sample) |
||
| 61 | } |
||
| 62 |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.