docstr: Runs a single bootstrap. Fits on bootstrapped sample, then predicts on whole population.
docstr_tok: ["Runs","a","single","bootstrap",".","Fits","on","bootstrapped","sample",",","then","predicts","on","whole","population","."]
code: def bootstrap(self, X, treatment, y, p=None, size=10000):
      """Runs a single bootstrap. Fits on bootstrapped sample, then predicts on whole population."""
      idxs = np.random.choice(np.arange(0, X.shape[0]), size=size)
      X_b = X[idxs]
  
      if p is not None:
          p_b = {group: _p[idxs] for group, _p in p.items()}
      else:
          p_b = None
  
      treatment_b = treatment[idxs]
      y_b = y[idxs]
      self.fit(X=X_b, treatment=treatment_b, y=y_b, p=p_b)
      return self.predict(X=X, p=p)
  
imports: from abc import ABCMeta, abstractclassmethod
  import logging
  import numpy
  import pandas
  from causalml.inference.meta.explainer import Explainer
  from causalml.inference.meta.utils import check_p_conditions, convert_pd_to_np
  from causalml.propensity import compute_propensity_score
label_desc: Use image node_id 5 for calling the BaseLearner obj's underlying member method code with example usage: obj.bootstrap(X, treatment, y, p, size) and returns: self