You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: R/PipeOpSplines.R
+42-39Lines changed: 42 additions & 39 deletions
Original file line number
Diff line number
Diff line change
@@ -9,7 +9,6 @@
9
9
#'
10
10
#' Depending on the type parameter, constructs polynomial B-splines [`splines::bs()`] or natural cubic splines [`splines::ns()`] for the respective column.
11
11
#'
12
-
#'
13
12
#' @section Construction:
14
13
#' ```
15
14
#' po("splines", param_vals = list())
@@ -31,32 +30,31 @@
31
30
#'
32
31
#' @section Parameters:
33
32
#' The parameters are the parameters inherited from [`PipeOpTaskPreproc`], as well as:
34
-
#' * `type` :: `character(1)` \cr
35
-
#' `polynomial` when polynomial splines are applied [`splines::bs`] or
36
-
#' `natural` when natural splines are applied [`splines::ns`].
37
-
#' Default is `natural`.
33
+
#' * `type` :: `character(1)` \cr
34
+
#' Controls the type of splines that are to be created. Can be either `polynomial` ([`splines::bs`])
35
+
#' or `natural` ([`splines::ns`]). Initializied to `natural`.
38
36
#' * `df` :: `integer(1)` \cr
39
-
#' Number of degrees of freedom for calculation of splines basis matrix.
40
-
#' Default is `NULL`.
41
-
#' For further information look up [`splines::bs()`] or [`splines::ns()`].
37
+
#' Number of degrees of freedom for calculation of the spline basis matrix. Initialized to `NULL`.
38
+
#' Depending on `type`, see either [`splines::bs()`] or [`splines::ns()`].
42
39
#' * `knots` :: named `list` \cr
43
-
#' The internal breakpoints that define the spline. Parameter has to be passed as a named list.
44
-
#' Default is `NULL`. For further information consult [`splines::bs()`] or [`splines::ns()`].
40
+
#' Internal breakpoints that define the spline, given as a named list of numeric vectors,
41
+
#' where each name corresponds to a feature and its value specifies the knots for that feature.
42
+
#' Initialized to `NULL`. Depending on `type`, see either [`splines::bs()`] or [`splines::ns()`].
45
43
#' * `intercept` :: `logical(1)` \cr
46
44
#' If `TRUE`, an intercept is included in the basis. Default is `FALSE`.
47
-
#' For further information look up [`splines::bs()`] or [`splines::ns()`].
45
+
#' Depending on `type`, see either [`splines::bs()`] or [`splines::ns()`].
48
46
#' * `degree` :: `integer(1)` \cr
49
-
#' This parameter depends on type = "polynomial". Degree of the polynomial used to compute B-splines.
50
-
#' Default is `3`. For further information look up [`splines::bs()`].
47
+
#' Degree of the polynomial used to compute polynomial splines. Only used if `type` is `"polynomial"`.
48
+
#' Default is `3`. See [`splines::bs()`].
51
49
#' * `Boundary.knots` :: named `list` \cr
52
-
#' Boundary points at which to anchor the spline basis. Parameter has to be passed as a named list.
53
-
#' Default is `NULL`.
54
-
#' For further information look up [`splines::bs()`] or [`splines::ns()`].
50
+
#' Boundary points at which to anchor the spline basis, given as a named list of numeric vectors,
51
+
#' where each name corresponds to a feature and its value specifies the boundary points for that feature.
52
+
#' Initialized to `NULL`. Depending on `type`, see either [`splines::bs()`] or [`splines::ns()`].
55
53
#'
56
54
#' @section Internals:
57
-
#' Creates spline basis via [`splines::bs`]/[`splines::ns`] function depending on `type`.
58
-
#' After training, the `Boundary.knots` that are either defined in the Parameter Set
59
-
#' or have been calculated during training will be passed to the `$state` of the PipeOp.
55
+
#' Creates a spline basis using either [`splines::bs`] or [`splines::ns`] depending on the hyperparameter `type`.
56
+
#' After training, the `Boundary.knots` that were either provided by the user or calculated during training are
0 commit comments