# LazyForecast
LazyForecast is a Python library for performing univariate time series analysis using a lazy forecasting approach. This approach is designed to provide quick and simple forecasting models without requiring extensive configuration or parameter tuning.
## Table of Contents
- [Installation](#installation)
- [Features](#features)
- [Usage](#usage)
- [Output](#output)
## Installation
You can install LazyForecast using pip:
```bash
pip install lazyforecast
```
## Features
- LazyForecasting automatically selects the best model based on the characteristics of the input time series.
- It supports univariate time series analysis.
- LazyForecasting provides functions for data preprocessing, model training, forecasting, and evaluation.
- It includes various popular forecasting models such as Auto ARIMA, Vanilla LSTM, and RNN.
## Usage
Here's an example of how to use the LazyForecast library to forecast stock prices using historical data:
```python
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
import yfinance as yf
import LazyForecast as lf
# Set the number of periods and steps for forecasting
n_periods = 50
n_steps = 5
# Create an instance of LazyForecast
ts = lf.LazyForecast(n_periods=n_periods, n_steps=n_steps, n_members=5)
# Specify the start and end dates for the data
start_date = '2021-01-01'
end_date = '2022-12-31'
# Fetch the historical stock data for Google
df = yf.download('GOOGL', start=start_date, end=end_date)
# Reset the index of the DataFrame
df.reset_index(level=0, inplace=True)
# Fit the data to the LazyForecast model and obtain evaluation metrics, forecasts, and confidence intervals
eval_df, fc, confint = ts.fit(df, x_axis='Date', y_axis='Close')
# Print the evaluation metrics for each model
print(eval_df)
```
## Output
### Auto-Regressive Integrated Moving Average (ARIMA)
![Imgur](https://i.imgur.com/ML90i3D.png)
### Multi-Layer Perceptron (MLP)
![Alt text](https://i.imgur.com/M2s8olH.png)
### Vanilla Long Short-Term Memory (LSTM)
![Alt text](https://i.imgur.com/R8KDORF.png)
### Stacked LSTM
![Alt text](https://i.imgur.com/lnW9IZd.png)
### Bi-directional LSTM
![Alt text](https://i.imgur.com/lrjYoFm.png)
### Recurrent Neural Network (RNN)
![Alt text](https://i.imgur.com/k4VQ6lH.png)
### Gated Recurrent Unit (GRU)
![Alt text](https://i.imgur.com/8hiG805.png)
### Evaluation Table
| model | mda | rmse | mape | R2 | mae | corr |
| :----------------- | -------: | ------: | --------: | -------: | ------: | -------: |
| ARIMA | 0.55102 | 2.62852 | 0.0208377 | 0.72456 | 1.9532 | 0.863465 |
| GRU | 0.55102 | 2.6993 | 0.0216135 | 0.667912 | 2.03898 | 0.85146 |
| BIDIRECTIONAL LSTM | 0.55102 | 2.72504 | 0.0220456 | 0.639895 | 2.08601 | 0.851686 |
| VANILLA LSTM | 0.55102 | 2.79671 | 0.0225355 | 0.630066 | 2.13659 | 0.848691 |
| STACKED LSTM | 0.510204 | 2.90771 | 0.0233817 | 0.581736 | 2.22243 | 0.851591 |
| MLP | 0.510204 | 7.57871 | 0.0664394 | -4.6669 | 6.66732 | 0.698219 |
| RNN | 0.469388 | 2.96933 | 0.0240381 | 0.609076 | 2.27333 | 0.821808 |
Raw data
{
"_id": null,
"home_page": "https://github.com/piyushsinghoffice/LazyForecast.git",
"name": "lazyforecast",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.9",
"maintainer_email": "",
"keywords": "arima,timeseries,forecasting,pyramid,pmdarima,pyramid-arima,scikit-learn,statsmodels,tensorflow,tensor,machine,learning",
"author": "Piyush Singh",
"author_email": "piyush.singh.office@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/93/b1/df60a089af7f62ff12a6b5fc0f90019eeb9db9ed486fb4abce5a564f77bd/lazyforecast-0.0.1.tar.gz",
"platform": null,
"description": "\n# LazyForecast\nLazyForecast is a Python library for performing univariate time series analysis using a lazy forecasting approach. This approach is designed to provide quick and simple forecasting models without requiring extensive configuration or parameter tuning.\n\n## Table of Contents\n- [Installation](#installation)\n- [Features](#features)\n- [Usage](#usage)\n- [Output](#output)\n\n## Installation\nYou can install LazyForecast using pip:\n```bash\npip install lazyforecast\n```\n\n## Features\n- LazyForecasting automatically selects the best model based on the characteristics of the input time series.\n- It supports univariate time series analysis.\n- LazyForecasting provides functions for data preprocessing, model training, forecasting, and evaluation.\n- It includes various popular forecasting models such as Auto ARIMA, Vanilla LSTM, and RNN.\n\n## Usage\nHere's an example of how to use the LazyForecast library to forecast stock prices using historical data:\n```python\nimport pandas as pd\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport yfinance as yf\nimport LazyForecast as lf\n\n# Set the number of periods and steps for forecasting\nn_periods = 50\nn_steps = 5\n\n# Create an instance of LazyForecast\nts = lf.LazyForecast(n_periods=n_periods, n_steps=n_steps, n_members=5)\n\n# Specify the start and end dates for the data\nstart_date = '2021-01-01'\nend_date = '2022-12-31'\n\n# Fetch the historical stock data for Google\ndf = yf.download('GOOGL', start=start_date, end=end_date)\n\n# Reset the index of the DataFrame\ndf.reset_index(level=0, inplace=True)\n\n# Fit the data to the LazyForecast model and obtain evaluation metrics, forecasts, and confidence intervals\neval_df, fc, confint = ts.fit(df, x_axis='Date', y_axis='Close')\n\n# Print the evaluation metrics for each model\nprint(eval_df)\n```\n\n## Output\n\n### Auto-Regressive Integrated Moving Average (ARIMA)\n![Imgur](https://i.imgur.com/ML90i3D.png)\n\n### Multi-Layer Perceptron (MLP)\n![Alt text](https://i.imgur.com/M2s8olH.png)\n\n### Vanilla Long Short-Term Memory (LSTM)\n![Alt text](https://i.imgur.com/R8KDORF.png)\n\n### Stacked LSTM\n![Alt text](https://i.imgur.com/lnW9IZd.png)\n\n### Bi-directional LSTM\n![Alt text](https://i.imgur.com/lrjYoFm.png)\n\n### Recurrent Neural Network (RNN)\n![Alt text](https://i.imgur.com/k4VQ6lH.png)\n\n### Gated Recurrent Unit (GRU)\n![Alt text](https://i.imgur.com/8hiG805.png)\n\n### Evaluation Table\n \n| model | mda | rmse | mape | R2 | mae | corr |\n| :----------------- | -------: | ------: | --------: | -------: | ------: | -------: |\n| ARIMA | 0.55102 | 2.62852 | 0.0208377 | 0.72456 | 1.9532 | 0.863465 |\n| GRU | 0.55102 | 2.6993 | 0.0216135 | 0.667912 | 2.03898 | 0.85146 |\n| BIDIRECTIONAL LSTM | 0.55102 | 2.72504 | 0.0220456 | 0.639895 | 2.08601 | 0.851686 |\n| VANILLA LSTM | 0.55102 | 2.79671 | 0.0225355 | 0.630066 | 2.13659 | 0.848691 |\n| STACKED LSTM | 0.510204 | 2.90771 | 0.0233817 | 0.581736 | 2.22243 | 0.851591 |\n| MLP | 0.510204 | 7.57871 | 0.0664394 | -4.6669 | 6.66732 | 0.698219 |\n| RNN | 0.469388 | 2.96933 | 0.0240381 | 0.609076 | 2.27333 | 0.821808 |\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "LazyForecast is a Python library for performing univariate time series analysis using a lazy forecasting approach. This approach is designed to provide quick and simple forecasting models without requiring extensive configuration or parameter tuning.",
"version": "0.0.1",
"project_urls": {
"Homepage": "https://github.com/piyushsinghoffice/LazyForecast.git"
},
"split_keywords": [
"arima",
"timeseries",
"forecasting",
"pyramid",
"pmdarima",
"pyramid-arima",
"scikit-learn",
"statsmodels",
"tensorflow",
"tensor",
"machine",
"learning"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "ccba476508dd31c5bf68625922a2ca116c2e937e6767f1d6c7f2a7f179743e4f",
"md5": "02cea29f50390765333f20ab55dfea67",
"sha256": "41cdf026f8e3606402712da9c80a518b2a93e86bd7347d80f5b8e1afee3486e9"
},
"downloads": -1,
"filename": "lazyforecast-0.0.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "02cea29f50390765333f20ab55dfea67",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.9",
"size": 8727,
"upload_time": "2023-06-27T10:10:25",
"upload_time_iso_8601": "2023-06-27T10:10:25.059474Z",
"url": "https://files.pythonhosted.org/packages/cc/ba/476508dd31c5bf68625922a2ca116c2e937e6767f1d6c7f2a7f179743e4f/lazyforecast-0.0.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "93b1df60a089af7f62ff12a6b5fc0f90019eeb9db9ed486fb4abce5a564f77bd",
"md5": "722a5c4347e99cf2a449ac8808f5d24a",
"sha256": "9a3de1fcae398d7843e668ce67c819d63d61cf6d77dbe8eebf7f4b5ffdaa02d3"
},
"downloads": -1,
"filename": "lazyforecast-0.0.1.tar.gz",
"has_sig": false,
"md5_digest": "722a5c4347e99cf2a449ac8808f5d24a",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.9",
"size": 8386,
"upload_time": "2023-06-27T10:10:26",
"upload_time_iso_8601": "2023-06-27T10:10:26.681714Z",
"url": "https://files.pythonhosted.org/packages/93/b1/df60a089af7f62ff12a6b5fc0f90019eeb9db9ed486fb4abce5a564f77bd/lazyforecast-0.0.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-06-27 10:10:26",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "piyushsinghoffice",
"github_project": "LazyForecast",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "lazyforecast"
}