library(prophet)
Loading required package: Rcpp

Loading required package: rlang

df <- read.csv('../input/example-wp-log-peyton-manningcsv/example_wp_log_peyton_manning.csv')
m <- prophet(df)
Disabling daily seasonality. Run prophet with daily.seasonality=TRUE to override this.

future <- make_future_dataframe(m, periods = 365)
tail(future)
A data.frame: 6 × 1
ds
<dttm>
32652017-01-14
32662017-01-15
32672017-01-16
32682017-01-17
32692017-01-18
32702017-01-19
forecast <- predict(m, future)
tail(forecast[c('ds', 'yhat', 'yhat_lower', 'yhat_upper')])
A data.frame: 6 × 4
dsyhatyhat_loweryhat_upper
<dttm><dbl><dbl><dbl>
32652017-01-147.8241637.1023868.521943
32662017-01-158.2059427.5281818.897501
32672017-01-168.5309427.8010699.244370
32682017-01-178.3183277.6009919.028398
32692017-01-188.1509487.4443458.862147
32702017-01-198.1628397.4419778.899279
plot(m, forecast)
prophet_plot_components(m, forecast)
plot(m, forecast) + add_changepoints_to_plot(m)
m <- prophet(df, changepoint.prior.scale = 0.5)
forecast <- predict(m, future)
plot(m, forecast)
Disabling daily seasonality. Run prophet with daily.seasonality=TRUE to override this.

Download notebook

(0 downloads)

Post categories:

facebook prophet

r