Passed
Pull Request — master (#169)
by Yuji
02:36
created
src/Phpml/Classification/Linear/DecisionStump.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@
 block discarded – undo
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
 
Please login to merge, or discard this patch.
src/Phpml/Classification/WeightedClassifier.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@
 block discarded – undo
1 1
 <?php
2 2
 
3
-declare(strict_types=1);
3
+declare(strict_types = 1);
4 4
 
5 5
 namespace Phpml\Classification;
6 6
 
Please login to merge, or discard this patch.
src/Phpml/Helper/OneVsRest.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@
 block discarded – undo
1 1
 <?php
2 2
 
3
-declare(strict_types=1);
3
+declare(strict_types = 1);
4 4
 
5 5
 namespace Phpml\Helper;
6 6
 
Please login to merge, or discard this patch.
src/Phpml/IncrementalEstimator.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@
 block discarded – undo
1 1
 <?php
2 2
 
3
-declare(strict_types=1);
3
+declare(strict_types = 1);
4 4
 
5 5
 namespace Phpml;
6 6
 
Please login to merge, or discard this patch.
src/Phpml/DimensionReduction/KernelPCA.php 2 patches
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -136,9 +136,9 @@
 block discarded – undo
136 136
         $N_K_N = $N->multiply($K_N);
137 137
 
138 138
         return $K->subtract($N_K)
139
-                 ->subtract($K_N)
140
-                 ->add($N_K_N)
141
-                 ->toArray();
139
+                    ->subtract($K_N)
140
+                    ->add($N_K_N)
141
+                    ->toArray();
142 142
     }
143 143
 
144 144
     /**
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-declare(strict_types=1);
3
+declare(strict_types = 1);
4 4
 
5 5
 namespace Phpml\DimensionReduction;
6 6
 
@@ -161,20 +161,20 @@  discard block
 block discarded – undo
161 161
         switch ($this->kernel) {
162 162
             case self::KERNEL_LINEAR:
163 163
                 // k(x,y) = xT.y
164
-                return function ($x, $y) {
164
+                return function($x, $y) {
165 165
                     return Matrix::dot($x, $y)[0];
166 166
                 };
167 167
             case self::KERNEL_RBF:
168 168
                 // k(x,y)=exp(-γ.|x-y|) where |..| is Euclidean distance
169 169
                 $dist = new Euclidean();
170 170
 
171
-                return function ($x, $y) use ($dist) {
171
+                return function($x, $y) use ($dist) {
172 172
                     return exp(-$this->gamma * $dist->sqDistance($x, $y));
173 173
                 };
174 174
 
175 175
             case self::KERNEL_SIGMOID:
176 176
                 // k(x,y)=tanh(γ.xT.y+c0) where c0=1
177
-                return function ($x, $y) {
177
+                return function($x, $y) {
178 178
                     $res = Matrix::dot($x, $y)[0] + 1.0;
179 179
 
180 180
                     return tanh($this->gamma * $res);
@@ -184,7 +184,7 @@  discard block
 block discarded – undo
184 184
                 // k(x,y)=exp(-γ.|x-y|) where |..| is Manhattan distance
185 185
                 $dist = new Manhattan();
186 186
 
187
-                return function ($x, $y) use ($dist) {
187
+                return function($x, $y) use ($dist) {
188 188
                     return exp(-$this->gamma * $dist->distance($x, $y));
189 189
                 };
190 190
 
@@ -218,7 +218,7 @@  discard block
 block discarded – undo
218 218
     protected function projectSample(array $pairs): array
219 219
     {
220 220
         // Normalize eigenvectors by eig = eigVectors / eigValues
221
-        $func = function ($eigVal, $eigVect) {
221
+        $func = function($eigVal, $eigVect) {
222 222
             $m = new Matrix($eigVect, false);
223 223
             $a = $m->divideByScalar($eigVal)->toArray();
224 224
 
Please login to merge, or discard this patch.
src/Phpml/DimensionReduction/PCA.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@
 block discarded – undo
1 1
 <?php
2 2
 
3
-declare(strict_types=1);
3
+declare(strict_types = 1);
4 4
 
5 5
 namespace Phpml\DimensionReduction;
6 6
 
Please login to merge, or discard this patch.
src/Phpml/Classification/Linear/Perceptron.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
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
 
@@ -170,7 +170,7 @@  discard block
 block discarded – undo
170 170
     protected function runTraining(array $samples, array $targets)
171 171
     {
172 172
         // The cost function is the sum of squares
173
-        $callback = function ($weights, $sample, $target) {
173
+        $callback = function($weights, $sample, $target) {
174 174
             $this->weights = $weights;
175 175
 
176 176
             $prediction = $this->outputClass($sample);
Please login to merge, or discard this patch.
src/Phpml/Classification/Ensemble/Bagging.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@
 block discarded – undo
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
 
Please login to merge, or discard this patch.
src/Phpml/Helper/Optimizer/ConjugateGradient.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@
 block discarded – undo
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
 
Please login to merge, or discard this patch.