Skip to content

akomarla/ExpSmoothing

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

52 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Introduction

A simple introduction to statistical learning in time-series forecasting. This model is a lightweight and easy to understand example of model traning, testing and implementation. The package enables one to build, train and test a time-series forcasting model using the Simple Exponential Smoothing method.

Learn more here: https://machinelearningmastery.com/exponential-smoothing-for-time-series-forecasting-in-python/

Usage

pip install ExpSmoothing (Python version 3.10.0 or greater is advised)

Model

Simple Exponential Smoothing can be interpreted as a weighted sum of the time-series values wherein the weights are exponentially increasing (greater importance to future values in the time-series). The "alpha" value or the smoothing parameter lies between 0 and 1: the alpha value is directly proportional to the exponentially increasing nature of the weights.

Learn more here: https://btsa.medium.com/introduction-to-exponential-smoothing-9c2d5909a714

Error metrics

Simply put, training the model involves finding the "alpha" value that minimizes the forecast error (difference between true and forecasted values). In this implementation, one can choose from the following error metrics to obtain the optimal "alpha" value:

Error (Cost Function) Parameter Formula
Mean Squared Error (MSE) mean squared error
Root Mean Squared Error (RMSE) root mean squared error
Mean Absolute Error (MAE) mean absolute error
Mean Absolute Percentage Error (MAPE) mean absolute percentage error

Where n represents the number of time-series in the data set.

is the difference between the true and forecasted future values of the time-series i in n.

Learn more about the different cost functions here: https://www.analyticsvidhya.com/blog/2021/10/evaluation-metric-for-regression-models/

Implementation

This model is trained and tested on the M4 dataset of the Makridakis Time-Series Forecasting Competition: https://github.com/Mcompetitions/M4-methods/tree/master/Dataset (Daily-train.csv and Daily-test.csv) using the mean absolute percentage error metric from the table above.

Questions

Contact aparna.komarla@gmail.com with any questions.

About

A simple introduction to statistical learning for time-series forecasting using the Holt Simple Exponential Smoothing method

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages