apply_cross_validation#
- mlquantify.utils.apply_cross_validation(model, X: ndarray, y: ndarray, cv=5, function='predict_proba', stratified=True, random_state=None, shuffle=True, cv_prediction='refit')[source]#
Perform cross-validation and return predictions with true labels for each fold.
- Returns:
- tuple[np.ndarray, np.ndarray, object]
predictions, true_labels, fitted_estimator. The fitted estimator is a single estimator for ‘refit’ and a list of fold estimators for ‘ensemble’.