code: def test_threshold_minmax(self):
      sample_num = 10
      feature_dim = 5
      num_anomaly = 5
      # actual value
      y_test = np.zeros(sample_num * feature_dim)
  
      gen_rand_indexes = [0, 7, 16, 33, 45]
      y_test[gen_rand_indexes] = 10
      y_test = y_test.reshape((sample_num, feature_dim))
  
      td = ThresholdDetector()
      td.set_params(threshold=(-1, 1))
      td.fit(y_test)
      anomaly_scores = td.score()
      assert len(set(np.where(anomaly_scores > 0)[0])) == num_anomaly
      anomaly_indexes = td.anomaly_indexes()
      assert len(anomaly_indexes) == num_anomaly
  
file_path: analytics-zoo/pyzoo/test/zoo/chronos/detector/anomaly/test_th_detector.py
imports: import pytest
  import numpy
  import pandas
  from test.zoo.pipeline.utils.test_utils import ZooTestCase
  from zoo.chronos.forecaster.lstm_forecaster import LSTMForecaster
  from zoo.chronos.detector.anomaly import ThresholdDetector
label_desc: Use image node_id 8 for calling the TestThresholdDetector obj's underlying member method code with example usage: obj.test_threshold_minmax() without return types