Test Failed
Pull Request — master (#100)
by Никита
08:17 queued 03:30
created
src/Phpml/Classification/DecisionTree/DecisionTreeLeaf.php 1 patch
Spacing   +12 added lines, -12 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\DecisionTree;
6 6
 
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
     /**
35 35
      * @var DecisionTreeLeaf
36 36
      */
37
-    public $rightLeaf= null;
37
+    public $rightLeaf = null;
38 38
 
39 39
     /**
40 40
      * @var array
@@ -120,16 +120,16 @@  discard block
 block discarded – undo
120 120
             return 0.0;
121 121
         }
122 122
 
123
-        $nodeSampleCount = (float)count($this->records);
123
+        $nodeSampleCount = (float) count($this->records);
124 124
         $iT = $this->giniIndex;
125 125
 
126 126
         if ($this->leftLeaf) {
127
-            $pL = count($this->leftLeaf->records)/$nodeSampleCount;
127
+            $pL = count($this->leftLeaf->records) / $nodeSampleCount;
128 128
             $iT -= $pL * $this->leftLeaf->giniIndex;
129 129
         }
130 130
 
131 131
         if ($this->rightLeaf) {
132
-            $pR = count($this->rightLeaf->records)/$nodeSampleCount;
132
+            $pR = count($this->rightLeaf->records) / $nodeSampleCount;
133 133
             $iT -= $pR * $this->rightLeaf->giniIndex;
134 134
         }
135 135
 
@@ -156,22 +156,22 @@  discard block
 block discarded – undo
156 156
             if (!preg_match("/^[<>=]{1,2}/", $value)) {
157 157
                 $value = "=$value";
158 158
             }
159
-            $value = "<b>$col $value</b><br>Gini: ". number_format($this->giniIndex, 2);
159
+            $value = "<b>$col $value</b><br>Gini: ".number_format($this->giniIndex, 2);
160 160
         }
161 161
         $str = "<table ><tr><td colspan=3 align=center style='border:1px solid;'>
162 162
 				$value</td></tr>";
163 163
         if ($this->leftLeaf || $this->rightLeaf) {
164
-            $str .='<tr>';
164
+            $str .= '<tr>';
165 165
             if ($this->leftLeaf) {
166
-                $str .="<td valign=top><b>| Yes</b><br>" . $this->leftLeaf->getHTML($columnNames) . "</td>";
166
+                $str .= "<td valign=top><b>| Yes</b><br>".$this->leftLeaf->getHTML($columnNames)."</td>";
167 167
             } else {
168
-                $str .='<td></td>';
168
+                $str .= '<td></td>';
169 169
             }
170
-            $str .='<td>&nbsp;</td>';
170
+            $str .= '<td>&nbsp;</td>';
171 171
             if ($this->rightLeaf) {
172
-                $str .="<td valign=top align=right><b>No |</b><br>" . $this->rightLeaf->getHTML($columnNames) . "</td>";
172
+                $str .= "<td valign=top align=right><b>No |</b><br>".$this->rightLeaf->getHTML($columnNames)."</td>";
173 173
             } else {
174
-                $str .='<td></td>';
174
+                $str .= '<td></td>';
175 175
             }
176 176
             $str .= '</tr>';
177 177
         }
Please login to merge, or discard this patch.