lightautoml.validation.utils.create_validation_iterator(train, valid=None, n_folds=None, cv_iter=None)[source]

Creates train-validation iterator.

If train is one of common datasets types (PandasDataset, NumpyDataset, CSRSparseDataset) the get_numpy_iterator will be used. Else if validation dataset is defined, the holdout-iterator will be used. Else the dummy iterator will be used.

  • train (LAMLDataset) – Dataset to train.

  • valid (Optional[LAMLDataset]) – Optional dataset for validate.

  • n_folds (Optional[int]) – maximum number of folds to iterate. If None - iterate through all folds.

  • cv_iter (Optional[Callable]) – Takes dataset as input and return an iterator of indexes of train/valid for train dataset.

Return type



New iterator.