You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by GitBox <gi...@apache.org> on 2019/04/22 17:59:01 UTC

[GitHub] [incubator-pinot] xiaohui-sun commented on a change in pull request #4151: [TE] Add upper/lower/current to HoltWinters baseline

xiaohui-sun commented on a change in pull request #4151: [TE] Add upper/lower/current to HoltWinters baseline
URL: https://github.com/apache/incubator-pinot/pull/4151#discussion_r277374439
 
 

 ##########
 File path: thirdeye/thirdeye-pinot/src/main/java/org/apache/pinot/thirdeye/detection/components/HoltWintersDetector.java
 ##########
 @@ -416,14 +423,26 @@ public boolean apply(long... values) {
       lastGamma = params.getGamma();
 
       ForecastResults result = forecast(y, params.getAlpha(), params.getBeta(), params.getGamma());
+      double predicted = result.getPredictedValue();
+      double error = result.getErrorBound();
 
-      resultArray[k] = result.getPredictedValue();
-      errorArray[k] = result.getErrorBound();
+      // if current value doesn't have data then impute with 0
+      if (k < y.length) {
+        currentArray[k] = y[k];
+      } else {
+        currentArray[k] = 0;
 
 Review comment:
   good point. will change it to null.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org