@@ -91,7 +91,7 @@ |
||
91 | 91 | } |
92 | 92 | |
93 | 93 | /** |
94 | - * @param $column |
|
94 | + * @param integer $column |
|
95 | 95 | * |
96 | 96 | * @return array |
97 | 97 | * |
@@ -1,6 +1,6 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types=1); |
|
3 | +declare(strict_types = 1); |
|
4 | 4 | |
5 | 5 | namespace Phpml\Math; |
6 | 6 |
@@ -128,7 +128,7 @@ |
||
128 | 128 | } |
129 | 129 | |
130 | 130 | /** |
131 | - * @return mixed |
|
131 | + * @return integer |
|
132 | 132 | */ |
133 | 133 | public function count() |
134 | 134 | { |
@@ -1,6 +1,6 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types=1); |
|
3 | +declare(strict_types = 1); |
|
4 | 4 | |
5 | 5 | namespace Phpml\Clustering\KMeans; |
6 | 6 |
@@ -17,7 +17,7 @@ discard block |
||
17 | 17 | protected $dimension; |
18 | 18 | |
19 | 19 | /** |
20 | - * @param $dimension |
|
20 | + * @param integer $dimension |
|
21 | 21 | */ |
22 | 22 | public function __construct($dimension) |
23 | 23 | { |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | } |
66 | 66 | |
67 | 67 | /** |
68 | - * @param object $point |
|
68 | + * @param Point $point |
|
69 | 69 | * @param null $data |
70 | 70 | */ |
71 | 71 | public function attach($point, $data = null) |
@@ -225,7 +225,7 @@ discard block |
||
225 | 225 | /** |
226 | 226 | * @param int $clustersNumber |
227 | 227 | * |
228 | - * @return array |
|
228 | + * @return Cluster[] |
|
229 | 229 | */ |
230 | 230 | protected function initializeKMPPClusters(int $clustersNumber) |
231 | 231 | { |
@@ -1,6 +1,6 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types=1); |
|
3 | +declare(strict_types = 1); |
|
4 | 4 | |
5 | 5 | namespace Phpml\Clustering\KMeans; |
6 | 6 |
@@ -1,6 +1,6 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types=1); |
|
3 | +declare(strict_types = 1); |
|
4 | 4 | |
5 | 5 | namespace Phpml; |
6 | 6 |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types=1); |
|
3 | +declare(strict_types = 1); |
|
4 | 4 | |
5 | 5 | namespace Phpml\Association; |
6 | 6 | |
@@ -107,11 +107,11 @@ discard block |
||
107 | 107 | */ |
108 | 108 | protected function predictSample(array $sample) : array |
109 | 109 | { |
110 | - $predicts = array_values(array_filter($this->getRules(), function ($rule) use ($sample) { |
|
110 | + $predicts = array_values(array_filter($this->getRules(), function($rule) use ($sample) { |
|
111 | 111 | return $this->equals($rule[self::ARRAY_KEY_ANTECEDENT], $sample); |
112 | 112 | })); |
113 | 113 | |
114 | - return array_map(function ($rule) { |
|
114 | + return array_map(function($rule) { |
|
115 | 115 | return $rule[self::ARRAY_KEY_CONSEQUENT]; |
116 | 116 | }, $predicts); |
117 | 117 | } |
@@ -179,7 +179,7 @@ discard block |
||
179 | 179 | $cardinality = count($sample); |
180 | 180 | $antecedents = $this->powerSet($sample); |
181 | 181 | |
182 | - return array_filter($antecedents, function ($antecedent) use ($cardinality) { |
|
182 | + return array_filter($antecedents, function($antecedent) use ($cardinality) { |
|
183 | 183 | return (count($antecedent) != $cardinality) && ($antecedent != []); |
184 | 184 | }); |
185 | 185 | } |
@@ -201,7 +201,7 @@ discard block |
||
201 | 201 | } |
202 | 202 | } |
203 | 203 | |
204 | - return array_map(function ($entry) { |
|
204 | + return array_map(function($entry) { |
|
205 | 205 | return [$entry]; |
206 | 206 | }, $items); |
207 | 207 | } |
@@ -215,7 +215,7 @@ discard block |
||
215 | 215 | */ |
216 | 216 | private function frequent(array $samples) : array |
217 | 217 | { |
218 | - return array_filter($samples, function ($entry) { |
|
218 | + return array_filter($samples, function($entry) { |
|
219 | 219 | return $this->support($entry) >= $this->support; |
220 | 220 | }); |
221 | 221 | } |
@@ -295,7 +295,7 @@ discard block |
||
295 | 295 | */ |
296 | 296 | private function frequency(array $sample) : int |
297 | 297 | { |
298 | - return count(array_filter($this->samples, function ($entry) use ($sample) { |
|
298 | + return count(array_filter($this->samples, function($entry) use ($sample) { |
|
299 | 299 | return $this->subset($entry, $sample); |
300 | 300 | })); |
301 | 301 | } |
@@ -312,7 +312,7 @@ discard block |
||
312 | 312 | */ |
313 | 313 | private function contains(array $system, array $set) : bool |
314 | 314 | { |
315 | - return (bool) array_filter($system, function ($entry) use ($set) { |
|
315 | + return (bool) array_filter($system, function($entry) use ($set) { |
|
316 | 316 | return $this->equals($entry, $set); |
317 | 317 | }); |
318 | 318 | } |
@@ -1,6 +1,6 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types=1); |
|
3 | +declare(strict_types = 1); |
|
4 | 4 | |
5 | 5 | namespace Phpml\Association; |
6 | 6 |
@@ -1,6 +1,6 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types=1); |
|
3 | +declare(strict_types = 1); |
|
4 | 4 | |
5 | 5 | namespace Phpml\FeatureExtraction\StopWords; |
6 | 6 |
@@ -1,6 +1,6 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types=1); |
|
3 | +declare(strict_types = 1); |
|
4 | 4 | |
5 | 5 | namespace Phpml\FeatureExtraction\StopWords; |
6 | 6 |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types=1); |
|
3 | +declare(strict_types = 1); |
|
4 | 4 | |
5 | 5 | namespace Phpml\FeatureExtraction; |
6 | 6 | |
@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | /** |
94 | 94 | * @param string $sample |
95 | 95 | */ |
96 | - private function transformSample(string &$sample) |
|
96 | + private function transformSample(string & $sample) |
|
97 | 97 | { |
98 | 98 | $counts = []; |
99 | 99 | $tokens = $this->tokenizer->tokenize($sample); |