Skip to content

Commit

Permalink
Fix the bug in the discretize method
Browse files Browse the repository at this point in the history
  • Loading branch information
ankh1999 authored and erdogant committed Nov 15, 2023
1 parent 851a00d commit c1e4f27
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions bnlearn/discretize/discretize.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ def discretize(
verbose=verbose,
)

continuous_columns = sorted(continuous_columns, key=lambda x: data.columns.get_loc(x))

# Extend the breaks to the left with 1% to deal with (open,closed] intervals
for i, col in enumerate(continuous_columns):
breaks = continuous_edges[i]
Expand Down

0 comments on commit c1e4f27

Please sign in to comment.