skfolio.utils.tools.safe_split#

skfolio.utils.tools.safe_split(X, y=None, indices=None, axis=0)[source]#

Create subset of dataset.

Slice X, y according to indices for cross-validation.

Parameters:
Xarray-like

Data to be indexed.

yarray-like

Data to be indexed.

indicesndarray of int, optional

Rows or columns to select from X and y. The default (None) is to select the entire data.

axisint, default=0

The axis along which X will be sub-sampled. axis=0 will select rows while axis=1 will select columns.

Returns:
X_subsetarray-like

Indexed data.

y_subsetarray-like

Indexed targets.