In LeaveOneGroupOut and LeavePGroupsOut, when the groups supplied at split time has fewer than or equal to n_groups, we should raise an error.
>>> import numpy as np
>>> from sklearn.model_selection import LeaveOneGroupOut, LeavePGroupsOut
>>> X = y = groups = np.ones(10)
>>> list(LeaveOneGroupOut.split(X, y, groups))
[(array([], dtype=int64), array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9]))]
>>> list(LeavePGroupsOut(n_groups=5).split(X, y, groups))
[]
This was like that before in the cross_validation module too. I think we should raise an appropriate error message in both cases (LeavePGroupsOut and LeaveOneGroupOut)?
@amueller @jnothman
In
LeaveOneGroupOutandLeavePGroupsOut, when thegroupssupplied atsplittime has fewer than or equal ton_groups, we should raise an error.This was like that before in the
cross_validationmodule too. I think we should raise an appropriate error message in both cases (LeavePGroupsOutandLeaveOneGroupOut)?@amueller @jnothman