causallib.evaluation.evaluate_bootstrap#

evaluate_bootstrap(estimator, X, a, y, n_bootstrap, n_samples=None, replace=True, refit=False, metrics_to_evaluate=None)[source]#

Evaluate model on a bootstrap sample of the provided data

Parameters:
  • X (pandas.DataFrame) – Covariates.

  • a (pandas.Series) – Treatment assignment.

  • y (pandas.Series) – Outcome.

  • n_bootstrap (int) – Number of bootstrap sample to create.

  • n_samples (int | None) – Number of samples to sample in each bootstrap sampling. If None - will use the number samples (first dimension) of the data.

  • replace (bool) – Whether to use sampling with replacements. If False - n_samples (if provided) should be smaller than X.shape[0])

  • refit (bool) – Whether to refit the estimator on each bootstrap sample. Can be computational intensive if n_bootstrap is large.

  • metrics_to_evaluate (dict | None) – key: metric’s name, value: callable that receives true labels, prediction and sample_weights (the latter is allowed to be ignored). If not provided, default from causallib.evaluation.metrics are used.

Returns:

EvaluationResults