class_docstr: ContinuousIntervalTree tree node.
code: def build_tree(
      self,
      X,
      y,
      thresholds,
      entropy,
      distribution,
      depth,
      max_depth,
      n_classes,
      leaf,
  ):
      from sktime.classification.sklearn._continuous_interval_tree_numba import (
          information_gain,
          margin_gain,
          remaining_classes,
          split_data,
      )
  
      self.depth = depth
      best_distributions = []
      best_entropies = []
  
      if (
          leaf is False
          and remaining_classes(distribution)
          and depth < max_depth
      ):
          for (_, att), threshold in np.ndenumerate(thresholds):
              (
                  info_gain,
                  distributions,
                  entropies,
              ) = information_gain(
                  X, y, att, threshold, entropy, n_classes
              )
  
              if info_gain > self.best_gain:
                  self.best_split = att
                  self.best_threshold = threshold
                  self.best_gain = info_gain
                  self.best_margin = -1
                  best_distributions = distributions
                  best_entropies = entropies
              elif info_gain == self.best_gain and info_gain > 0.000001:
                  margin = margin_gain(X, att, threshold)
                  if self.best_margin == -1:
                      self.best_margin = margin_gain(
                          X, self.best_split, self.best_threshold
                      )
  
                  if margin > self.best_margin or (
                      margin == self.best_margin
                      and self.random_state.choice([True, False])
                  ):
                      self.best_split = att
                      self.best_threshold = threshold
                      self.best_margin = margin
                      best_distributions = distributions
                      best_entropies = entropies
  
      if self.best_split > -1:
          self.children = [None, None, None]
  
          left_idx, right_idx, missing_idx = split_data(
              X, self.best_split, self.best_threshold
          )
  
          if len(left_idx) > 0:
              self.children[0] = _TreeNode(
                  random_state=self.random_state
              )
              self.children[0].build_tree(
                  X[left_idx],
                  y[left_idx],
                  thresholds,
                  best_entropies[0],
                  best_distributions[0],
                  depth + 1,
                  max_depth,
                  n_classes,
                  False,
              )
          else:
              self.children[0] = _TreeNode(
                  random_state=self.random_state
              )
              self.children[0].build_tree(
                  X,
                  y,
                  thresholds,
                  entropy,
                  distribution,
                  depth + 1,
                  max_depth,
                  n_classes,
                  True,
              )
  
          if len(right_idx) > 0:
              self.children[1] = _TreeNode(
                  random_state=self.random_state
              )
              self.children[1].build_tree(
                  X[right_idx],
                  y[right_idx],
                  thresholds,
                  best_entropies[1],
                  best_distributions[1],
                  depth + 1,
                  max_depth,
                  n_classes,
                  False,
              )
          else:
              self.children[1] = _TreeNode(
                  random_state=self.random_state
              )
              self.children[1].build_tree(
                  X,
                  y,
                  thresholds,
                  entropy,
                  distribution,
                  depth + 1,
                  max_depth,
                  n_classes,
                  True,
              )
  
          if len(missing_idx) > 0:
              self.children[2] = _TreeNode(
                  random_state=self.random_state
              )
              self.children[2].build_tree(
                  X[missing_idx],
                  y[missing_idx],
                  thresholds,
                  best_entropies[2],
                  best_distributions[2],
                  depth + 1,
                  max_depth,
                  n_classes,
                  False,
              )
          else:
              self.children[2] = _TreeNode(
                  random_state=self.random_state
              )
              self.children[2].build_tree(
                  X,
                  y,
                  thresholds,
                  entropy,
                  distribution,
                  depth + 1,
                  max_depth,
                  n_classes,
                  True,
              )
      else:
          self.leaf_distribution = distribution / np.sum(distribution)
  
      return self
  
imports: import sys
  import numpy
  from sklearn import preprocessing
  from sklearn.base import BaseEstimator
  from sklearn.utils import check_random_state
  from sktime.exceptions import NotFittedError
label_desc: Use image node_id 2 for calling the _TreeNode obj's underlying member method code with example usage: obj.build_tree(X, y, thresholds, entropy, distribution, depth, max_depth, n_classes, leaf) and returns: self