Skip to content

Commit 15726a4

Browse files
committed
Merge branch 'master' into 3.0
2 parents 19aecd1 + 696a2f6 commit 15726a4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/AnomalyDetectors/LocalOutlierFactor.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ protected function localOutlierFactor(array $sample) : float
287287
{
288288
[$samples, $indices, $distances] = $this->tree->nearest($sample, $this->k);
289289

290-
$lrd = $this->localReachabilityDensity($indices, $distances);
290+
$lrd = $this->localReachabilityDensity($indices, $distances) ?: EPSILON;
291291

292292
$ratios = [];
293293

0 commit comments

Comments
 (0)