Code Duplication    Length = 11-11 lines in 2 locations

src/Phpml/Classification/Linear/LogisticRegression.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) - 0.5);
272
        }
273
274
        return 0.0;
275
    }
276
}
277

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

@@ 248-258 (lines=11) @@
245
     * @param array $sample
246
     * @param mixed $label
247
     */
248
    protected function predictProbability(array $sample, $label)
249
    {
250
        $predicted = $this->predictSampleBinary($sample);
251
252
        if (strval($predicted) == strval($label)) {
253
            $sample = $this->checkNormalizedSample($sample);
254
            return abs($this->output($sample));
255
        }
256
257
        return 0.0;
258
    }
259
260
    /**
261
     * @param array $sample