@@ -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\Helper\Optimizer; |
| 6 | 6 | |
@@ -240,7 +240,7 @@ discard block |
||
| 240 | 240 | { |
| 241 | 241 | // Check for early stop: No change larger than threshold (default 1e-5) |
| 242 | 242 | $diff = array_map( |
| 243 | - function ($w1, $w2) { |
|
| 243 | + function($w1, $w2) { |
|
| 244 | 244 | return abs($w1 - $w2) > $this->threshold ? 1 : 0; |
| 245 | 245 | }, |
| 246 | 246 | $oldTheta, |
@@ -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\Helper\Optimizer; |
| 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\Clustering; |
| 6 | 6 | |
@@ -101,7 +101,7 @@ discard block |
||
| 101 | 101 | $total += $val; |
| 102 | 102 | } |
| 103 | 103 | |
| 104 | - $this->membership[] = array_map(function ($val) use ($total) { |
|
| 104 | + $this->membership[] = array_map(function($val) use ($total) { |
|
| 105 | 105 | return $val / $total; |
| 106 | 106 | }, $row); |
| 107 | 107 | } |
@@ -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\Classification\Ensemble; |
| 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\Classification\Ensemble; |
| 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\Classification\Linear; |
| 6 | 6 | |
@@ -64,7 +64,7 @@ discard block |
||
| 64 | 64 | protected function runTraining(array $samples, array $targets) |
| 65 | 65 | { |
| 66 | 66 | // The cost function is the sum of squares |
| 67 | - $callback = function ($weights, $sample, $target) { |
|
| 67 | + $callback = function($weights, $sample, $target) { |
|
| 68 | 68 | $this->weights = $weights; |
| 69 | 69 | |
| 70 | 70 | $output = $this->output($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\Classification\Linear; |
| 6 | 6 | |
@@ -193,7 +193,7 @@ discard block |
||
| 193 | 193 | * The gradient of the cost function to be used with gradient descent: |
| 194 | 194 | * ∇J(x) = -(y - h(x)) = (h(x) - y) |
| 195 | 195 | */ |
| 196 | - $callback = function ($weights, $sample, $y) use ($penalty) { |
|
| 196 | + $callback = function($weights, $sample, $y) use ($penalty) { |
|
| 197 | 197 | $this->weights = $weights; |
| 198 | 198 | $hX = $this->output($sample); |
| 199 | 199 | |
@@ -224,7 +224,7 @@ discard block |
||
| 224 | 224 | * The gradient of the cost function: |
| 225 | 225 | * ∇J(x) = -(h(x) - y) . h(x) . (1 - h(x)) |
| 226 | 226 | */ |
| 227 | - $callback = function ($weights, $sample, $y) use ($penalty) { |
|
| 227 | + $callback = function($weights, $sample, $y) use ($penalty) { |
|
| 228 | 228 | $this->weights = $weights; |
| 229 | 229 | $hX = $this->output($sample); |
| 230 | 230 | |
@@ -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\DimensionReduction; |
| 6 | 6 | |
@@ -146,7 +146,7 @@ discard block |
||
| 146 | 146 | |
| 147 | 147 | // Calculate overall mean of the dataset for each column |
| 148 | 148 | $numElements = array_sum($counts); |
| 149 | - $map = function ($el) use ($numElements) { |
|
| 149 | + $map = function($el) use ($numElements) { |
|
| 150 | 150 | return $el / $numElements; |
| 151 | 151 | }; |
| 152 | 152 | $this->overallMean = array_map($map, $overallMean); |
@@ -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\DimensionReduction; |
| 6 | 6 | |