LeaveOutPercent

class mastml.legos.data_splitters.LeaveOutPercent(percent_leave_out=0.2, n_repeats=5)[source]

Bases: sklearn.base.BaseEstimator, sklearn.base.TransformerMixin

Class to train the model using a certain percentage of data as training data

Args:

percent_leave_out (float): fraction of data to use in training (must be > 0 and < 1)

n_repeats (int): number of repeated splits to perform (must be >= 1)

Methods:

get_n_splits: method to return the number of splits to perform

Args:
groups: (numpy array), array of group labels
Returns:
(int), number of unique groups, indicating number of splits to perform

split: method to perform split into train indices and test indices

Args:
X: (numpy array), array of X features y: (numpy array), array of y data groups: (numpy array), array of group labels
Returns:
(numpy array), array of train and test indices

Methods Summary

get_n_splits([X, y, groups])
split(X, y[, groups])

Methods Documentation

get_n_splits(X=None, y=None, groups=None)[source]
split(X, y, groups=None)[source]