示例#1
0
 public void LearnHelper(TimeSeries ts, float p /*pearson*/, string f1, string f2, Point[] ps)
 {
     if (p > threshold)
     {
         int len = ts.getNumOfTimesteps();
         correlatedFeatures c = new correlatedFeatures(f1, f2, p, AnomalyDetectionUtil.LinearReg(ps, len), findThreshold(ps, len, AnomalyDetectionUtil.LinearReg(ps, len)) * (float)1.1);
         cf.Add(c);
     }
 }
示例#2
0
 public void UpdateAnomaly(List <AnomalyReport> ar, Point p, correlatedFeatures cor, int timeStepIndex, string f1, string f2)
 {
     if (AnomalyDetectionUtil.Dev(p, cor.LineReg) > cor.Threshhold)
     {
         string        desc  = f1 + "-" + f2;
         long          timeS = timeStepIndex + 1;
         AnomalyReport rep   = new AnomalyReport(desc, timeS);
         ar.Add(rep);
     }
 }
示例#3
0
 public void LearnHelper(TimeSeries ts, float p /*pearson*/, string f1, string f2, Point[] ps)
 {
     base.LearnHelper(ts, p, f1, f2, ps);
     if (p > 0.5 && p < maxC)
     {
         MinCircle          circ   = new MinCircle();
         Circle             circle = circ.findMinCircle(ps, ts.getNumOfTimesteps());
         correlatedFeatures c      = new correlatedFeatures(f1, f2, p, null, circle.radius * (float)1.1);
         c.CX = circle.center.x;
         c.CY = circle.center.y;
         base.CF.Add(c);
     }
 }
示例#4
0
 public void UpdateAnomaly(List <AnomalyReport> reportList, Point p, correlatedFeatures corF, int timeStepIndex, string f1, string f2)
 {
     // in case the correlated features are fulfill the condition of the parent class
     if (corF.Correlation >= maxC)
     {
         base.UpdateAnomaly(reportList, p, corF, timeStepIndex, f1, f2);
     }
     else
     {
         Circle    minCircle     = new Circle(new Point(corF.CX, corF.CY), corF.Threshhold);
         MinCircle minHelperCirc = new MinCircle();
         if (!minHelperCirc.isPointInsideCircle(p, minCircle))
         {
             // we will report as anomaly
             string        descr = f1 + "-" + f2;
             long          timeS = timeStepIndex + 1;
             AnomalyReport rep   = new AnomalyReport(descr, timeS);
             reportList.Add(rep);
         }
     }
 }