1 | <?php declare(strict_types=1); |
||
14 | abstract class EigenTransformerBase |
||
15 | { |
||
16 | /** |
||
17 | * Total variance to be conserved after the reduction |
||
18 | * |
||
19 | * @var float |
||
20 | */ |
||
21 | public $totalVariance = 0.9; |
||
22 | |||
23 | /** |
||
24 | * Number of features to be preserved after the reduction |
||
25 | * |
||
26 | * @var int |
||
27 | */ |
||
28 | public $numFeatures = null; |
||
29 | |||
30 | /** |
||
31 | * Top eigenvectors of the matrix |
||
32 | * |
||
33 | * @var array |
||
34 | */ |
||
35 | protected $eigVectors = []; |
||
36 | |||
37 | /** |
||
38 | * Top eigenValues of the matrix |
||
39 | * |
||
40 | * @var type |
||
41 | */ |
||
42 | protected $eigValues = []; |
||
43 | |||
44 | /** |
||
45 | * Calculates eigenValues and eigenVectors of the given matrix. Returns |
||
46 | * top eigenVectors along with the largest eigenValues. The total explained variance |
||
47 | * of these eigenVectors will be no less than desired $totalVariance value |
||
48 | * |
||
49 | * @param array $matrix |
||
50 | */ |
||
51 | protected function eigenDecomposition(array $matrix) |
||
83 | |||
84 | /** |
||
85 | * Returns the reduced data |
||
86 | * |
||
87 | * @param array $data |
||
88 | * |
||
89 | * @return array |
||
90 | */ |
||
91 | protected function reduce(array $data) |
||
98 | } |
||
99 |
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..