docstr: Update threshold by a value inferred from the percentage of instances considered to be
  outliers in a sample of the dataset.
  
  Parameters
  ----------
  X
      Uniformly sampled time series instances.
  t
      Equidistant timestamps corresponding to each input instances (i.e, the array should contain
      numerical values in increasing order). If not provided, the timestamps will be replaced by an array of
      integers `[0, 1, ... , N - 1]`, where `N` is the size of the input time series.
  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","Uniformly","sampled","time","series","instances",".","t","Equidistant","timestamps","corresponding","to","each","input","instances","(","i.e",",","the","array","should","contain","numerical","values","in","increasing","order",")",".","If","not","provided",",","the","timestamps","will","be","replaced","by","an","array","of","integers","`","[","0",",","1",",","...",",","N","-","1","]","`",",","where","`","N","`","is","the","size","of","the","input","time","series",".","threshold_perc","Percentage","of","`","X","`","considered","to","be","normal","based","on","the","outlier","score","."]
code: def infer_threshold(
      self,
      X: np.ndarray,
      t: np.ndarray = None,
      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
          Uniformly sampled time series instances.
      t
          Equidistant timestamps corresponding to each input instances (i.e, the array should contain
          numerical values in increasing order). If not provided, the timestamps will be replaced by an array of
          integers `[0, 1, ... , N - 1]`, where `N` is the size of the input time series.
      threshold_perc
          Percentage of `X` considered to be normal based on the outlier score.
      """
      if t is None:
          t = np.arange(X.shape[0])
  
      # compute outlier scores
      iscore = self.score(X, t)
  
      # update threshold
      self.threshold = np.percentile(iscore, threshold_perc)
  
imports: import enum
  import logging
  import numpy
  from typing import Dict
  from alibi_detect.base import BaseDetector, ThresholdMixin, outlier_prediction_dict
  from alibi_detect.utils._types import Literal
label_desc: Use image node_id 2 for calling the SpectralResidual obj's underlying member method code with example usage: obj.infer_threshold(X, t, threshold_perc) without return types