LeavePGroupsOut
- class sklearn.model_selection.LeavePGroupsOut(n_groups)
Leave P Group(s) Out cross-validator.
Provides train/test indices to split data according to a third-party provided group. This group information can be used to encode arbitrary domain-specific groupings of the samples as integers.
For instance the groups could be the year of collection of the samples and thus allow for cross-validation against time-based splits.
The difference between LeavePGroupsOut and LeaveOneGroupOut is that the former builds the test sets with all the samples assigned to
pdifferent values of the groups while the latter uses samples all assigned the same groups.Read more in the User Guide.
- Parameters