| 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 | * @var string |
||
| 37 | */ |
||
| 38 | private $binPath; |
||
|
|
|||
| 39 | |||
| 40 | /** |
||
| 41 | * @param Kernel $kernel |
||
| 42 | * @param float $C |
||
| 43 | * @param float $tolerance |
||
| 44 | * @param int $upperBound |
||
| 45 | */ |
||
| 46 | public function __construct(Kernel $kernel = null, float $C = 1.0, float $tolerance = .001, int $upperBound = 100) |
||
| 57 | |||
| 58 | /** |
||
| 59 | * @param array $samples |
||
| 60 | * @param array $labels |
||
| 61 | */ |
||
| 62 | public function train(array $samples, array $labels) |
||
| 67 | |||
| 68 | /** |
||
| 69 | * @param array $sample |
||
| 70 | * |
||
| 71 | * @return mixed |
||
| 72 | */ |
||
| 73 | protected function predictSample(array $sample) |
||
| 76 | } |
||
| 77 |
This check marks private properties in classes that are never used. Those properties can be removed.