Skip to content

Commit

Permalink
fix: random shuffle
Browse files Browse the repository at this point in the history
  • Loading branch information
shenxiangzhuang committed Oct 27, 2024
1 parent 0af6604 commit 43f9dbb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion toyml/ensemble/iforest.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def _get_left_right_child_itree(
) -> tuple[Optional[IsolationTree], Optional[IsolationTree]]:
assert self.feature_num_ is not None
split_at_list = list(range(self.feature_num_))
random.shuffle(split_at_list)
self.random_state.shuffle(split_at_list)
for split_at in split_at_list:
split_at_feature_values = [sample[split_at] for sample in samples]
split_at_min, split_at_max = min(split_at_feature_values), max(split_at_feature_values)
Expand Down

0 comments on commit 43f9dbb

Please sign in to comment.