@@ -157,7 +157,7 @@ |
||
| 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); |
@@ -143,7 +143,7 @@ |
||
| 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 | } |
@@ -37,7 +37,7 @@ |
||
| 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 | |
@@ -52,7 +52,7 @@ |
||
| 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 | } |
@@ -241,7 +241,7 @@ |
||
| 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, |