cross_validation

The museotoolbox.cross_validation module gathers cross-validation classes.

Functions

train_test_split(cv, X, y[, random_state])

Split arrays into random train and test subsets according to your choosen cross_validation method.

Classes

LeaveOneOut([n_repeats, random_state, verbose])

Generate a Cross-Validation using a Stratified Leave One Out.

LeaveOneSubGroupOut([n_repeats, …])

Generate a Cross-Validation by subgroup.

LeavePSubGroupOut([valid_size, n_repeats, …])

Generate a Cross-Validation using subgroup (each group belong to a unique label).

RandomStratifiedKFold([n_splits, n_repeats, …])

Generate a Cross-Validation with full random selection and Stratified K-Fold (same percentange per class).

SpatialLeaveAsideOut(distance_matrix[, …])

Generate a Cross-Validation using the farthest distance between the training and validation samples.

SpatialLeaveOneOut([distance_thresold, …])

Generate a Cross-Validation with a stratified spatial Leave-One-Out method.

SpatialLeaveOneSubGroupOut(…[, …])

Generate a Cross-Validation with Spatial Leave-One-Out method.