Skip to content

API for LSTF-Linear, SOTA for time-series-forecasting.

Notifications You must be signed in to change notification settings

jodog0412/LTSF-linear-API

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LTSF-Linear-API

Description

API for using LTSF-Linear easily.

❓ What is the LTSF-Linear?

https://github.com/cure-lab/LTSF-Linear
LTSF-Linear is the SOTA of the long-time series forecasting model.
And this is from the paper "Are Transformers Effective for Time Series Forecasting?"

✨ Why is the LTSF-Linear?

  • High accessibility
    It is deep-learning model, but very efficient.
    So, you can use this model without expensive GPU.
  • High Performance

    (You can check this benchmark in this site)
    It recorded the highest performance on time-series-prediction.

Usage Examples

📈 Stock price prediction

  • Code
from function import *
import pandas as pd
from yahooquery import Ticker

raw=Ticker('AAPL').history(period='1y').xs('AAPL')
window_size,forecast_size=30,10

''' 1. preprocess raw data '''
date, data=split_data(raw,'adjclose')

''' 2. build dataloader '''
dataloader=build_dataLoader(data,
                            window_size=window_size,
                            forecast_size=forecast_size,
                            batch_size=4)

''' 3. train and evaluate '''
pred=trainer(data,
             dataloader,
             window_size=window_size,
             forecast_size=forecast_size).implement()

''' 4. plot the result '''
figureplot(date,data,pred,window_size,forecast_size)  
  • Data

  • Prediction

🚗 Mobility average velocity prediction

  • Code
from function import *
import pandas as pd

window_size, forecast_size = 24*7,24
raw=pd.read_csv('./data/서인천IC-부평IC 평균속도.csv',encoding='CP949').set_index('집계일시').drop('Unnamed: 0',axis=1)
plt.plot(raw)
plt.show()

''' 1. preprocess raw data '''
date, data=split_data(raw,0,index=True) 

''' 2. build dataloader '''
dataloader=build_dataLoader(data,
                            window_size=window_size,
                            forecast_size=forecast_size,
                            batch_size=4) 

''' 3. train and evaluate '''
pred=trainer(data,
             dataloader,
             window_size=window_size,
             forecast_size=forecast_size).implement() 

''' 4. plot the result ''' 
figureplot(date,data,pred,window_size,forecast_size) 
  • Data

  • Prediction

About

API for LSTF-Linear, SOTA for time-series-forecasting.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages