Passed
Pull Request — master (#311)
by
unknown
08:02
created
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.
src/Classification/NaiveBayes.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -120,7 +120,7 @@  discard block
 block discarded – undo
120 120
                 $this->dataType[$label][$i] = self::NOMINAL;
121 121
                 $this->discreteProb[$label][$i] = array_count_values($values);
122 122
                 $db = &$this->discreteProb[$label][$i];
123
-                $db = array_map(function ($el) use ($numValues) {
123
+                $db = array_map(function($el) use ($numValues) {
124 124
                     return $el / $numValues;
125 125
                 }, $db);
126 126
             } else {
@@ -136,7 +136,7 @@  discard block
 block discarded – undo
136 136
      */
137 137
     private function sampleProbability(array $sample, int $feature, string $label): float
138 138
     {
139
-        $value = (isset($sample[$feature]))? $sample[$feature] : null;
139
+        $value = (isset($sample[$feature])) ? $sample[$feature] : null;
140 140
         if ($this->dataType[$label][$feature] == self::NOMINAL) {
141 141
             if (!isset($this->discreteProb[$label][$feature][$value]) ||
142 142
                 $this->discreteProb[$label][$feature][$value] == 0) {
Please login to merge, or discard this patch.