I think there was an issue with importing the data. (Note that I always use the 'Import Dataset' button on the 'Environment' tab of RStudio to help me on this.)
library(tidyverse)
library(prophet)
df <- read_table(
file = "C:/temp.csv",
col_types = cols(ds = col_date(format = "%m/%d/%Y"))
)
Doing so gives you the following:
glimpse(df)
Rows: 34
Columns: 2
$ ds <date> 2020-01-01, 2020-01-02, 2020-01-03, 2020-01-04, 2020-01-05, 2020-01-06, 2020-01-07, 2020-01-08, 2020-01-…
$ y <dbl> 64, 158, 138, 86, 49, 273, 125, 350, 283, 256, 114, 56, 235, 281, 242, 256, 219, 100, 39, 233, 268, 240, …
And you can then run prophet:
m <- prophet(df)
Disabling yearly seasonality. Run prophet with yearly.seasonality=TRUE to override this.
Disabling daily seasonality. Run prophet with daily.seasonality=TRUE to override this.
glimpse(m)
List of 32
$ growth : chr "linear"
$ changepoints : POSIXct[1:25], format: "2020-01-02" "2020-01-03" "2020-01-04" "2020-01-05" ...
$ n.changepoints : num 25
$ changepoint.range : num 0.8
$ yearly.seasonality : chr "auto"
$ weekly.seasonality : chr "auto"
$ daily.seasonality : chr "auto"
$ holidays : NULL
$ seasonality.mode : chr "additive"
$ seasonality.prior.scale: num 10
$ changepoint.prior.scale: num 0.05
$ holidays.prior.scale : num 10
$ mcmc.samples : num 0
$ interval.width : num 0.8
$ uncertainty.samples : num 1000
$ specified.changepoints : logi FALSE
$ start : POSIXct[1:1], format: "2020-01-01"
$ y.scale : num 350
$ logistic.floor : logi FALSE
$ t.scale : num 2851200
$ changepoints.t : num [1:25] 0.0303 0.0606 0.0909 0.1212 0.1515 ...
$ seasonalities :List of 1
..$ weekly:List of 5
.. ..$ period : num 7
.. ..$ fourier.order : num 3
.. ..$ prior.scale : num 10
.. ..$ mode : chr "additive"
.. ..$ condition.name: NULL
$ extra_regressors : list()
$ country_holidays : NULL
$ stan.fit :List of 4
..$ par :List of 6
.. ..$ k : num 0.16
.. ..$ m : num 0.456
.. ..$ delta : num [1:25(1d)] 1.75e-09 -2.09e-09 7.43e-10 -2.43e-09 -1.36e-09 ...
.. ..$ sigma_obs: num 0.129
.. ..$ beta : num [1:6(1d)] -0.1881 0.1493 0.1513 0.0209 -0.0693 ...
.. ..$ trend : num [1:34(1d)] 0.456 0.461 0.466 0.47 0.475 ...
..$ value : num 52.6
..$ return_code: int 0
..$ theta_tilde: num [1, 1:68] 1.60e-01 4.56e-01 1.75e-09 -2.09e-09 7.43e-10 ...
.. ..- attr(*, "dimnames")=List of 2
$ params :List of 6
..$ k : num 0.16
..$ m : num 0.456
..$ delta : num [1, 1:25] 1.75e-09 -2.09e-09 7.43e-10 -2.43e-09 -1.36e-09 ...
..$ sigma_obs: num 0.129
..$ beta : num [1, 1:6] -0.1881 0.1493 0.1513 0.0209 -0.0693 ...
..$ trend : num [1:34(1d)] 0.456 0.461 0.466 0.47 0.475 ...
$ history : spec_tbl_df [34 × 5] (S3: spec_tbl_df/tbl_df/tbl/data.frame)
..$ ds : POSIXct[1:34], format: "2020-01-01" "2020-01-02" "2020-01-03" "2020-01-04" ...
..$ y : num [1:34] 64 158 138 86 49 273 125 350 283 256 ...
..$ floor : num [1:34] 0 0 0 0 0 0 0 0 0 0 ...
..$ t : num [1:34] 0 0.0303 0.0606 0.0909 0.1212 ...
..$ y_scaled: num [1:34] 0.183 0.451 0.394 0.246 0.14 ...
..- attr(*, "spec")=
.. .. cols(
.. .. ds = col_date(format = "%m/%d/%Y"),
.. .. y = col_double()
.. .. )
$ history.dates : POSIXct[1:34], format: "2020-01-01" "2020-01-02" "2020-01-03" "2020-01-04" ...
$ train.holiday.names : NULL
$ train.component.cols :'data.frame': 6 obs. of 3 variables:
..$ additive_terms : int [1:6] 1 1 1 1 1 1
..$ weekly : int [1:6] 1 1 1 1 1 1
..$ multiplicative_terms: num [1:6] 0 0 0 0 0 0
$ component.modes :List of 2
..$ additive : chr [1:4] "weekly" "additive_terms" "extra_regressors_additive" "holidays"
..$ multiplicative: chr [1:2] "multiplicative_terms" "extra_regressors_multiplicative"
$ fit.kwargs : list()
- attr(*, "class")= chr [1:2] "prophet" "list"