GithubHelp home page GithubHelp logo

prophet_plot_components(m, forecast) Error in rowSums(df[, holiday.comps]) : 'x' must be an array of at least two dimensions about prophet HOT 7 CLOSED

facebook avatar facebook commented on April 25, 2024
prophet_plot_components(m, forecast) Error in rowSums(df[, holiday.comps]) : 'x' must be an array of at least two dimensions

from prophet.

Comments (7)

xhesc avatar xhesc commented on April 25, 2024

Duplicate of #31

from prophet.

bletham avatar bletham commented on April 25, 2024

@azmorley if you install the Github version to get the fix in #39 does it work for you?

from prophet.

azmorley avatar azmorley commented on April 25, 2024

Doesn't seem to work for me, I'm getting the same issue still.

from prophet.

bletham avatar bletham commented on April 25, 2024

Can you paste your holidays dataframe so I can try to replicate? Also, what is the shape of forecast?

from prophet.

azmorley avatar azmorley commented on April 25, 2024

The holidays I'm using are our company's Black Friday sales period. We're trying to forecast the total number of orders, using weekly data going back to 2009. Our data has a couple of key sales periods but as Black Friday is by far the biggest spike, this is the only 'holiday' we have included at present.

BlackFridays <- data_frame(
  holiday = 'BlackFriday',
  ds = as.Date(c('2007-11-26', '2008-12-01', '2009-11-30', '2010-11-29', '2011-11-28', '2012-12-10'
                  ,'2013-12-02', '2014-11-28', '2015-11-27', '2016-11-25', '2017-11-24')),
  lower_window = 3,
  upper_window = 3
)

The forecast looks good, with a large spike around Black Friday and even a spike around the time of our main Summer sale. it fits the historical trend fairly well (though still can't quite fit the extreme number of orders we get around Black Friday).

> tail(forecast[c('ds', 'yhat', 'yhat_lower', 'yhat_upper', 'BlackFriday')])

            ds     yhat yhat_lower yhat_upper BlackFriday
430 2017-11-20 39153.40   35329.04   42721.88       0.000
431 2017-11-27 39560.27   35800.32   43521.27   -3518.919
432 2017-12-04 44010.21   39923.43   47756.38       0.000
433 2017-12-11 41848.96   37978.81   45582.00       0.000
434 2017-12-18 37880.10   34284.02   41330.70       0.000
435 2017-12-25 33780.24   29921.00   37436.34       0.000

from prophet.

bletham avatar bletham commented on April 25, 2024

I was able to replicate this error in the CRAN version, but it is working for me with the Github version. Could you try re-installing from Github one more time to see if the problem persists?
devtools::install_github('facebookincubator/prophet', subdir='R')

from prophet.

azmorley avatar azmorley commented on April 25, 2024

Ah yeah it works now, I must have messed up the install somehow!

Thanks :)

from prophet.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.