Skip to content

Commit

Permalink
fix out of range metric (#1473)
Browse files Browse the repository at this point in the history
  • Loading branch information
mike0sv authored Feb 11, 2025
1 parent f31ed14 commit d4a02be
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/evidently/future/metrics/column_statistics.py
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ def display_name(self) -> str:

def _calculate_value(self, dataset: Dataset):
column = dataset.column(self.metric.column)
value = column.data.between(self.metric.left, self.metric.right).count()
value = column.data.between(self.metric.left, self.metric.right).sum()
total = column.data.count()
return CountValue(value, value / total)

Expand Down Expand Up @@ -285,7 +285,7 @@ def display_name(self) -> str:

def _calculate_value(self, dataset: Dataset):
column = dataset.column(self.metric.column)
value = column.data.between(self.metric.left, self.metric.right).count()
value = column.data.between(self.metric.left, self.metric.right).sum()
total = column.data.count()
return CountValue(total - value, (total - value) / total)

Expand Down

0 comments on commit d4a02be

Please sign in to comment.