@@ -188,7 +188,7 @@ discard block |
||
188 | 188 | * The gradient of the cost function to be used with gradient descent: |
189 | 189 | * ∇J(x) = -(y - h(x)) = (h(x) - y) |
190 | 190 | */ |
191 | - return function ($weights, $sample, $y) use ($penalty): array { |
|
191 | + return function($weights, $sample, $y) use ($penalty): array { |
|
192 | 192 | $this->weights = $weights; |
193 | 193 | $hX = $this->output($sample); |
194 | 194 | |
@@ -220,7 +220,7 @@ discard block |
||
220 | 220 | * The gradient of the cost function: |
221 | 221 | * ∇J(x) = -(h(x) - y) . h(x) . (1 - h(x)) |
222 | 222 | */ |
223 | - return function ($weights, $sample, $y) use ($penalty): array { |
|
223 | + return function($weights, $sample, $y) use ($penalty): array { |
|
224 | 224 | $this->weights = $weights; |
225 | 225 | $hX = $this->output($sample); |
226 | 226 |
@@ -121,7 +121,7 @@ |
||
121 | 121 | |
122 | 122 | protected function splitImpurity(array $groups): float |
123 | 123 | { |
124 | - $samplesCount = (int) array_sum(array_map(static function (array $group): int { |
|
124 | + $samplesCount = (int) array_sum(array_map(static function(array $group): int { |
|
125 | 125 | return count($group[0]); |
126 | 126 | }, $groups)); |
127 | 127 |