tabensemb.trainer.Trainer.cross_validation#
method
- Trainer.cross_validation(programs: List[str], n_random: int, verbose: bool, test_data_only: bool, split_type: str = 'cv', load_from_previous: bool = False, **kwargs) Dict[str, Dict[str, Dict[str, Tuple[ndarray, ndarray]]]][source]#
Repeat
load_data(), train model bases, and evaluate all models for multiple times.- Parameters:
- programs
A selected subset of model bases.
- n_random
The number of repeats.
- verbose
Verbosity.
- test_data_only
Whether to evaluate models only on testing datasets.
- split_type
The type of data splitting. “random” and “cv” are supported. Ignored when
load_from_previousis True.- load_from_previous
Load the state of a previous run (mostly because of an unexpected interruption).
- **kwargs
Arguments for
tabensemb.model.AbstractModel.train()
- Returns:
- dict
A dict in the following format: {keys: programs, values: {keys: model names, values: {keys: [“Training”, “Testing”, “Validation”], values: (Predicted values, true values)}}
Notes
The results of a continuous run and a continued run (
load_from_previous=True) are consistent.