class_docstr: Class implementing the Tree Traversal strategy in PyTorch for isolation forest model.
class_docstr_tok: ["Class","implementing","the","Tree","Traversal","strategy","in","PyTorch","for","isolation","forest","model","."]
docstr: Args:
      tree_parameters: The parameters defining the tree structure
      max_depth: The maximum tree-depth in the model
      n_features: The number of features input to the model
      classes: The classes used for classification. None if implementing a regression model
      extra_config: Extra configuration used to properly implement the source tree
docstr_tok: ["Args",":","tree_parameters",":","The","parameters","defining","the","tree","structure","max_depth",":","The","maximum","tree-depth","in","the","model","n_features",":","The","number","of","features","input","to","the","model","classes",":","The","classes","used","for","classification",".","None","if","implementing","a","regression","model","extra_config",":","Extra","configuration","used","to","properly","implement","the","source","tree"]
code: def __init__(
      self,
      logical_operator,
      tree_parameters,
      max_depth,
      n_features,
      classes=None,
      extra_config={},
  ):
      """
      Args:
          tree_parameters: The parameters defining the tree structure
          max_depth: The maximum tree-depth in the model
          n_features: The number of features input to the model
          classes: The classes used for classification. None if implementing a regression model
          extra_config: Extra configuration used to properly implement the source tree
      """
      super(TreeTraversalIsolationForestImpl, self).__init__(
          logical_operator,
          tree_parameters,
          max_depth,
          n_features,
          classes,
          n_classes=None,
          anomaly_detection=True,
      )
  
      # Assign the required constants.
      if constants.OFFSET in extra_config:
          self.offset = extra_config[constants.OFFSET]
      if constants.MAX_SAMPLES in extra_config:
          self.max_samples = extra_config[constants.MAX_SAMPLES]
      # Backward compatibility for sklearn <= 0.21
      if constants.IFOREST_THRESHOLD in extra_config:
          self.offset += extra_config[constants.IFOREST_THRESHOLD]
      self.final_probability_divider = len(tree_parameters)
      self.average_path_length = _average_path_length(
          np.array([self.max_samples])
      )[0]
  
imports: import numpy
  from onnxconverter_common.registration import register_converter
  from ..None import constants
  from .._tree_commons import get_parameters_for_sklearn_common, get_parameters_for_tree_trav_sklearn, get_tree_params_and_type, get_parameters_for_gemm_common
  from .._tree_implementations import TreeImpl, GEMMTreeImpl, TreeTraversalTreeImpl, PerfectTreeTraversalTreeImpl
label_desc: Use image node_id 1 to create a new TreeTraversalIsolationForestImpl object from inherited base classes: TreeTraversalTreeImpl with example: obj = TreeTraversalIsolationForestImpl(logical_operator, tree_parameters, max_depth, n_features, classes, extra_config)