code: def fit(self, X, y, sample_weight=None):
      from sklearn.tree import DecisionTreeRegressor
  
      self.max_features = float(self.max_features)
      if check_none(self.max_depth_factor):
          max_depth_factor = self.max_depth_factor = None
      else:
          num_features = X.shape[1]
          self.max_depth_factor = int(self.max_depth_factor)
          max_depth_factor = max(
              1, int(np.round(self.max_depth_factor * num_features, 0))
          )
      self.min_samples_split = int(self.min_samples_split)
      self.min_samples_leaf = int(self.min_samples_leaf)
      if check_none(self.max_leaf_nodes):
          self.max_leaf_nodes = None
      else:
          self.max_leaf_nodes = int(self.max_leaf_nodes)
      self.min_weight_fraction_leaf = float(
          self.min_weight_fraction_leaf
      )
      self.min_impurity_decrease = float(self.min_impurity_decrease)
  
      self.estimator = DecisionTreeRegressor(
          criterion=self.criterion,
          max_depth=max_depth_factor,
          min_samples_split=self.min_samples_split,
          min_samples_leaf=self.min_samples_leaf,
          max_leaf_nodes=self.max_leaf_nodes,
          min_weight_fraction_leaf=self.min_weight_fraction_leaf,
          min_impurity_decrease=self.min_impurity_decrease,
          random_state=self.random_state,
      )
  
      if y.ndim == 2 and y.shape[1] == 1:
          y = y.flatten()
  
      self.estimator.fit(X, y, sample_weight=sample_weight)
      return self
  
file_path: auto-sklearn/autosklearn/pipeline/components/regression/decision_tree.py
imports: from typing import Optional
  import numpy
  from ConfigSpace.configuration_space import ConfigurationSpace
  from ConfigSpace.hyperparameters import CategoricalHyperparameter, Constant, UniformFloatHyperparameter, UniformIntegerHyperparameter, UnParametrizedHyperparameter
  from autosklearn.askl_typing import FEAT_TYPE_TYPE
  from autosklearn.pipeline.components.base import AutoSklearnRegressionAlgorithm
  from autosklearn.pipeline.constants import DENSE, PREDICTIONS, SPARSE, UNSIGNED_DATA
  from autosklearn.util.common import check_none
label_desc: Use image node_id 2 for calling the DecisionTree obj's underlying member method code with example usage: obj.fit(X, y, sample_weight) and returns: self