SingleSplit#

class SingleSplit(test_size=0.25, train_size=None, random_state=None, shuffle=True, stratify=None)[source]#

Helper class for orchestration that uses a single split for training and testing.

Wrapper for sklearn.model_selection.train_test_split

Parameters:
*arrayssequence of indexables with same length / shape[0]

Allowed inputs are lists, numpy arrays, scipy-sparse matrices or pandas dataframes.

test_sizefloat, int or None, optional (default=0.25)

If float, should be between 0.0 and 1.0 and represent the proportion of the dataset to include in the test split. If int, represents the absolute number of test samples. If None, the value is set to the complement of the train size. By default, the value is set to 0.25. The default will change in version 0.21. It will remain 0.25 only if train_size is unspecified, otherwise it will complement the specified train_size.

train_sizefloat, int, or None, (default=None)

If float, should be between 0.0 and 1.0 and represent the proportion of the dataset to include in the train split. If int, represents the absolute number of train samples. If None, the value is automatically set to the complement of the test size.

random_stateint, RandomState instance or None, optional (default=None)

If int, random_state is the seed used by the random number generator; If RandomState instance, random_state is the random number generator; If None, the random number generator is the RandomState instance used by np.random.

shuffleboolean, optional (default=True)

Whether or not to shuffle the data before splitting. If shuffle=False then stratify must be None.

stratifyarray-like or None (default=None)

If not None, data is split in a stratified fashion, using this as the class labels.

Methods

get_n_splits()

Return the number of splits (1).

split(data[, y, groups])

Split the data into training and testing data.

split(data, y=None, groups=None)[source]#

Split the data into training and testing data.

Parameters:
datapandas dataframe

data used for cross validation

Returns:
tuple

(train, test) indexes

static get_n_splits()[source]#

Return the number of splits (1).