class_docstr: Example:
      >>> #The dataset to detect is y
      >>> y = numpy.array(...)
      >>> ad = AEDetector(roll_len=24)
      >>> ad.fit(y)
      >>> anomaly_scores = ad.score()
      >>> anomaly_indexes = ad.anomaly_indexes()
class_docstr_tok: ["Example",":",">",">",">","#","The","dataset","to","detect","is","y",">",">",">","y","=","numpy.array","(","...",")",">",">",">","ad","=","AEDetector","(","roll_len=24",")",">",">",">","ad.fit","(","y",")",">",">",">","anomaly_scores","=","ad.score","(",")",">",">",">","anomaly_indexes","=","ad.anomaly_indexes","(",")"]
docstr: Gets the anomaly scores for each sample.
  All anomaly scores are positive numbers. Samples with larger scores are more
  likely the anomalies.
  If rolled, the anomaly score is calculated by aggregating the reconstruction
  errors of each point and subsequence.
  
  :return: the anomaly scores, in an array format with the same size as input
docstr_tok: ["Gets","the","anomaly","scores","for","each","sample",".","All","anomaly","scores","are","positive","numbers",".","Samples","with","larger","scores","are","more","likely","the","anomalies",".","If","rolled",",","the","anomaly","score","is","calculated","by","aggregating","the","reconstruction","errors","of","each","point","and","subsequence",".",":","return",":","the","anomaly","scores",",","in","an","array","format","with","the","same","size","as","input"]
code: def score(self):
      """
      Gets the anomaly scores for each sample.
      All anomaly scores are positive numbers. Samples with larger scores are more
      likely the anomalies.
      If rolled, the anomaly score is calculated by aggregating the reconstruction
      errors of each point and subsequence.
  
      :return: the anomaly scores, in an array format with the same size as input
      """
      from bigdl.nano.utils.common import invalidInputError
  
      if self.anomaly_scores_ is None:
          invalidInputError(
              False, "please call fit before calling score"
          )
  
      # if input is rolled
      if self.recon_err_subseq is not None:
          # recon_err = MinMaxScaler().fit_transform(self.recon_err)
          # recon_err_subseq = MinMaxscaler().fit_transform(self.recon_err_subseq.reshape(-1, 1))
          for index, e in np.ndenumerate(self.recon_err):
              agg_err = (
                  e + self.sub_scalef * self.recon_err_subseq[index[0]]
              )
              y_index = index[0] + index[1]
              # only keep the largest err score for each ts sample
              if agg_err > self.anomaly_scores_[y_index]:
                  self.anomaly_scores_[y_index] = agg_err
      else:
          self.anomaly_scores_ = self.recon_err
  
      self.anomaly_scores_ = scale_arr(
          self.anomaly_scores_.reshape(-1, 1)
      ).squeeze()
  
      return self.anomaly_scores_
  
file_path: BigDL/python/chronos/src/bigdl/chronos/detector/anomaly/ae_detector.py
imports: from bigdl.chronos.detector.anomaly.abstract import AnomalyDetector
  from bigdl.chronos.detector.anomaly.util import roll_arr, scale_arr
  import numpy
label_desc: Use image node_id 5 for calling the AEDetector obj's underlying member method code with example usage: obj.score() and returns: self