ertk.train.TrainValidation

class ertk.train.TrainValidation

Bases: BaseCrossValidator

Validation method that uses the training set as validation set.

__init__(*args, **kwargs)

Methods

get_n_splits(X, y, groups)

Returns the number of splitting iterations in the cross-validator

split(X, y, groups)

Generate indices to split data into training and test set.

Inherited Methods

__init__(*args, **kwargs)

get_n_splits(X, y, groups)

Returns the number of splitting iterations in the cross-validator

split(X, y, groups)

Generate indices to split data into training and test set.

Parameters:
Xarray-like of shape (n_samples, n_features)

Training data, where n_samples is the number of samples and n_features is the number of features.

yarray-like of shape (n_samples,)

The target variable for supervised learning problems.

groupsarray-like of shape (n_samples,), default=None

Group labels for the samples used while splitting the dataset into train/test set.

Yields:
trainndarray

The training set indices for that split.

testndarray

The testing set indices for that split.