Facebook releases 'Prophet' -- its free forecasting tools -- for Python and R

Facebook releases 'Prophet' -- its free forecasting tools -- for Python and R

Facebook has open-sourced its Prophet forecasting tool, designed "to make it easier for experts and non-experts to make high-quality forecasts," according to a blog post by Sean J. Taylor and Ben Letham in the company's research team. "Forecasts are customizable in ways that are intuitive to non-experts," they wrote.

The code is available on GitHub in both Python and R.

Prophet is aimed specifically at business problems such as computer infrastructure capacity planning that have at least several months of data (preferably a year or more) and issues such as seasonality, "holidays" that can affect trends (such as Black Friday and Cyber Monday for retailers), and events that can have significant impacts (such as launching a new website when trying to forecast site traffic). Prophet can also handle some missing values and outliers, the blog post said.

Facebook suggests taking Prophet for a spin using page views from a Wikipedia page, data which is currently available on tools.wmflabs.org/pageviews. In R, data needs to be set up so it has two columns: one named ds containing dates, and the other with numerical data. The sample -- forecasting pageviews for Peyton Manning's Wikipedia page - changed the numerical data to a log scale with R's log() function. Basic Prophet forecasting steps:

  • A command such as my_model <- prophet(mydata) fits a model;
  • my_future <- make_future_dataframe(my_model, periods = 365) starts a data frame with an appropriate date column for both past and to-be-predicted dates;
  • my_forecast <- predict(my_model, my_future_df) generates the forecast;
  • plot(my_model, my_forecast) visualizes the forecast; and
  • prophet_plot_components(my_model, my_forecast) graphs trend and seasonal components of the forecast.
Sample plot of trends and seasonality Screenshot of graphic created by Facebook's Prophet tool

Sample plot of trends and seasonality using Facebook's Prophet in R.

To include holidays and other special events, you'd create a new data frame with a ds column for dates and a holiday column with the name of the holiday. That information can be included in the initial model with my_model <- Prophet(my_data, holidays = my_holidays). There's more about holidays in Prophet in the documentation.

Prophet was built using Stan, a probability programming language that connects with several popular analytics platforms such as MATLAB and Stata in addition to Python and R.

IDG Insider

PREVIOUS ARTICLE

«YouTube launches streaming TV service with 40 channels and unlimited cloud DVR storage

NEXT ARTICLE

Aruba's top exec, large customers talk about Wi-Fi’s present and future at Atmosphere»

Add Your Comment

Most Recent Comments

Our Case Studies

IDG Connect delivers full creative solutions to meet all your demand generatlon needs. These cover the full scope of options, from customized content and lead delivery through to fully integrated campaigns.

images

Our Marketing Research

Our in-house analyst and editorial team create a range of insights for the global marketing community. These look at IT buying preferences, the latest soclal media trends and other zeitgeist topics.

images

Poll

Should companies have Bitcoins on hand in preparation for a Ransomware attack?