@@ -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 | |
@@ -103,11 +103,11 @@ discard block |
||
| 103 | 103 | */ |
| 104 | 104 | protected function predictSample(array $sample): array |
| 105 | 105 | { |
| 106 | - $predicts = array_values(array_filter($this->getRules(), function ($rule) use ($sample) { |
|
| 106 | + $predicts = array_values(array_filter($this->getRules(), function($rule) use ($sample) { |
|
| 107 | 107 | return $this->equals($rule[self::ARRAY_KEY_ANTECEDENT], $sample); |
| 108 | 108 | })); |
| 109 | 109 | |
| 110 | - return array_map(function ($rule) { |
|
| 110 | + return array_map(function($rule) { |
|
| 111 | 111 | return $rule[self::ARRAY_KEY_CONSEQUENT]; |
| 112 | 112 | }, $predicts); |
| 113 | 113 | } |
@@ -176,7 +176,7 @@ discard block |
||
| 176 | 176 | $cardinality = count($sample); |
| 177 | 177 | $antecedents = $this->powerSet($sample); |
| 178 | 178 | |
| 179 | - return array_filter($antecedents, function ($antecedent) use ($cardinality) { |
|
| 179 | + return array_filter($antecedents, function($antecedent) use ($cardinality) { |
|
| 180 | 180 | return (count($antecedent) != $cardinality) && ($antecedent != []); |
| 181 | 181 | }); |
| 182 | 182 | } |
@@ -198,7 +198,7 @@ discard block |
||
| 198 | 198 | } |
| 199 | 199 | } |
| 200 | 200 | |
| 201 | - return array_map(function ($entry) { |
|
| 201 | + return array_map(function($entry) { |
|
| 202 | 202 | return [$entry]; |
| 203 | 203 | }, $items); |
| 204 | 204 | } |
@@ -212,7 +212,7 @@ discard block |
||
| 212 | 212 | */ |
| 213 | 213 | private function frequent(array $samples): array |
| 214 | 214 | { |
| 215 | - return array_values(array_filter($samples, function ($entry) { |
|
| 215 | + return array_values(array_filter($samples, function($entry) { |
|
| 216 | 216 | return $this->support($entry) >= $this->support; |
| 217 | 217 | })); |
| 218 | 218 | } |
@@ -287,7 +287,7 @@ discard block |
||
| 287 | 287 | */ |
| 288 | 288 | private function frequency(array $sample): int |
| 289 | 289 | { |
| 290 | - return count(array_filter($this->samples, function ($entry) use ($sample) { |
|
| 290 | + return count(array_filter($this->samples, function($entry) use ($sample) { |
|
| 291 | 291 | return $this->subset($entry, $sample); |
| 292 | 292 | })); |
| 293 | 293 | } |
@@ -302,7 +302,7 @@ discard block |
||
| 302 | 302 | */ |
| 303 | 303 | private function contains(array $system, array $set): bool |
| 304 | 304 | { |
| 305 | - return (bool) array_filter($system, function ($entry) use ($set) { |
|
| 305 | + return (bool) array_filter($system, function($entry) use ($set) { |
|
| 306 | 306 | return $this->equals($entry, $set); |
| 307 | 307 | }); |
| 308 | 308 | } |