Code Duplication    Length = 5-5 lines in 3 locations

src/Phpml/Classification/Linear/DecisionStump.php 3 locations

@@ 195-199 (lines=5) @@
192
            // the average value for the cut point
193
            $threshold = array_sum($values) / (float) count($values);
194
            list($errorRate, $prob) = $this->calculateErrorRate($threshold, $operator, $values);
195
            if ($split == null || $errorRate < $split['trainingErrorRate']) {
196
                $split = ['value' => $threshold, 'operator' => $operator,
197
                        'prob' => $prob, 'column' => $col,
198
                        'trainingErrorRate' => $errorRate];
199
            }
200
201
            // Try other possible points one by one
202
            for ($step = $minValue; $step <= $maxValue; $step+= $stepSize) {
@@ 205-209 (lines=5) @@
202
            for ($step = $minValue; $step <= $maxValue; $step+= $stepSize) {
203
                $threshold = (float)$step;
204
                list($errorRate, $prob) = $this->calculateErrorRate($threshold, $operator, $values);
205
                if ($errorRate < $split['trainingErrorRate']) {
206
                    $split = ['value' => $threshold, 'operator' => $operator,
207
                        'prob' => $prob, 'column' => $col,
208
                        'trainingErrorRate' => $errorRate];
209
                }
210
            }// for
211
        }
212
@@ 234-238 (lines=5) @@
231
            foreach ($distinctVals as $val) {
232
                list($errorRate, $prob) = $this->calculateErrorRate($val, $operator, $values);
233
234
                if ($split == null || $split['trainingErrorRate'] < $errorRate) {
235
                    $split = ['value' => $val, 'operator' => $operator,
236
                        'prob' => $prob, 'column' => $col,
237
                        'trainingErrorRate' => $errorRate];
238
                }
239
            }// for
240
        }
241