ertk.train.ValidationSplit
- class ertk.train.ValidationSplit(train_idx: List[int] | ndarray, valid_idx: List[int] | ndarray)
Bases:
BaseCrossValidatorValidation method that uses a pre-defined validation set.
- Parameters:
- train_idx: list of int or np.ndarray
Indices of the training set.
- valid_idx: list of int or np.ndarray
Indices of the validation set.
Methods
__init__(train_idx, valid_idx)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
- 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_samplesis the number of samples andn_featuresis 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.