Skip to content

Commit eab7c5a

Browse files
committed
fix: add missing property to correlation and anova (depending on hyperpars)
1 parent 484bd32 commit eab7c5a

File tree

3 files changed

+15
-5
lines changed

3 files changed

+15
-5
lines changed

R/FilterCorrelation.R

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,12 @@ FilterCorrelation = R6Class("FilterCorrelation",
7070
y = as.matrix(task$truth()),
7171
.args = pv)[, 1L]
7272
set_names(abs(score), fn)
73+
},
74+
75+
.get_properties = function() {
76+
"missings"
7377
}
78+
7479
)
7580
)
7681

R/FilterInformationGain.R

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,10 +72,6 @@ FilterInformationGain = R6Class("FilterInformationGain",
7272
),
7373

7474
private = list(
75-
.get_properties = function() {
76-
"missings"
77-
},
78-
7975
.calculate = function(task, nfeat) {
8076
pv = self$param_set$values
8177
pv$type = pv$type %??% "infogain"
@@ -85,6 +81,10 @@ FilterInformationGain = R6Class("FilterInformationGain",
8581
y = task$truth()
8682
scores = invoke(FSelectorRcpp::information_gain, x = x, y = y, .args = pv)
8783
set_names(scores$importance, scores$attributes)
84+
},
85+
86+
.get_properties = function() {
87+
"missings"
8888
}
8989
)
9090
)

R/FilterKruskalTest.R

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ FilterKruskalTest = R6Class("FilterKruskalTest",
4545
#' @description Create a FilterKruskalTest object.
4646
initialize = function() {
4747
param_set = ps(
48-
na.action = p_fct(c("na.omit", "na.fail", "na.exclude", "na.pass"), default = "na.omit")
48+
na.action = p_fct(c("na.omit", "na.fail", "na.exclude"), default = "na.omit")
4949
)
5050

5151
super$initialize(
@@ -69,6 +69,11 @@ FilterKruskalTest = R6Class("FilterKruskalTest",
6969
-log10(map_dbl(data, function(x) {
7070
kruskal.test(x = x, g = g, na.action = na_action)$p.value
7171
}))
72+
},
73+
74+
.get_properties = function() {
75+
ok = c("na.omit", "na.exclude")
76+
if ((self$param_set$values$na.action %??% "na.omit") %in% ok) "missings" else character()
7277
}
7378
)
7479
)

0 commit comments

Comments
 (0)