Note
This page is a reference documentation. It only explains the class signature, and not how to use it. Please refer to the What you really need to know section for the big picture.
julearn.model_selection.final_model_cv._JulearnFinalModelCV¶
- class julearn.model_selection.final_model_cv._JulearnFinalModelCV(cv)¶
Final model cross-validation iterator.
Wraps any CV iterator to provide an extra iteration with the full dataset.
- Parameters:
cv (
BaseCrossValidator) – The cross-validation iterator to wrap.
- __init__(cv)¶
- get_metadata_routing()¶
Get metadata routing information from the underlying CV.
- Returns:
The metadata routing information.
- split(X, y, groups=None)¶
Generate indices to split data into training and test set.
- Parameters:
X (
ndarray) – Training data, where n_samples is the number of samples and n_features is the number of features. Note that providingyis sufficient to generate the splits and hencenp.zeros(n_samples)may be used as a placeholder forXinstead of actual training data.y (
ndarray) – The target variable for supervised learning problems.groups (
ndarray|None, default:None) – Group labels for the samples used while splitting the dataset into train/test set.
- Yields:
train (ndarray) – The training set indices for that split.
test (ndarray) – The testing set indices for that split.
Notes
This CV Splitter will generate an extra fold where the full dataset is used for training and testing. This is useful to train the final model on the full dataset at the same time as the cross-validation, profitting for joblib calls.
- get_n_splits()¶
Get the number of splits.
- Returns:
The number of splits.