class_docstr: Isolation Forest
  
  Builds an Isolation Forest model. Isolation Forest algorithm samples the training frame
  and in each iteration builds a tree that partitions the space of the sample observations until
  it isolates each observation. Length of the path from root to a leaf node of the resulting tree
  is used to calculate the anomaly score. Anomalies are easier to isolate and their average
  tree path is expected to be shorter than paths of regular observations.
class_docstr_tok: ["Isolation","Forest","Builds","an","Isolation","Forest","model",".","Isolation","Forest","algorithm","samples","the","training","frame","and","in","each","iteration","builds","a","tree","that","partitions","the","space","of","the","sample","observations","until","it","isolates","each","observation",".","Length","of","the","path","from","root","to","a","leaf","node","of","the","resulting","tree","is","used","to","calculate","the","anomaly","score",".","Anomalies","are","easier","to","isolate","and","their","average","tree","path","is","expected","to","be","shorter","than","paths","of","regular","observations","."]
docstr: :param model_id: Destination id for this model; auto-generated if not specified.
         Defaults to ``None``.
  :type model_id: Union[None, str, H2OEstimator], optional
  :param training_frame: Id of the training data frame.
         Defaults to ``None``.
  :type training_frame: Union[None, str, H2OFrame], optional
  :param score_each_iteration: Whether to score during each iteration of model training.
         Defaults to ``False``.
  :type score_each_iteration: bool
  :param score_tree_interval: Score the model after every so many trees. Disabled if set to 0.
         Defaults to ``0``.
  :type score_tree_interval: int
  :param ignored_columns: Names of columns to ignore for training.
         Defaults to ``None``.
  :type ignored_columns: List[str], optional
  :param ignore_const_cols: Ignore constant columns.
         Defaults to ``True``.
  :type ignore_const_cols: bool
  :param ntrees: Number of trees.
         Defaults to ``50``.
  :type ntrees: int
  :param max_depth: Maximum tree depth (0 for unlimited).
         Defaults to ``8``.
  :type max_depth: int
  :param min_rows: Fewest allowed (weighted) observations in a leaf.
         Defaults to ``1.0``.
  :type min_rows: float
  :param max_runtime_secs: Maximum allowed runtime in seconds for model training. Use 0 to disable.
         Defaults to ``0.0``.
  :type max_runtime_secs: float
  :param seed: Seed for pseudo random number generator (if applicable)
         Defaults to ``-1``.
  :type seed: int
  :param build_tree_one_node: Run on one node only; no network overhead but fewer cpus used. Suitable for small
         datasets.
         Defaults to ``False``.
  :type build_tree_one_node: bool
  :param mtries: Number of variables randomly sampled as candidates at each split. If set to -1, defaults (number
         of predictors)/3.
         Defaults to ``-1``.
  :type mtries: int
  :param sample_size: Number of randomly sampled observations used to train each Isolation Forest tree. Only one
         of parameters sample_size and sample_rate should be defined. If sample_rate is defined, sample_size will
         be ignored.
         Defaults to ``256``.
  :type sample_size: int
  :param sample_rate: Rate of randomly sampled observations used to train each Isolation Forest tree. Needs to be
         in range from 0.0 to 1.0. If set to -1, sample_rate is disabled and sample_size will be used instead.
         Defaults to ``-1.0``.
  :type sample_rate: float
  :param col_sample_rate_change_per_level: Relative change of the column sampling rate for every level (must be >
         0.0 and <= 2.0)
         Defaults to ``1.0``.
  :type col_sample_rate_change_per_level: float
  :param col_sample_rate_per_tree: Column sample rate per tree (from 0.0 to 1.0)
         Defaults to ``1.0``.
  :type col_sample_rate_per_tree: float
  :param categorical_encoding: Encoding scheme for categorical features
         Defaults to ``"auto"``.
  :type categorical_encoding: Literal["auto", "enum", "one_hot_internal", "one_hot_explicit", "binary", "eigen", "label_encoder",
         "sort_by_response", "enum_limited"]
  :param stopping_rounds: Early stopping based on convergence of stopping_metric. Stop if simple moving average of
         length k of the stopping_metric does not improve for k:=stopping_rounds scoring events (0 to disable)
         Defaults to ``0``.
  :type stopping_rounds: int
  :param stopping_metric: Metric to use for early stopping (AUTO: logloss for classification, deviance for
         regression and anomaly_score for Isolation Forest). Note that custom and custom_increasing can only be
         used in GBM and DRF with the Python client.
         Defaults to ``"auto"``.
  :type stopping_metric: Literal["auto", "anomaly_score", "deviance", "logloss", "mse", "rmse", "mae", "rmsle", "auc", "aucpr",
         "misclassification", "mean_per_class_error"]
  :param stopping_tolerance: Relative tolerance for metric-based stopping criterion (stop if relative improvement
         is not at least this much)
         Defaults to ``0.01``.
  :type stopping_tolerance: float
  :param export_checkpoints_dir: Automatically export generated models to this directory.
         Defaults to ``None``.
  :type export_checkpoints_dir: str, optional
  :param contamination: Contamination ratio - the proportion of anomalies in the input dataset. If undefined (-1)
         the predict function will not mark observations as anomalies and only anomaly score will be returned.
         Defaults to -1 (undefined).
         Defaults to ``-1.0``.
  :type contamination: float
  :param validation_frame: Id of the validation data frame.
         Defaults to ``None``.
  :type validation_frame: Union[None, str, H2OFrame], optional
  :param validation_response_column: (experimental) Name of the response column in the validation frame. Response
         column should be binary and indicate not anomaly/anomaly.
         Defaults to ``None``.
  :type validation_response_column: str, optional
code: def __init__(
      self,
      model_id=None,  # type: Optional[Union[None, str, H2OEstimator]]
      training_frame=None,  # type: Optional[Union[None, str, H2OFrame]]
      score_each_iteration=False,  # type: bool
      score_tree_interval=0,  # type: int
      ignored_columns=None,  # type: Optional[List[str]]
      ignore_const_cols=True,  # type: bool
      ntrees=50,  # type: int
      max_depth=8,  # type: int
      min_rows=1.0,  # type: float
      max_runtime_secs=0.0,  # type: float
      seed=-1,  # type: int
      build_tree_one_node=False,  # type: bool
      mtries=-1,  # type: int
      sample_size=256,  # type: int
      sample_rate=-1.0,  # type: float
      col_sample_rate_change_per_level=1.0,  # type: float
      col_sample_rate_per_tree=1.0,  # type: float
      categorical_encoding="auto",  # type: Literal["auto", "enum", "one_hot_internal", "one_hot_explicit", "binary", "eigen", "label_encoder", "sort_by_response", "enum_limited"]
      stopping_rounds=0,  # type: int
      stopping_metric="auto",  # type: Literal["auto", "anomaly_score", "deviance", "logloss", "mse", "rmse", "mae", "rmsle", "auc", "aucpr", "misclassification", "mean_per_class_error"]
      stopping_tolerance=0.01,  # type: float
      export_checkpoints_dir=None,  # type: Optional[str]
      contamination=-1.0,  # type: float
      validation_frame=None,  # type: Optional[Union[None, str, H2OFrame]]
      validation_response_column=None,  # type: Optional[str]
  ):
      """
      :param model_id: Destination id for this model; auto-generated if not specified.
             Defaults to ``None``.
      :type model_id: Union[None, str, H2OEstimator], optional
      :param training_frame: Id of the training data frame.
             Defaults to ``None``.
      :type training_frame: Union[None, str, H2OFrame], optional
      :param score_each_iteration: Whether to score during each iteration of model training.
             Defaults to ``False``.
      :type score_each_iteration: bool
      :param score_tree_interval: Score the model after every so many trees. Disabled if set to 0.
             Defaults to ``0``.
      :type score_tree_interval: int
      :param ignored_columns: Names of columns to ignore for training.
             Defaults to ``None``.
      :type ignored_columns: List[str], optional
      :param ignore_const_cols: Ignore constant columns.
             Defaults to ``True``.
      :type ignore_const_cols: bool
      :param ntrees: Number of trees.
             Defaults to ``50``.
      :type ntrees: int
      :param max_depth: Maximum tree depth (0 for unlimited).
             Defaults to ``8``.
      :type max_depth: int
      :param min_rows: Fewest allowed (weighted) observations in a leaf.
             Defaults to ``1.0``.
      :type min_rows: float
      :param max_runtime_secs: Maximum allowed runtime in seconds for model training. Use 0 to disable.
             Defaults to ``0.0``.
      :type max_runtime_secs: float
      :param seed: Seed for pseudo random number generator (if applicable)
             Defaults to ``-1``.
      :type seed: int
      :param build_tree_one_node: Run on one node only; no network overhead but fewer cpus used. Suitable for small
             datasets.
             Defaults to ``False``.
      :type build_tree_one_node: bool
      :param mtries: Number of variables randomly sampled as candidates at each split. If set to -1, defaults (number
             of predictors)/3.
             Defaults to ``-1``.
      :type mtries: int
      :param sample_size: Number of randomly sampled observations used to train each Isolation Forest tree. Only one
             of parameters sample_size and sample_rate should be defined. If sample_rate is defined, sample_size will
             be ignored.
             Defaults to ``256``.
      :type sample_size: int
      :param sample_rate: Rate of randomly sampled observations used to train each Isolation Forest tree. Needs to be
             in range from 0.0 to 1.0. If set to -1, sample_rate is disabled and sample_size will be used instead.
             Defaults to ``-1.0``.
      :type sample_rate: float
      :param col_sample_rate_change_per_level: Relative change of the column sampling rate for every level (must be >
             0.0 and <= 2.0)
             Defaults to ``1.0``.
      :type col_sample_rate_change_per_level: float
      :param col_sample_rate_per_tree: Column sample rate per tree (from 0.0 to 1.0)
             Defaults to ``1.0``.
      :type col_sample_rate_per_tree: float
      :param categorical_encoding: Encoding scheme for categorical features
             Defaults to ``"auto"``.
      :type categorical_encoding: Literal["auto", "enum", "one_hot_internal", "one_hot_explicit", "binary", "eigen", "label_encoder",
             "sort_by_response", "enum_limited"]
      :param stopping_rounds: Early stopping based on convergence of stopping_metric. Stop if simple moving average of
             length k of the stopping_metric does not improve for k:=stopping_rounds scoring events (0 to disable)
             Defaults to ``0``.
      :type stopping_rounds: int
      :param stopping_metric: Metric to use for early stopping (AUTO: logloss for classification, deviance for
             regression and anomaly_score for Isolation Forest). Note that custom and custom_increasing can only be
             used in GBM and DRF with the Python client.
             Defaults to ``"auto"``.
      :type stopping_metric: Literal["auto", "anomaly_score", "deviance", "logloss", "mse", "rmse", "mae", "rmsle", "auc", "aucpr",
             "misclassification", "mean_per_class_error"]
      :param stopping_tolerance: Relative tolerance for metric-based stopping criterion (stop if relative improvement
             is not at least this much)
             Defaults to ``0.01``.
      :type stopping_tolerance: float
      :param export_checkpoints_dir: Automatically export generated models to this directory.
             Defaults to ``None``.
      :type export_checkpoints_dir: str, optional
      :param contamination: Contamination ratio - the proportion of anomalies in the input dataset. If undefined (-1)
             the predict function will not mark observations as anomalies and only anomaly score will be returned.
             Defaults to -1 (undefined).
             Defaults to ``-1.0``.
      :type contamination: float
      :param validation_frame: Id of the validation data frame.
             Defaults to ``None``.
      :type validation_frame: Union[None, str, H2OFrame], optional
      :param validation_response_column: (experimental) Name of the response column in the validation frame. Response
             column should be binary and indicate not anomaly/anomaly.
             Defaults to ``None``.
      :type validation_response_column: str, optional
      """
      super(H2OIsolationForestEstimator, self).__init__()
      self._parms = {}
      self._id = self._parms["model_id"] = model_id
      self.training_frame = training_frame
      self.score_each_iteration = score_each_iteration
      self.score_tree_interval = score_tree_interval
      self.ignored_columns = ignored_columns
      self.ignore_const_cols = ignore_const_cols
      self.ntrees = ntrees
      self.max_depth = max_depth
      self.min_rows = min_rows
      self.max_runtime_secs = max_runtime_secs
      self.seed = seed
      self.build_tree_one_node = build_tree_one_node
      self.mtries = mtries
      self.sample_size = sample_size
      self.sample_rate = sample_rate
      self.col_sample_rate_change_per_level = (
          col_sample_rate_change_per_level
      )
      self.col_sample_rate_per_tree = col_sample_rate_per_tree
      self.categorical_encoding = categorical_encoding
      self.stopping_rounds = stopping_rounds
      self.stopping_metric = stopping_metric
      self.stopping_tolerance = stopping_tolerance
      self.export_checkpoints_dir = export_checkpoints_dir
      self.contamination = contamination
      self.validation_frame = validation_frame
      self.validation_response_column = validation_response_column
  
imports: from h2o.estimators.estimator_base import H2OEstimator
  from h2o.exceptions import H2OValueError
  from h2o.frame import H2OFrame
  from h2o.utils.typechecks import assert_is_type, Enum, numeric
label_desc: Use image node_id 1 to create a new H2OIsolationForestEstimator object from inherited base classes: H2OEstimator with example: obj = H2OIsolationForestEstimator(model_id, training_frame, score_each_iteration, score_tree_interval, ignored_columns, ignore_const_cols, ntrees, max_depth, min_rows, max_runtime_secs, seed, build_tree_one_node, mtries, sample_size, sample_rate, col_sample_rate_change_per_level, col_sample_rate_per_tree, categorical_encoding, stopping_rounds, stopping_metric, stopping_tolerance, export_checkpoints_dir, contamination, validation_frame, validation_response_column)