Skip to content

Commit

Permalink
refactor: changed type named and added initial value for ffs (#46)
Browse files Browse the repository at this point in the history
  • Loading branch information
m-muecke authored Aug 25, 2023
1 parent 9c8a4af commit 68ced3e
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 8 deletions.
4 changes: 3 additions & 1 deletion R/PipeOpFFS.R
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#' If the element if is function it requires the following arguments: `arg` and `value` and returns a `numeric`.
#' For string elements, the following predefined features are available:
#' `"mean"`, `"max"`,`"min"`,`"slope"`,`"median"`,`"var"`.
#' Initial is `c("mean", "max", "min", "slope", "median", "var")`
#' * `left` :: `numeric()` \cr
#' The left boundary of the window. Initial is `-Inf`.
#' The window is specified such that the all values >=left and <=right are kept for the computations.
Expand Down Expand Up @@ -106,7 +107,8 @@ PipeOpFFS = R6Class("PipeOpFFS",
param_set$set_values(
drop = FALSE,
left = -Inf,
right = Inf
right = Inf,
features = c("mean", "max", "min", "slope", "median", "var")
)

super$initialize(
Expand Down
2 changes: 1 addition & 1 deletion R/TaskRegr_dti.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#' to predict the PASAT score. `pasat` represents the PASAT score at each vist.
#' `subject_id` represents the subject ID. `cca` represents the fractional anisotropy tract profiles from the corpus
#' callosum. `sex` indicates subject's sex. `rcst` represents the fractional anisotropy tract profiles from the right
#' corticospinal tract. `case` indicates wether the subject has multiple sclerosis. Rows with NAs are removed.
#' corticospinal tract. `Rows with NAs are removed.
#'
#'
#' This is a subset of the full dataset, which is contained in the package `refund`.
Expand Down
2 changes: 1 addition & 1 deletion R/zzz.R
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ named_union = function(x, y) {
set_names(z, union(names(x), names(y)))
}

mlr3fda_feature_types = c(f_reg = "tfd_reg", f_irreg = "tfd_irreg")
mlr3fda_feature_types = c(tfr = "tfd_reg", tfi = "tfd_irreg")
mlr3fda_tasks = new.env()
mlr3fda_pipeops = new.env()

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ mlr_reflections$task_feature_types

## lgl int dbl chr fct ord
## "logical" "integer" "numeric" "character" "factor" "ordered"
## pxc f_reg f_irreg
## pxc tfr tfi
## "POSIXct" "tfd_reg" "tfd_irreg"

The newly available data types are:
Expand All @@ -83,7 +83,7 @@ task
## * Target: heatan
## * Properties: -
## * Features (3):
## - f_reg (2): NIR, UVVIS
## - tfr (2): NIR, UVVIS
## - dbl (1): h20

Currently there are no `Learner`s that directly operate on functional
Expand Down
3 changes: 1 addition & 2 deletions data-raw/dti.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ dti = data.table(
pasat = refund::DTI$pasat,
cca = tfd(refund::DTI$cca, arg = seq(0, 1, l = 93)),
rcst = tfd(refund::DTI$rcst, arg = seq(0, 1, l = 55)),
sex = refund::DTI$sex,
case = factor(ifelse(refund::DTI$case, "MS", "control"))
sex = refund::DTI$sex
)
dti = na.omit(dti)

Expand Down
Binary file modified data/dti.rda
Binary file not shown.
1 change: 1 addition & 0 deletions man/mlr_pipeops_ffs.Rd

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

2 changes: 1 addition & 1 deletion man/mlr_tasks_dti.Rd

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

0 comments on commit 68ced3e

Please sign in to comment.