To make it easy to visualize, wrangle, and feature engineer time series data for forecasting and machine learning prediction.
Download the development version with latest features:
Or, download CRAN approved version:
Full Time Series Machine Learning and Feature Engineering Tutorial: Showcases the (NEW)
step_timeseries_signature() for building 200+ time series features using
There are many R packages for working with Time Series data. Here’s how
timetk compares to the “tidy” time series R packages for data visualization, wrangling, and feature engineeering (those that leverage data frames or tibbles).
|Data Structure||tibble (tbl)||tsibble (tbl_ts)||tsibble (tbl_ts)||tibbletime (tbl_time)|
|Interactive Plots (plotly)||✅||❌||❌||❌|
|Static Plots (ggplot)||✅||❌||✅||❌|
|Low to High Frequency||✅||❌||❌||❌|
|Sliding / Rolling||✅||✅||❌||✅|
|Feature Engineering (recipes)|
|Date Feature Engineering||✅||❌||❌||❌|
|Holiday Feature Engineering||✅||❌||❌||❌|
|Smoothing & Rolling||✅||❌||❌||❌|
|Cross Validation (rsample)|
|Time Series Cross Validation||✅||❌||❌||❌|
|Time Series CV Plan Visualization||✅||❌||❌||❌|
|Making Time Series (Intelligently)||✅||✅||❌||✅|
|Handling Holidays & Weekends||✅||❌||❌||❌|
|Automatic Frequency & Trend||✅||❌||❌||❌|
Investigate a time series…
taylor_30_min %>% plot_time_series(date, value, .color_var = week(date), .interactive = FALSE, .color_lab = "Week")
walmart_sales_weekly %>% group_by(Store, Dept) %>% plot_anomaly_diagnostics(Date, Weekly_Sales, .facet_ncol = 3, .interactive = FALSE)
Make a seasonality plot…
taylor_30_min %>% plot_seasonal_diagnostics(date, value, .interactive = FALSE)
Inspect autocorrelation, partial autocorrelation (and cross correlations too)…
taylor_30_min %>% plot_acf_diagnostics(date, value, .lags = "1 week", .interactive = FALSE)
timetk package wouldn’t be possible without other amazing time series packages.
timetkfunction that uses a period (frequency) argument owes it to
timetkmakes heavy use of
duration()for “time-based phrases”.
ts, and it’s predecessor is the
ts_impute_vec()function for low-level vectorized imputation using STL + Linear Interpolation uses
na.interp()under the hood.
ts_clean_vec()function for low-level vectorized imputation using STL + Linear Interpolation uses
tsclean()under the hood.
timetkdoes not import
tibbletime, it uses much of the innovative functionality to interpret time-based phrases:
seq.POSIXt()using a simple phase like “2012-02” to populate the entire time series from start to finish in February 2012.
between_time()- Uses innovative endpoint detection from phrases like “2012”
purrr-syntax for complex rolling (sliding) calculations.
tssystem, which is the same system the
forecastR package uses. A ton of inspiration for visuals came from using
Time series is changing. Businesses now need 10,000+ time series forecasts every day. This is what I call a High-Performance Time Series Forecasting System (HPTSF) - Accurate, Robust, and Scalable Forecasting.
High-Performance Forecasting Systems will save companies MILLIONS of dollars. Imagine what will happen to your career if you can provide your organization a “High-Performance Time Series Forecasting System” (HPTSF System).
I teach how to build a HPTFS System in my High-Performance Time Series Forecasting Course. If interested in learning Scalable High-Performance Forecasting Strategies then take my course. You will learn:
Modeltime- 30+ Models (Prophet, ARIMA, XGBoost, Random Forest, & many more)