From e3ad97b8b36c607a73e032db3e857ce7d3b50aaf Mon Sep 17 00:00:00 2001 From: Ben Letham Date: Mon, 3 Dec 2018 13:25:26 -0800 Subject: [PATCH] Documentation fixes --- R/NAMESPACE | 2 -- R/R/make_holidays.R | 5 +++-- R/R/prophet.R | 6 ++++-- R/man/make_holidays_df.Rd | 2 ++ R/man/validate_inputs.Rd | 3 +++ python/fbprophet/plot.py | 1 + 6 files changed, 13 insertions(+), 6 deletions(-) diff --git a/R/NAMESPACE b/R/NAMESPACE index 7049d99..8cc7ac8 100644 --- a/R/NAMESPACE +++ b/R/NAMESPACE @@ -9,9 +9,7 @@ export(add_seasonality) export(cross_validation) export(dyplot.prophet) export(fit.prophet) -export(get_holiday_names) export(make_future_dataframe) -export(make_holidays_df) export(performance_metrics) export(plot_cross_validation_metric) export(plot_forecast_component) diff --git a/R/R/make_holidays.R b/R/R/make_holidays.R index 454d88a..1e0c65a 100644 --- a/R/R/make_holidays.R +++ b/R/R/make_holidays.R @@ -11,7 +11,7 @@ #' @param country.name Country name (character). #' #' @return A vector of all possible holiday names (unique) of given country. -#' @export +#' @internal get_holiday_names <- function(country.name){ holidays <- generated_holidays %>% dplyr::filter(country == country.name) %>% @@ -23,11 +23,12 @@ get_holiday_names <- function(country.name){ #' Make dataframe of holidays for given years and countries #' +#' @param years List of years for which to include holiday dates. #' @param country.name Country name (character). #' #' @return Dataframe with 'ds' and 'holiday', which can directly feed #' to 'holidays' params in Prophet -#' @export +#' @internal make_holidays_df <- function(years, country.name){ country.holidays = generated_holidays %>% dplyr::filter(country == country.name) diff --git a/R/R/prophet.R b/R/R/prophet.R index e22f1ec..a8425a6 100644 --- a/R/R/prophet.R +++ b/R/R/prophet.R @@ -8,10 +8,12 @@ ## Makes R CMD CHECK happy due to dplyr syntax below globalVariables(c( "ds", "y", "cap", ".", - "component", "dow", "doy", "holiday", "holidays", "holidays_lower", + "component", "dow", "doy", "holiday", "holidays", "holidays_lower", "generated_holidays", "holidays_upper", "ix", "lower", "n", "stat", "trend", "row_number", "extra_regressors", "col", "trend_lower", "trend_upper", "upper", "value", "weekly", "weekly_lower", "weekly_upper", - "x", "yearly", "yearly_lower", "yearly_upper", "yhat", "yhat_lower", "yhat_upper")) + "x", "yearly", "yearly_lower", "yearly_upper", "yhat", "yhat_lower", "yhat_upper", + "country", "year" +)) #' Prophet forecaster. #' diff --git a/R/man/make_holidays_df.Rd b/R/man/make_holidays_df.Rd index a5a368d..fb18286 100644 --- a/R/man/make_holidays_df.Rd +++ b/R/man/make_holidays_df.Rd @@ -7,6 +7,8 @@ make_holidays_df(years, country.name) } \arguments{ +\item{years}{List of years for which to include holiday dates.} + \item{country.name}{Country name (character).} } \value{ diff --git a/R/man/validate_inputs.Rd b/R/man/validate_inputs.Rd index 123e500..e9d87a8 100644 --- a/R/man/validate_inputs.Rd +++ b/R/man/validate_inputs.Rd @@ -9,6 +9,9 @@ validate_inputs(m) \arguments{ \item{m}{Prophet object.} } +\value{ +The Prophet object. +} \description{ Validates the inputs to Prophet. } diff --git a/python/fbprophet/plot.py b/python/fbprophet/plot.py index b08f4ab..246c03d 100644 --- a/python/fbprophet/plot.py +++ b/python/fbprophet/plot.py @@ -435,6 +435,7 @@ def plot_cross_validation_metric( In [0, 1]. Defaults to 0.1. ax: Optional matplotlib axis on which to plot. If not given, a new figure will be created. + figsize: Optional tuple width, height in inches. Returns -------