0 Replies Latest reply on Oct 24, 2018 5:06 PM by Hunter Maxfield

    using prophet to forecast

    Hunter Maxfield

      Hey forums

       

      I am trying to use the forecasting package prophet using the r integration inside of tableau.  I have learned it within R studio, but would like to extend it to tableau now.  I have looked through the different threads bora beran has answered, along with his blog post.  However, I am still having a hard time.  Here are the problems I am facing:

      • Prophet requires a column that has the metric that needs to be forecasted.  However, I want to forecast by the number of rows we have for each day.  So there isn't really a column, however it is a very easy viz to create in tableau by just adding day date to the viz, along with count(number of records).  So far, I have just created that viz, then exported to excel, then done the forecast in r studio.  I would like to make this more dynamic.
      • The first question might also answer this question, but here is my calc field with an r script:

       

      SCRIPT_REAL("library(prophet);

      df <- data.frame(ds = seq(as.Date('2017/7/1'), by = 'day', length.out = 295), y=.arg1);

      m <- prophet(df)

      future <- make_future_dataframe(m, periods=92)

      forecast <- predict (m, future)

      forecast$yhat[1:295]

      ", COUNT([Row Id]))

       

      I know this is wrong, but it was what I was able to piece together with my limited prophet and r knowledge.  This spits out an error because the number of days since 2017/7/1 is different than the length.out number.  Like I said, I am not exactly sure if this script is even headed in the right direction, so feel free to go about it a completely different ways.

       

      Any help would be greatly appreciated. 

       

      Bora Beran - Tagging you because you have answered all questions i've found about this topic. 

       

      Thanks