Completed
Push — develop ( 6024b1...933078 )
by Arkadiusz
02:29
created

SupportVectorMachine::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 7
rs 9.4285
cc 1
eloc 5
nc 1
nop 4
1
<?php
2
3
declare (strict_types = 1);
4
5
namespace Phpml\Classifier;
6
7
use Phpml\Classifier\Traits\Predictable;
8
use Phpml\Classifier\Traits\Trainable;
9
10
class SupportVectorMachine implements Classifier
11
{
12
    use Trainable, Predictable;
13
14
    /**
15
     * @var float
16
     */
17
    private $gamma;
18
19
    /**
20
     * @var float
21
     */
22
    private $epsilon;
23
24
    /**
25
     * @var float
26
     */
27
    private $tolerance;
28
29
    /**
30
     * @var int
31
     */
32
    private $upperBound;
33
34
    /**
35
     * @param float $gamma
36
     * @param float $epsilon
37
     * @param float $tolerance
38
     * @param int $upperBound
39
     */
40
    public function __construct(float $gamma = .5, float $epsilon = .001, float $tolerance = .001, int $upperBound = 100)
41
    {
42
        $this->gamma = $gamma;
43
        $this->epsilon = $epsilon;
44
        $this->tolerance = $tolerance;
45
        $this->upperBound = $upperBound;
46
    }
47
48
49
    /**
50
     * @param array $sample
51
     *
52
     * @return mixed
53
     */
54
    protected function predictSample(array $sample)
0 ignored issues
show
Unused Code introduced by
The parameter $sample is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
55
    {
56
    }
57
}
58