Auto — TS — Ensemble
Auto — TS — Ensemble
A powerful combination of TS and Deep Learning for Time Series Forecasting.
Hello there, how're things being with you? i hope its great likewise.
Today I will bring you a powerful approach combining the widely used Facebook Prophet time series analysis with deep learning Neural Prophet clubbed together into an ensemble approach.
In simple words “combing the best of two worlds” in one package.
Applying the same approach takes a lot of coding and things become messy afterward, especially for automation.
Developed by me so I kept the ensemble package name as “auto_ts_ensemble”.
Package repo: https://pypi.org/project/auto-ts-ensemble/
Let’s see how can we use the package!
#load the dataset
import pandas as pd
data = pd.read_csv("sample_data.csv")
The dataset needs to be in ‘ds’ and ‘y’ format
ds: the time stamp. y: is the value that we wish to forecast.
#Install the package
pip install auto-ts-ensemble
from auto_ts_ensemble_rupakbob import auto_ts_ensemble
#call the package function 1
results = auto_ts_ensemble.neural_analysis(data,freq="H")
###access the model
neural_prophet = results[0]
###access the metrics
metrics = results[1]
###access the predictions
predictions = results[2]
####plot the components
neural_prophet.plot_components(predictions)
#--------------------------------------------
#call the package function 2
results2 = auto_ts_ensemble.ts_analysis(data,n_future=7)
#access the model
ts_model = results2[0]
#access the predictions
predictions2 = results2[1]
#plot the components
ts_model.plot_components(predictions2)
#---------------------------------------------------
#call the package function 3 ensemble
ensemble_predictions = auto_ts_ensemble.ensemble_analysis(predictions,predictions2)
I will be updating with more features and options while you can use the documentation to view all the available parameters
You see in just a few lines of code we are able to do the heavy lifting of an ensemble approach.
I hope you enjoyed it. Feel free to use it and let me know any improvements or contributions are most welcome.
Next, we will try to develop a genetic-based auto-ml approach that should be able to mutate to survive or blend in.
In other words, A genetic algorithm is a search heuristic that is inspired by Charles Darwin’s theory of natural evolution. This algorithm reflects the process of natural selection where the fittest individuals are selected for reproduction in order to produce offspring of the next generation. :)
Some of my alternative internet presences Facebook, Instagram, Udemy, Blogger, Issuu, Slideshare, Scribd, and more.
Also available on Quora @ https://www.quora.com/profile/Rupak-Bob-Roy
Comments
Post a Comment