docstr: Outlier detector for tabular data using isolation forests.
  
  Parameters
  ----------
  threshold
      Threshold used for outlier score to determine outliers.
  n_estimators
      Number of base estimators in the ensemble.
  max_samples
      Number of samples to draw from the training data to train each base estimator.
      If int, draw 'max_samples' samples.
      If float, draw 'max_samples * number of features' samples.
      If 'auto', max_samples = min(256, number of samples)
  max_features
      Number of features to draw from the training data to train each base estimator.
      If int, draw 'max_features' features.
      If float, draw 'max_features * number of features' features.
  bootstrap
      Whether to fit individual trees on random subsets of the training data, sampled with replacement.
  n_jobs
      Number of jobs to run in parallel for 'fit' and 'predict'.
  data_type
      Optionally specify the data type (tabular, image or time-series). Added to metadata.
docstr_tok: ["Outlier","detector","for","tabular","data","using","isolation","forests",".","Parameters","--","--","--","--","--","threshold","Threshold","used","for","outlier","score","to","determine","outliers",".","n_estimators","Number","of","base","estimators","in","the","ensemble",".","max_samples","Number","of","samples","to","draw","from","the","training","data","to","train","each","base","estimator",".","If","int",",","draw","'max_samples","'","samples",".","If","float",",","draw","'max_samples","*","number","of","features","'","samples",".","If","'auto","'",",","max_samples","=","min","(","256",",","number","of","samples",")","max_features","Number","of","features","to","draw","from","the","training","data","to","train","each","base","estimator",".","If","int",",","draw","'max_features","'","features",".","If","float",",","draw","'max_features","*","number","of","features","'","features",".","bootstrap","Whether","to","fit","individual","trees","on","random","subsets","of","the","training","data",",","sampled","with","replacement",".","n_jobs","Number","of","jobs","to","run","in","parallel","for","'fit","'","and","'predict","'",".","data_type","Optionally","specify","the","data","type","(","tabular",",","image","or","time-series",")",".","Added","to","metadata","."]
code: def __init__(
      self,
      threshold: float = None,
      n_estimators: int = 100,
      max_samples: Union[str, int, float] = "auto",
      max_features: Union[int, float] = 1.0,
      bootstrap: bool = False,
      n_jobs: int = 1,
      data_type: str = "tabular",
  ) -> None:
      """
      Outlier detector for tabular data using isolation forests.
  
      Parameters
      ----------
      threshold
          Threshold used for outlier score to determine outliers.
      n_estimators
          Number of base estimators in the ensemble.
      max_samples
          Number of samples to draw from the training data to train each base estimator.
          If int, draw 'max_samples' samples.
          If float, draw 'max_samples * number of features' samples.
          If 'auto', max_samples = min(256, number of samples)
      max_features
          Number of features to draw from the training data to train each base estimator.
          If int, draw 'max_features' features.
          If float, draw 'max_features * number of features' features.
      bootstrap
          Whether to fit individual trees on random subsets of the training data, sampled with replacement.
      n_jobs
          Number of jobs to run in parallel for 'fit' and 'predict'.
      data_type
          Optionally specify the data type (tabular, image or time-series). Added to metadata.
      """
      super().__init__()
  
      if threshold is None:
          logger.warning(
              "No threshold level set. Need to infer threshold using `infer_threshold`."
          )
  
      self.threshold = threshold
      self.isolationforest = IsolationForest(
          n_estimators=n_estimators,
          max_samples=max_samples,
          max_features=max_features,
          bootstrap=bootstrap,
          n_jobs=n_jobs,
      )
  
      # set metadata
      self.meta["detector_type"] = "outlier"
      self.meta["data_type"] = data_type
      self.meta["online"] = False
  
file_path: alibi-detect/alibi_detect/od/isolationforest.py
imports: import logging
  import numpy
  from sklearn.ensemble import IsolationForest
  from typing import Dict, Union
  from alibi_detect.base import BaseDetector, FitMixin, ThresholdMixin, outlier_prediction_dict
label_desc: Use image node_id 1 to create a new IForest object from inherited base classes: BaseDetector, FitMixin, ThresholdMixin with example: obj = IForest(threshold, n_estimators, max_samples, max_features, bootstrap, n_jobs, data_type)