class_docstr: A Learner that learns a treatment assignment policy with observational data using doubly robust estimator of causal
  effect for binary treatment.
  
  Details of the policy learner are available at Athey and Wager (2018) (https://arxiv.org/abs/1702.02896).
class_docstr_tok: ["A","Learner","that","learns","a","treatment","assignment","policy","with","observational","data","using","doubly","robust","estimator","of","causal","effect","for","binary","treatment",".","Details","of","the","policy","learner","are","available","at","Athey","and","Wager","(","2018",")","(","https",":","\/\/arxiv.org\/abs\/1702.02896",")","."]
code: def _treatment_estimate(self, X, w):
      self._w_pred = np.zeros(len(w))
  
      for train_index, test_index in self.cv.split(w):
          X_train, X_test = X[train_index], X[test_index]
          w_train, w_test = w[train_index], w[test_index]
  
          self._w_pred[test_index], _ = compute_propensity_score(
              X=X_train,
              treatment=w_train,
              X_pred=X_test,
              treatment_pred=w_test,
              calibrate_p=self.calibration,
          )
  
      self._w_pred = np.clip(
          self._w_pred,
          a_min=self.clip_bounds[0],
          a_max=self.clip_bounds[1],
      )
  
file_path: causalml/causalml/optimize/policylearner.py
imports: import logging
  import numpy
  from causalml.propensity import compute_propensity_score
  from sklearn.ensemble import GradientBoostingRegressor, GradientBoostingClassifier
  from sklearn.model_selection import cross_val_predict, KFold
  from sklearn.tree import DecisionTreeClassifier
label_desc: Use image node_id 4 for calling the PolicyLearner obj's underlying member method code with example usage: obj._treatment_estimate(X, w) without return types