class_docstr: A parent class for R-learner classes.
  
  An R-learner estimates treatment effects with two machine learning models and the propensity score.
  
  Details of R-learner are available at Nie and Wager (2019) (https://arxiv.org/abs/1712.04912).
docstr: Predict treatment effects.
  
  Args:
      X (np.matrix or np.array or pd.Dataframe): a feature matrix
  
  Returns:
      (numpy.ndarray): Predictions of treatment effects.
docstr_tok: ["Predict","treatment","effects",".","Args",":","X","(","np.matrix","or","np.array","or","pd.Dataframe",")",":","a","feature","matrix","Returns",":","(","numpy.ndarray",")",":","Predictions","of","treatment","effects","."]
code: def predict(self, X, p=None):
      """Predict treatment effects.
  
      Args:
          X (np.matrix or np.array or pd.Dataframe): a feature matrix
  
      Returns:
          (numpy.ndarray): Predictions of treatment effects.
      """
      X = convert_pd_to_np(X)
      te = np.zeros((X.shape[0], self.t_groups.shape[0]))
      for i, group in enumerate(self.t_groups):
          dhat = self.models_tau[group].predict(X)
          te[:, i] = dhat
  
      return te
  
imports: from copy import deepcopy
  import logging
  import numpy
  import pandas
  from tqdm import tqdm
  from scipy.stats import norm
  from sklearn.model_selection import cross_val_predict, KFold, train_test_split
  from xgboost import XGBRegressor
  from causalml.inference.meta.base import BaseLearner
  from causalml.inference.meta.utils import check_treatment_vector, get_xgboost_objective_metric, convert_pd_to_np, get_weighted_variance
  from causalml.propensity import compute_propensity_score, ElasticNetPropensityModel
label_desc: Use image node_id 4 for calling the BaseRLearner obj's underlying member method code with example usage: obj.predict(X, p) and returns: te