Skip to content

Commit

Permalink
docs: missing docs
Browse files Browse the repository at this point in the history
  • Loading branch information
m-muecke committed Jan 24, 2025
1 parent 9858208 commit a7995cc
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 2 deletions.
3 changes: 2 additions & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ Imports:
mlr3misc (>= 0.15.0),
mlr3pipelines (>= 0.7.1),
paradox (>= 1.0.1),
R6 (>= 2.5.0)
R6 (>= 2.5.0),
stats
Suggests:
forecast,
testthat (>= 3.2.0),
Expand Down
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,5 @@ import(mlr3)
import(mlr3misc)
import(mlr3pipelines)
import(paradox)
importFrom(stats,as.ts)
importFrom(utils,bibentry)
2 changes: 1 addition & 1 deletion R/TaskFcstElectricty.R
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ load_task_electricty = function(id = "electricity") {
setnames(dt, tolower)
demand = temperature = holiday = NULL
dt = dt[,
.(demand = sum(demand), temperature = max(temperature), holiday = any(holiday)),
list(demand = sum(demand), temperature = max(temperature), holiday = any(holiday)),
by = date
]
b = as_data_backend(dt)
Expand Down
5 changes: 5 additions & 0 deletions R/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ as.ts.TaskFcst = function(x, ...) { # nolint
stats::ts(x$truth(), freq = freq)
}

#' Generate new data for a forecast task
#'
#' @param task [TaskFcst]
#' @param n (`integer(1)`) number of new data points to generate. Default `1L`.
#' @return A `data.frame()` with `n` new data points.
#' @export
generate_newdata = function(task, n = 1L) {
assert_count(n)
Expand Down
1 change: 1 addition & 0 deletions R/zzz.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#' @import mlr3misc
#' @import mlr3pipelines
#' @import paradox
#' @importFrom stats as.ts
"_PACKAGE"

mlr3forecast_resamplings = new.env()
Expand Down
19 changes: 19 additions & 0 deletions man/generate_newdata.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit a7995cc

Please sign in to comment.