Skip to content

[BUG]: LeaveOneGroupOut is not working with pycaret #3279

@atwahsz

Description

@atwahsz

pycaret version checks

Issue Description

i'm trying to use leave one group out with pycaret and i'm reciving the following error

ValueError: The 'groups' parameter should not be None.

Reproducible Example

!pip install --pre pycaret
from sklearn.model_selection import LeaveOneGroupOut
logo = LeaveOneGroupOut()
from pycaret.datasets import get_data
data = get_data('juice')
from pycaret.classification import *
s = setup(data, target = 'Purchase',fold_strategy=logo,fold_groups='STORE')
rff= create_model('rf')

Expected Behavior

creating multiple folds in each fold one group is holdout for validation

Actual Results

---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
<ipython-input-8-013016ca3ef0> in <module>
----> 1 rff= create_model('rf')

6 frames
/usr/local/lib/python3.8/dist-packages/sklearn/model_selection/_split.py in get_n_splits(self, X, y, groups)
   1178         """
   1179         if groups is None:
-> 1180             raise ValueError("The 'groups' parameter should not be None.")
   1181         groups = check_array(groups, ensure_2d=False, dtype=None)
   1182         return len(np.unique(groups))

ValueError: The 'groups' parameter should not be None.

Installed Versions

Replace this line with the output of the version code above.

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingenhancementNew feature or request

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions