Professional Documents
Culture Documents
Automatic Time Series Forecasting With Rego in R and Python
Automatic Time Series Forecasting With Rego in R and Python
Automatic Time Series Forecasting With Rego in R and Python
1 of 6 1/25/2022, 9:56 AM
Automatic Time Series Forecasting with rego in R and Python... https://medium.com/@davide.altomare/automatic-time-series-...
install.packages("rego")
2 of 6 1/25/2022, 9:56 AM
Automatic Time Series Forecasting with rego in R and Python... https://medium.com/@davide.altomare/automatic-time-series-...
library(rego)
Data=read.csv("https://app.channelattribution.net
/data/Data_air.csv",sep=";",header=FALSE)
colnames(Data)=c("target")
import pandas as pd
from rego import *
import plotly.express as px
Data=pd.read_csv("https://app.channelattribution.net
/data/Data_air.csv",sep=";",header=None)
Data.columns=["target"]
plot(Data$target,type="l",ylab="target")
3 of 6 1/25/2022, 9:56 AM
Automatic Time Series Forecasting with rego in R and Python... https://medium.com/@davide.altomare/automatic-time-series-...
fig = px.line(Data,y="target")
fig.show()
4 of 6 1/25/2022, 9:56 AM
Automatic Time Series Forecasting with rego in R and Python... https://medium.com/@davide.altomare/automatic-time-series-...
res=regpred(Data)
predictions=res$final$predictions
plot(predictions$real,type="l",ylim=c(min(predictions,n
a.rm=TRUE)*0.95,max(predictions,na.rm=TRUE)*1.05))
lines(predictions$predicted,col=”blue”)
lines(predictions$lower_bound,col=”red”)
lines(predictions$upper_bound,col=”red”)
predictions=res["final"]["predictions"]
fig = px.line(predictions)
fig.show()
5 of 6 1/25/2022, 9:56 AM
Automatic Time Series Forecasting with rego in R and Python... https://medium.com/@davide.altomare/automatic-time-series-...
6 of 6 1/25/2022, 9:56 AM