2 Replies Latest reply on Mar 8, 2016 5:07 PM by Bora Beran

    Show Results of accuracy function in tableau

    Scot Shields

      I'm using the code below to forecast with r in tableau.  I'm appending the 20 hour forecast on to the end of a year of SaleCount data.

       

       

      I would like to also be able to show the accuracy of the forecast. 

       

       

      I would like to be able to show the results of the accuracy function from r, for example:

       

       

          fcastAccuracy<-accuracy(fcast, tsTest)

          fcastAccuracy[2,2] ##RMSE

       

       

      in tableau, maybe as a text table or as a tooltip when you hover over the forecast on the visualization.

       

       

      Does anyone know how to show the accuracy of a forecast in tableau either visually, or just by displaying say the RMSE value from accuracy as a tooltip when you hover over the forecast in the visualization?

       

       

      Code:

       

       

          SCRIPT_REAL("library(forecast);

          l<-length(.arg1);

          u<-.arg1[1:(l-.arg2[1])];

          n<-length(u);

          u[n]=.arg1[l];

          jjearnts <- ts(u,frequency=24);

          fcast <- forecast(jjearnts, h=.arg2[1]);

          append(u,fcast$mean, after = n)",

          [SaleCount],[PeriodsToForecast])