class_docstr: A Causal Tree regressor class.
  The Causal Tree is a decision tree regressor with a split criteria for treatment effects.
  Details are available at Athey and Imbens (2015) (https://arxiv.org/abs/1504.01132)
class_docstr_tok: ["A","Causal","Tree","regressor","class",".","The","Causal","Tree","is","a","decision","tree","regressor","with","a","split","criteria","for","treatment","effects",".","Details","are","available","at","Athey","and","Imbens","(","2015",")","(","https",":","\/\/arxiv.org\/abs\/1504.01132",")"]
docstr: Fit CausalTreeRegressor
  Args:
      X: : (np.ndarray), feature matrix
      y: : (np.ndarray), outcome vector
      treatment: : (np.ndarray), treatment vector
      sample_weight: (np.ndarray), sample_weight
      check_input: (bool)
  Returns:
      self
docstr_tok: ["Fit","CausalTreeRegressor","Args",":","X",":",":","(","np.ndarray",")",",","feature","matrix","y",":",":","(","np.ndarray",")",",","outcome","vector","treatment",":",":","(","np.ndarray",")",",","treatment","vector","sample_weight",":","(","np.ndarray",")",",","sample_weight","check_input",":","(","bool",")","Returns",":","self"]
code: def fit(
      self,
      X: np.ndarray,
      y: np.ndarray,
      treatment: np.ndarray = None,
      sample_weight: np.ndarray = None,
      check_input=False,
  ):
      """
      Fit CausalTreeRegressor
      Args:
          X: : (np.ndarray), feature matrix
          y: : (np.ndarray), outcome vector
          treatment: : (np.ndarray), treatment vector
          sample_weight: (np.ndarray), sample_weight
          check_input: (bool)
      Returns:
          self
      """
  
      if (
          self.criterion == "causal_mse"
          and self.min_impurity_decrease != float("-inf")
      ):
          raise ValueError(
              "min_impurity_decrease must be set to -inf for causal_mse criterion"
          )
  
      if treatment is None and sample_weight is None:
          raise ValueError(
              "`treatment` or `sample_weight` must be provided"
          )
  
      if treatment is None:
          X, y, w = X, y, sample_weight
      else:
          X, y, w = self._prepare_data(X=X, y=y, treatment=treatment)
      self.treatment_groups = np.unique(w)
  
      super().fit(
          X=X, y=y, sample_weight=self.eps + w, check_input=check_input
      )
  
      if self.groups_cnt:
          self._groups_cnt = self._count_groups_distribution(
              X=X, treatment=w
          )
      return self
  
imports: import logging
  import sys
  from typing import Union
  import tqdm
  import numpy
  from numpy import float32
  from pathos.pools import ProcessPool
  from scipy.stats import norm
  from sklearn.base import RegressorMixin
  from sklearn.utils import check_array
  from sklearn.utils.validation import check_is_fitted
  from causalml.inference.meta.utils import check_treatment_vector
  from ._tree import BaseCausalDecisionTree
  from ..utils import get_tree_leaves_mask, timeit
label_desc: Use image node_id 2 for calling the CausalTreeRegressor obj's underlying member method code with example usage: obj.fit(X, y, treatment, sample_weight, check_input) and returns: self