Code Duplication    Length = 11-11 lines in 2 locations

src/Phpml/Classification/Linear/LogisticRegression.php 1 location

@@ 270-280 (lines=11) @@
267
     * @param array $sample
268
     * @param mixed $label
269
     */
270
    protected function predictProbability(array $sample, $label)
271
    {
272
        $predicted = $this->predictSampleBinary($sample);
273
274
        if (strval($predicted) == strval($label)) {
275
            $sample = $this->checkNormalizedSample($sample);
276
            return abs($this->output($sample) - 0.5);
277
        }
278
279
        return 0.0;
280
    }
281
}
282

src/Phpml/Classification/Linear/Perceptron.php 1 location

@@ 265-275 (lines=11) @@
262
     * @param array $sample
263
     * @param mixed $label
264
     */
265
    protected function predictProbability(array $sample, $label)
266
    {
267
        $predicted = $this->predictSampleBinary($sample);
268
269
        if (strval($predicted) == strval($label)) {
270
            $sample = $this->checkNormalizedSample($sample);
271
            return abs($this->output($sample));
272
        }
273
274
        return 0.0;
275
    }
276
277
    /**
278
     * @param array $sample