$30 off During Our Annual Pro Sale. View Details »

Forecasting Based on Time series Historical Data

Forecasting Based on Time series Historical Data

Forecasting Based on Time series Historical Data

Avatar for Uriando Tjiangdiono

Uriando Tjiangdiono

February 03, 2018
Tweet

Other Decks in Technology

Transcript

  1. Disclaimer Presentations are intended for educational purposes only and not

    to replace independent professional judgment. Statements of facts, views, opinions expressed do not necessarily reflect those of Blibli.com.
  2. Profile • Uriando Tjiangdiono • R&D Engineer at Blibli.com •

    Part of R&D Team at Blibli.com • uriando.tjiangdiono@gdn- commerce.com
  3. Outline • Forecasting • Historical Data • Time series •

    Prophet • Make a Forecast • Question
  4. Forecasting • fore·cast \ ˈfȯr-ˌkast ; fȯr-ˈkast \ • to

    calculate or predict (some future event or condition) usually as a result of study and analysis of available pertinent data
  5. Historical Data • Past-periods data, used usually as a basis

    for forecasting the future data or trends – 1 Year ago – 1 Month ago – 1 Day ago – 1 Second ago Read more: http://www.businessdictionary.com/definition/his torical-data.html
  6. Time Series Component • The trend is the long term

    pattern of a time series. Trend (T) • Any pattern showing an up and down movement around a given trend is identified as a cyclical pattern Cyclical (C) • Seasonality occurs when the time series exhibits regular fluctuations during the same month (or months) every year, or during the same quarter every year. Seasonal (S) • This component is unpredictable. Every time series has some unpredictable component that makes it a random variable Irregular/Random (I)
  7. Use Cases • Sales Growth • Web Traffic • Stock

    Price • Stock and Demand Purchase • Human Population • ground Temperature • Capacity planning to efficiently allocate resources • etc
  8. Prophet • Procedure for forecasting time series data • Open

    source software released by Facebook’s Core Data Science team • Implemented in Python and R. • Provides completely automated forecasts that tunable • https://facebook.github.io/prophet
  9. Motivation • Producing high quality forecasts is not an easy

    problem • Completely automatic forecasting techniques can be brittle and often too inflexible. • Analysts who can produce high quality forecasts are quite rare.
  10. Where Prophet Shine • Hourly, daily, or weekly observations with

    at least a few months (preferably a year) of history • Strong multiple “human-scale” seasonalities: day of week and time of year • Important holidays that occur at irregular intervals that are known in advance (e.g. Harbolnas) • Missing observations or Large outliers • Shift in the trend • Trends that are non-linear growth curves, where a trend hits a natural limit or saturates
  11. Message from Creator • “We have found Prophet’s default settings

    to produce forecasts that are often accurate as those produced by skilled forecasters, with much less effort.” • “With Prophet, you are not stuck with the results of a completely automatic procedure if the forecast is not satisfactory — an analyst with no training in time series methods can improve or tweak forecasts using a variety of easily-interpretable parameters.”
  12. Example • Number of Bicycle Hires in London TFL(Transport for

    London) From 2010 - 2017 • https://data.london.gov.uk/dataset/number- bicycle-hires
  13. How It Works y(t)=g(t)+s(t)+h(t)+ϵt Where • y(t) is the variable

    we are predicting • g(t) models the growth (trend) of the data • s(t) models the periodic (seasonal) component of the data • h(t) is models the impact the holidays have on the data, • ϵt is the model error at time t
  14. Install • pip Install fbprophet • conda install -c conda-forge

    fbprophet • Requirements – Cython>=0.22 – pystan>=2.14 – numpy>=1.10.0 – pandas>=0.18.1 – matplotlib>=2.0.0
  15. Input a dataframe (pandas) with two columns: • ds =

    Datestamp • y = must be numeric and represents the measurement we wish to forecast.
  16. Main Feature • Saturating Forecasts • Trend Changepoints • Uncertainty

    Intervals • Seasonality And Holiday Effects • Non-Daily Data • Diagnostics
  17. Advantages • It’s fast, really fast! • Handles daily, weekly,

    monthly or yearly. • Completely automated forecasts that tunable • Irregular holidays can be taken care of.
  18. Advantages • In case the forecast is going beyond a

    certain limit based on business understanding, it can be fixed by setting up a forecasting cap and modelling using logarithmic growth instead of linear growth. • Outliers can be handled well by model itself without any requirement for imputation.
  19. Limitations • In case your time-series is highly irregular •

    Exogenous variables affecting the time series cannot be taken care using prophet. • Multiplicative models cannot be accounted for using prophet.
  20. Conclusion • Producing high quality forecasts is not an easy

    problem • Prophet fills in this gap and provides a very intuitive forecast and easy to use prophet function that can be used for forecasting