|
5 | 5 | #' @format [`R6Class`][R6::R6Class] object inheriting from [`PipeOpTaskPreprocSimple`]/[`PipeOpTaskPreproc`]/[`PipeOp`].
|
6 | 6 | #'
|
7 | 7 | #' @description
|
8 |
| -#' Based on `POSIXct`/`Date` columns of the data, a set of date related features is computed and added to |
9 |
| -#' the feature set of the output task. If no `POSIXct` or `Date` column is found, the original task is |
10 |
| -#' returned unaltered. This functionality is based on the `add_datepart()` and |
11 |
| -#' `add_cyclic_datepart()` functions from the `fastai` library. If operation on only particular |
12 |
| -#' `POSIXct`/`Date` columns is requested, use the `affect_columns` parameter inherited from |
13 |
| -#' [`PipeOpTaskPreprocSimple`]. |
| 8 | +#' Based on `POSIXct`/`Date` columns of the data, a set of date related features is computed and |
| 9 | +#' added to the feature set of the output task. If no `POSIXct` or `Date` column is found, the |
| 10 | +#' original task is returned unaltered. This functionality is based on the `add_datepart()` and |
| 11 | +#' `add_cyclic_datepart()` functions from the \CRANpkg{fastai} package. If operation on only |
| 12 | +#' particular `POSIXct`/`Date` columns is requested, use the `affect_columns` parameter inherited |
| 13 | +#' from [`PipeOpTaskPreprocSimple`]. |
| 14 | +#' |
| 15 | +#' For `Date` columns, the features `"hour"`, `"minute"`, `"second"`, and `"is_day"` are skipped. |
14 | 16 | #'
|
15 | 17 | #' If `cyclic = TRUE`, cyclic features are computed for the features `"month"`, `"week_of_year"`,
|
16 | 18 | #' `"day_of_year"`, `"day_of_month"`, `"day_of_week"`, `"hour"`, `"minute"` and `"second"`. This
|
@@ -259,7 +261,7 @@ compute_cyclic_date_features = function(date_features, features, date_var) {
|
259 | 261 | }
|
260 | 262 |
|
261 | 263 | get_weeks_per_year = function(year) {
|
262 |
| - as.integer(format(as.POSIXct(paste0(year, "-12-31"), format = c("%Y-%m-%d")), "%U")) |
| 264 | + as.integer(format(as.POSIXct(paste0(year, "-12-31"), format = "%Y-%m-%d"), "%U")) |
263 | 265 | }
|
264 | 266 |
|
265 | 267 | is_leap_year = function(year) {
|
|
0 commit comments