4
4
# ' @format [R6::R6Class] inheriting from [Filter].
5
5
# ' @include Filter.R
6
6
# '
7
- # ' @description
8
- # ' Calculates the Correlation-Adjusted (marginal) coRelation scores (short CAR scores)
9
- # ' implemented in [care::carscore()] in package \CRANpkg{care}.
10
- # ' The CAR scores for a set of features are defined as the correlations between the target
11
- # ' and the decorrelated features. The filter returns the absolute value of the calculated scores.
7
+ # ' @description Calculates the Correlation-Adjusted (marginal) coRelation scores
8
+ # ' (short CAR scores) implemented in [care::carscore()] in package
9
+ # ' \CRANpkg{care}. The CAR scores for a set of features are defined as the
10
+ # ' correlations between the target and the decorrelated features. The filter
11
+ # ' returns the absolute value of the calculated scores.
12
12
# '
13
13
# ' Argument `verbose` defaults to `FALSE`.
14
14
# '
18
18
# ' task = mlr3::mlr_tasks$get("mtcars")
19
19
# ' filter = FilterCarScore$new()
20
20
# ' filter$calculate(task)
21
- # ' head(filter$scores, 3)
22
- # ' as.data.table(filter)
21
+ # ' head(as.data.table(filter), 3)
22
+ # '
23
+ # ' ## changing filter settings
24
+ # ' filter = FilterCarScore$new()
25
+ # ' filter$param_set$values = list("diagonal" = TRUE)
26
+ # ' filter$calculate(task)
27
+ # ' head(as.data.table(filter), 3)
23
28
FilterCarScore = R6Class(" FilterCarScore" , inherit = Filter ,
24
29
public = list (
25
30
initialize = function (id = " carscore" ) {
@@ -31,9 +36,9 @@ FilterCarScore = R6Class("FilterCarScore", inherit = Filter,
31
36
param_set = ParamSet $ new(list (
32
37
ParamDbl $ new(" lambda" , lower = 0 , upper = 1 , default = NO_DEF ),
33
38
ParamLgl $ new(" diagonal" , default = FALSE ),
34
- ParamLgl $ new(" verbose" , default = TRUE ))),
35
- param_vals = list (verbose = FALSE )
39
+ ParamLgl $ new(" verbose" , default = TRUE )))
36
40
)
41
+ self $ param_set $ values = list (verbose = FALSE )
37
42
},
38
43
39
44
calculate_internal = function (task , nfeat ) {
0 commit comments