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

SupportVectorMachine   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 48
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 2
c 2
b 0
f 0
lcom 0
cbo 2
dl 0
loc 48
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 7 1
A predictSample() 0 3 1
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