class_docstr: A detector based on normal distribution.
  A normal distribution if fitted to data and then any points outside
  the range
      ``(mu - sig * z, mu + sig * z)``
  is considered an outliar, where
  
  - mu : mean of the data
  - sig : standard deviation of the data
  - z : the coefficient used for defining the confidence interval width.
      We assume ``z = stats.norm.ppf(p)`` for some ``p`` in ``(0.5, 1)`` range.
  
  This detector uses data to find the optimal ``p`` during fit.
  The optimizer implementation is inherited from
      `~greykite.detection.detector.detector.Detector`
class_docstr_tok: ["A","detector","based","on","normal","distribution",".","A","normal","distribution","if","fitted","to","data","and","then","any","points","outside","the","range","``","(","mu","-","sig","*","z",",","mu","+","sig","*","z",")","``","is","considered","an","outliar",",","where","-","mu",":","mean","of","the","data","-","sig",":","standard","deviation","of","the","data","-","z",":","the","coefficient","used","for","defining","the","confidence","interval","width",".","We","assume","``","z","=","stats.norm.ppf","(","p",")","``","for","some","``","p","``","in","``","(","0.5",",","1",")","``","range",".","This","detector","uses","data","to","find","the","optimal","``","p","``","during","fit",".","The","optimizer","implementation","is","inherited","from","`","~greykite.detection.detector.detector.Detector","`"]
code: def fit(self, data):
      df = data.df
      assert self.value_col in df.columns
      mu = np.mean(df[self.value_col])
      sig = np.std(df[self.value_col])
  
      default_param = {"mu": mu, "sig": sig}
  
      y_true = None
      data = Data(df=df, y_true=y_true)
  
      param_iterable = self.param_iterable
  
      optim_res = self.optimize_param(
          data=data,
          param_iterable=param_iterable,
          default_param=default_param,
      )
  
      self.fit_info = {
          "param": optim_res["best_param"],
          "param_full": optim_res["best_param_full"],
          "obj_value": optim_res["best_obj_value"],
          "param_obj_list": optim_res["param_obj_list"],
      }
  
      self.fitted_df = self.predict(Data(df=df.copy()))
  
imports: import numpy
  import pandas
  import pytest
  from scipy import stats
  from greykite.common.constants import PREDICTED_ANOMALY_COL
  from greykite.common.viz.timeseries_annotate import plot_lines_markers
  from greykite.detection.common.ad_evaluation import f1_score
  from greykite.detection.detector.data import DetectorData
  from greykite.detection.detector.detector import Detector
  from greykite.detection.detector.detector import build_anomaly_percent_reward
  from greykite.detection.detector.optimizer import CalcResult
  from greykite.detection.detector.reward import Reward
label_desc: Use image node_id 2 for calling the NormalDetector obj's underlying member method code with example usage: obj.fit(data) without return types