@@ -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 | { |
@@ -138,8 +138,8 @@ |
||
| 138 | 138 | } |
| 139 | 139 | |
| 140 | 140 | /** |
| 141 | - * @param array $newCoordinates |
|
| 142 | - */ |
|
| 141 | + * @param array $newCoordinates |
|
| 142 | + */ |
|
| 143 | 143 | public function setCoordinates(array $newCoordinates) |
| 144 | 144 | { |
| 145 | 145 | $this->coordinates = $newCoordinates; |
@@ -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 @@ 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); |
@@ -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 | |
@@ -32,7 +32,7 @@ discard block |
||
| 32 | 32 | |
| 33 | 33 | $count = count($samples); |
| 34 | 34 | foreach ($this->idf as &$value) { |
| 35 | - $value = log((float)($count / $value), 10.0); |
|
| 35 | + $value = log((float) ($count / $value), 10.0); |
|
| 36 | 36 | } |
| 37 | 37 | } |
| 38 | 38 | |
@@ -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; |
| 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\Exception; |
| 6 | 6 | |