Skip to content

Commit

Permalink
FIX: LOF with QuantileFilter raises IndexError
Browse files Browse the repository at this point in the history
  • Loading branch information
MarekWadinger committed Oct 3, 2023
1 parent 1a32e0d commit eaae52b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions river/anomaly/lof.py
Original file line number Diff line number Diff line change
Expand Up @@ -342,8 +342,8 @@ def score_one(self, x: dict):
self.x_scores.append(x)
self.x_scores, equal = check_equal(self.x_scores, self.x_list)

if len(self.x_scores) == 0:
return None
if len(self.x_scores) == 0 or len(self.x_list) == 0:
return 0.5

x_list_copy = self.x_list.copy()
(
Expand Down

0 comments on commit eaae52b

Please sign in to comment.