Skip to content

Commit

Permalink
Eliminate first and last breakpoint indexes in K-S test
Browse files Browse the repository at this point in the history
  • Loading branch information
onyb committed Mar 15, 2021
1 parent 7f843f2 commit b40b23b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion core/postprocessors/ks_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ def ks_test_engine(
df = df.sort_values(by=predictor_name)
predictor = df[predictor_name]

breakpoints_idx = np.round(np.linspace(0, len(df) - 1, breakpoints_num)).astype(int)
breakpoints_idx = np.round(np.linspace(0, len(df) - 1, breakpoints_num + 2)).astype(
int
)[1:-1]
breakpoints: np.ndarray = np.unique(predictor.to_numpy().take(breakpoints_idx))

df_result = pd.DataFrame(breakpoints, columns=["breakpoint"])
Expand Down

0 comments on commit b40b23b

Please sign in to comment.