Skip to main content

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.

Project description

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

You can install LazyForecast using pip:

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:

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

Multi-Layer Perceptron (MLP)

Alt text

Vanilla Long Short-Term Memory (LSTM)

Alt text

Stacked LSTM

Alt text

Bi-directional LSTM

Alt text

Recurrent Neural Network (RNN)

Alt text

Gated Recurrent Unit (GRU)

Alt text

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

lazyforecast-0.0.1.tar.gz (8.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

lazyforecast-0.0.1-py3-none-any.whl (8.7 kB view details)

Uploaded Python 3

File details

Details for the file lazyforecast-0.0.1.tar.gz.

File metadata

  • Download URL: lazyforecast-0.0.1.tar.gz
  • Upload date:
  • Size: 8.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.4

File hashes

Hashes for lazyforecast-0.0.1.tar.gz
Algorithm Hash digest
SHA256 9a3de1fcae398d7843e668ce67c819d63d61cf6d77dbe8eebf7f4b5ffdaa02d3
MD5 722a5c4347e99cf2a449ac8808f5d24a
BLAKE2b-256 93b1df60a089af7f62ff12a6b5fc0f90019eeb9db9ed486fb4abce5a564f77bd

See more details on using hashes here.

File details

Details for the file lazyforecast-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: lazyforecast-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 8.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.4

File hashes

Hashes for lazyforecast-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 41cdf026f8e3606402712da9c80a518b2a93e86bd7347d80f5b8e1afee3486e9
MD5 02cea29f50390765333f20ab55dfea67
BLAKE2b-256 ccba476508dd31c5bf68625922a2ca116c2e937e6767f1d6c7f2a7f179743e4f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page