Skip to content

Commit

Permalink
r.learn.train: fix for scikit-learn==0.24.0 (#448)
Browse files Browse the repository at this point in the history
* add shuffle=True for scikit-learn==0.24.0

Co-authored-by: anikaweinmann <aweinmann@mundialis.de>
  • Loading branch information
anikaweinmann and anikaweinmann committed Feb 25, 2021
1 parent 38e407f commit 89048ba
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions grass7/raster/r.learn.ml2/r.learn.train/r.learn.train.py
Expand Up @@ -627,7 +627,7 @@ def main():

if any(param_grid) is True:
if group_id is None and mode == "classification":
inner = StratifiedKFold(n_splits=2, random_state=random_state)
inner = StratifiedKFold(n_splits=2, random_state=random_state, shuffle=True)
elif group_id is None and mode == "regression":
inner = KFold(n_splits=2, random_state=random_state)
else:
Expand All @@ -638,7 +638,7 @@ def main():
# outer resampling method (cv=cv)
if cv > 1:
if group_id is None and mode == "classification":
outer = StratifiedKFold(n_splits=cv, random_state=random_state)
outer = StratifiedKFold(n_splits=cv, random_state=random_state, shuffle=True)
elif group_id is None and mode == "regression":
outer = KFold(n_splits=cv, random_state=random_state)
else:
Expand Down

0 comments on commit 89048ba

Please sign in to comment.