Completed
Pull Request — master (#273)
by Tomáš
20:42
created
src/DimensionReduction/LDA.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -157,7 +157,7 @@
 block discarded – undo
157 157
 
158 158
         // Calculate overall mean of the dataset for each column
159 159
         $numElements = array_sum($counts);
160
-        $map = function ($el) use ($numElements) {
160
+        $map = function($el) use ($numElements) {
161 161
             return $el / $numElements;
162 162
         };
163 163
         $this->overallMean = array_map($map, $overallMean);
Please login to merge, or discard this patch.
src/Clustering/FuzzyCMeans.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -143,7 +143,7 @@
 block discarded – undo
143 143
                 $total += $val;
144 144
             }
145 145
 
146
-            $this->membership[] = array_map(function ($val) use ($total) {
146
+            $this->membership[] = array_map(function($val) use ($total) {
147 147
                 return $val / $total;
148 148
             }, $row);
149 149
         }
Please login to merge, or discard this patch.
src/FeatureSelection/VarianceThreshold.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@
 block discarded – undo
37 37
 
38 38
     public function fit(array $samples, ?array $targets = null): void
39 39
     {
40
-        $this->variances = array_map(function (array $column) {
40
+        $this->variances = array_map(function(array $column) {
41 41
             return Variance::population($column);
42 42
         }, Matrix::transposeArray($samples));
43 43
 
Please login to merge, or discard this patch.
src/FeatureSelection/ScoringFunction/UnivariateLinearRegression.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -52,7 +52,7 @@
 block discarded – undo
52 52
 
53 53
         $degreesOfFreedom = count($targets) - ($this->center ? 2 : 1);
54 54
 
55
-        return array_map(function (float $correlation) use ($degreesOfFreedom): float {
55
+        return array_map(function(float $correlation) use ($degreesOfFreedom): float {
56 56
             return $correlation ** 2 / (1 - $correlation ** 2) * $degreesOfFreedom;
57 57
         }, $correlations);
58 58
     }
Please login to merge, or discard this patch.
src/Helper/Optimizer/StochasticGD.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -241,7 +241,7 @@
 block discarded – undo
241 241
     {
242 242
         // Check for early stop: No change larger than threshold (default 1e-5)
243 243
         $diff = array_map(
244
-            function ($w1, $w2) {
244
+            function($w1, $w2) {
245 245
                 return abs($w1 - $w2) > $this->threshold ? 1 : 0;
246 246
             },
247 247
             $oldTheta,
Please login to merge, or discard this patch.