Skip to content

Additional features for Prophet time-series forecasting

License

Notifications You must be signed in to change notification settings

hoxo-m/prophetExt

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

prophetExt: Additional Features for Prophet Time-Series Forecasting

Installation

You can install the development version of prophetExt like so:

remotes::install_github("hoxo-m/prophetExt")

Example

This is a basic example which shows you how to solve a common problem:

df <- read.csv("https://raw.githubusercontent.com/facebook/prophet/master/examples/example_wp_log_R_outliers2.csv", skip = 337, col.names = c("ds", "y"))
head(df)
#>           ds        y
#> 1 2009-01-29 6.775366
#> 2 2009-01-19 6.799056
#> 3 2009-01-18 6.270988
#> 4 2009-01-13 7.197435
#> 5 2009-01-12 7.270313
#> 6 2009-01-11 6.710523
library(prophet)

model <- prophet(df)
df_future <- make_future_dataframe(model, 365)
fore <- predict(model, df_future)

plot(model, fore)

library(prophetExt)

outliers <- detect_outliers(model)

plot(model, fore) + autolayer(outliers)

plot_residuals_calendar(outliers)

df$y[df$ds %in% outliers$ds] <- NA

model <- prophet(df)
df_future <- make_future_dataframe(model, 365)
fore <- predict(model, df_future)

plot(model, fore)

About

Additional features for Prophet time-series forecasting

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Languages