Passed
Push — master ( a5d8ab...4b95bd )
by Ruben
02:09
created
src/CategoricalDataset.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -28,11 +28,11 @@  discard block
 block discarded – undo
28 28
     /*
29 29
      * @param
30 30
      */    
31
-    function setEncodedFeatures($array){
31
+    function setEncodedFeatures($array) {
32 32
         $array = sort($array);
33 33
         $this->encodedValues = [];
34 34
         $this->sortedEncodedFeatures = $array;
35
-        foreach($this->sortedEncodedFeatures as $col){
35
+        foreach ($this->sortedEncodedFeatures as $col) {
36 36
             $vals = $this->getUniqueValues($col);
37 37
             $this->encodedValues[] = $vals;
38 38
             $this->encodedFeatMapSize[$col] = count($vals);
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
     /*
43 43
      * @param
44 44
      */
45
-    function getUniqueValues($col){
45
+    function getUniqueValues($col) {
46 46
         $resp = [];
47 47
         $resp = Matrix::getColumn($data, $col);
48 48
         $resp = array_unique($resp);
@@ -52,19 +52,19 @@  discard block
 block discarded – undo
52 52
     /*
53 53
      * @param
54 54
      */  
55
-    function encode(){
56
-        $transformer  = [];
55
+    function encode() {
56
+        $transformer = [];
57 57
         $ndata = [];
58
-        for ($j=0; $j<$ndim; $j++) {
59
-            $transformer[] = function($val){ return $val; };
58
+        for ($j = 0; $j < $ndim; $j++) {
59
+            $transformer[] = function($val) { return $val; };
60 60
         }
61
-        foreach( as $key => $val) {
61
+        foreach (as $key => $val) {
62 62
             $transformer[$key] = function($val) { return $this->featEncode[$key][$val]; };
63 63
         }
64 64
         $ndata = [];
65
-        for ($i=0; $i<$npoints; $i++) {
65
+        for ($i = 0; $i < $npoints; $i++) {
66 66
             $npoint = [];
67
-            for ($j=0; $j<$ndim; $j++) {
67
+            for ($j = 0; $j < $ndim; $j++) {
68 68
                 $npoint[] = $transformer[$j]($data[$i][$j]);
69 69
             }
70 70
             $ndata[] = $npoint;
@@ -75,12 +75,12 @@  discard block
 block discarded – undo
75 75
     /*
76 76
      * @param
77 77
      */  
78
-    function decode($ndata){
78
+    function decode($ndata) {
79 79
         $resp = [];
80
-        for ($i=0; $i<$npoints; $i++) {
80
+        for ($i = 0; $i < $npoints; $i++) {
81 81
             //$point = array_fill(0, $nexpdim; null);
82 82
             $point = array($ndata[$i]);
83
-            foreach ( as $key => $val) {
83
+            foreach (as $key => $val) {
84 84
                 $this->featDecode[$key]($point);            
85 85
             }
86 86
             $point = $this->removeNulls($point);
Please login to merge, or discard this patch.