qualitylib.cross_validate.random_cross_validation

random_cross_validation(model_builder, results, test_fraction=0.2, splits=100, content_aware=True, eval_content_wise=False, processes=1)[source]

Run random cross-validation

Parameters:
  • model_builder (Callable) – A callable that returns a new model object that contains the fit and predict methods.

  • results (List[Result]) – List of Result objects denoting each asset.

  • test_fraction (float) – Fraction of samples/contents to be used in test sets. Defaults to 0.2.

  • splits (int) – Number of random splits. Defaults to 100.

  • content_aware (bool) – Flag denoting whether train-test splits must be content-aware. Defaults to True.

  • eval_content_wise (bool) – Evaluaate accuracy for each content separately. Defaults to False.

  • processes (int) – Number of parallel processes to use. Defaults to 1.

Return type:

Dict[str, Any]

Returns:

Accuracy stats aggregated over all splits.