HoldoutSplitter
Splitter that creates train, test, and validation partitions for holdout evaluation.
This strategy is appropriate when a single representative split is sufficient for model selection or final assessment. It is commonly used for quick experiments, hyperparameter tuning, and production-ready evaluation where the computational cost of repeated cross-validation would be excessive.
It is especially useful for large datasets and for workflows that require a simple partitioning scheme with clear train/test/validation boundaries.
References
Parameters
- train, default=
0.6 - Proportion of the dataset assigned to the training partition.
- test, default=
0.2 - Proportion of the dataset assigned to the test partition.
- validation, default=
0.2 - Proportion of the dataset assigned to the validation partition.
- stratify : boolean, default=
False - Whether to preserve the class distribution across the splits.
- shuffle : boolean, default=
True - Whether to shuffle the data before splitting it.
- random_state : integer, default=
42 - Seed used to make the split reproducible when shuffle is enabled.
Methods
split(self, x: 'DashAIDataset', y: 'DashAIDataset') -> 'Tuple[DatasetDict, DatasetDict, Dict[str, Any]]'
HoldoutSplitterSplit the input data into holdout partitions and return the resulting datasets.
Parameters
- x : DashAIDataset
- Input dataset to partition.
- y : DashAIDataset
- Target values associated with
x.
Returns
- tuple
- A tuple containing the partitioned input and output datasets, along with the indices used for each split.
split_indexes(self, x: 'DashAIDataset', y: 'DashAIDataset') -> 'Tuple[List, List, List]'
HoldoutSplitterGenerate lists with train, test and validation indexes.
Parameters
- x: DashAIDataset
- Input dataset to partition.
- y: DashAIDataset
- Target values associated with
x.
Returns
- tuple[List, List, List]
- Lists of indices for the training, test, and validation partitions.
get_credential(self, name: str)
ConfigObjectResolve a registered credential component by name.
Parameters
- name : str
- Credential component class name (e.g. "HuggingFaceCredential").
Returns
- BaseCredential
- An instance of the requested credential component.
get_schema(cls) -> dict
ConfigObjectGenerates the component related Json Schema.
Returns
- dict
- Dictionary representing the Json Schema of the component.
prepare_y(self, y)
BaseSplitterEncode the target variable for stratified splitting.
Parameters
- y : object
- Target values to encode. This may be a list, a pandas-like object, or a DashAI dataset that exposes a single target column.
Returns
- object
- Encoded labels suitable for stratified splitting.
validate_and_transform(self, raw_data: dict) -> dict
ConfigObjectIt takes the data given by the user to initialize the model and returns it with all the objects that the model needs to work.
Parameters
- raw_data : dict
- A dictionary with the data provided by the user to initialize the model.
Returns
- dict
- A validated dictionary with the necessary objects.