Skip to content

Commit

Permalink
Drop NaN in KolmogorovSmirnov (#175)
Browse files Browse the repository at this point in the history
* Omit NaN policy in KolmogorovSmirnov

* dropna instead of nan_policy
  • Loading branch information
tomcarter23 authored Feb 7, 2024
1 parent 5f215f8 commit 34018c6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/insight/metrics/metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -534,4 +534,5 @@ def _compute_metric(self, sr_a: pd.Series, sr_b: pd.Series) -> float:
"""
if sr_a.empty or sr_b.empty:
return 1.0
return ks_2samp(sr_a, sr_b)[0] # The first element is the KS statistic

return ks_2samp(sr_a.dropna(), sr_b.dropna())[0] # The first element is the KS statistic

0 comments on commit 34018c6

Please sign in to comment.