docstr: Update threshold by a value inferred from the percentage of instances considered to be
  outliers in a sample of the dataset.
  
  Parameters
  ----------
  X
      Batch of instances.
  threshold_perc
      Percentage of X considered to be normal based on the outlier score.
docstr_tok: ["Update","threshold","by","a","value","inferred","from","the","percentage","of","instances","considered","to","be","outliers","in","a","sample","of","the","dataset",".","Parameters","--","--","--","--","--","X","Batch","of","instances",".","threshold_perc","Percentage","of","X","considered","to","be","normal","based","on","the","outlier","score","."]
code: def infer_threshold(
      self, X: np.ndarray, threshold_perc: float = 95.0
  ) -> None:
      """
      Update threshold by a value inferred from the percentage of instances considered to be
      outliers in a sample of the dataset.
  
      Parameters
      ----------
      X
          Batch of instances.
      threshold_perc
          Percentage of X considered to be normal based on the outlier score.
      """
      # compute outlier scores
      iscore = self.score(X)
  
      # update threshold
      self.threshold = np.percentile(iscore, threshold_perc)
  
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 3 for calling the IForest obj's underlying member method code with example usage: obj.infer_threshold(X, threshold_perc) without return types