Scotty is a ride-sharing business operating in several big cities in Turkey. The company provides motorcycle ride-sharing services for Turkey’s citizens, emphasizing efficiency in traveling through traffic. The app even makes reference to Star Trek with its "beam me up" order buttons.
Scotty has provided us with a real-time transaction dataset. With this dataset, we aim to assist them in solving forecasting and classification problems to improve their business processes.
As we approach the end of 2017, we need to prepare a forecast model to help Scotty anticipate end-of-year demands. However, since Scotty is relatively new, we do not have historical data for December. Therefore, we cannot rely on past demands to prepare forecasts for December's demands. Fortunately, time series analysis offers a solution to forecast future demands without relying on historical December data.
In this project, we will develop an automated forecasting framework to streamline the process of selecting forecast models, ensuring scalability and efficiency for future forecasting needs.
Libraries Used
- dplyr: Data manipulation and transformation.
- lubridate: Date and time manipulation.
- tidyverse: Collection of packages for data manipulation and visualization.
- forecast: Time series forecasting methods and tools.
- purrr: Functional programming tools.
- yardstick: Tools for model evaluation.
- recipes: Tools for creating and preprocessing model recipes.
- magrittr: Pipe operator for data manipulation.
- padr: Tools for handling time series data.
- tidyr: Tools for data tidying.
- ggpubr: Extension to ggplot2 for publication-ready plots.
- timetk: Tools for working with time series data in tidyverse.
- tidyquant: Tools for financial analysis and visualization.
- plotly: Interactive visualization library.
- ggplot2: Data visualization package.
Project Overview
- Data Exploration: Explore the ride-sharing transaction dataset to understand its structure and characteristics.
- Data Preprocessing: Clean and preprocess the data, handling missing values, and transforming variables as needed.
- Time Series Analysis: Apply time series forecasting methods to predict future demands, considering seasonality and trends.
- Model Evaluation: Evaluate the performance of the forecast models using appropriate metrics.
- Automated Forecasting Framework: Develop an automated framework for selecting and deploying forecast models, ensuring scalability and efficiency for future forecasting needs.
Future Steps
- Refine and optimize the forecasting models based on performance evaluation.
- Implement a classification model to address specific business problems related to ride-sharing services.
- Explore additional data sources to enrich the analysis and improve forecast accuracy.
- Continuously monitor and update the forecasting framework to adapt to changing business needs and market conditions.
Conclusion
The forecast from tbats
models showing a better performance for all and each sub-area. This online transportation case has two types of seasonality, daily and weekly. So we use stlm
, tbats
, and HoltWinter
.
Reference
- Algoritma Tech Blog. (2019) Purr-Operly Fitting Multiple Time Series Model
- Rob J Hyndman and George Athanasopoulos. (2018) Forecasting: Principles and Practice
- David Burba. (2018) An overview of time series forecasting models
Github: https://github.com/muslimalfatih/ml-playground/tree/master/ride-sharing-time-series
Demo: https://rpubs.com/muslimalfatih/time-series-ride-sharing