# Correlation-Adjusted Marignal Correlation Score Filter

Source:`R/FilterCarScore.R`

`mlr_filters_carscore.Rd`

Calculates the Correlation-Adjusted (marginal) coRrelation scores
(short CAR scores) implemented in `care::carscore()`

in package
care. The CAR scores for a set of features are defined as the
correlations between the target and the decorrelated features. The filter
returns the absolute value of the calculated scores.

Argument `verbose`

defaults to `FALSE`

.

## See also

PipeOpFilter for filter-based feature selection.

Other Filter:
`Filter`

,
`mlr_filters_anova`

,
`mlr_filters_auc`

,
`mlr_filters_carsurvscore`

,
`mlr_filters_cmim`

,
`mlr_filters_correlation`

,
`mlr_filters_disr`

,
`mlr_filters_find_correlation`

,
`mlr_filters_importance`

,
`mlr_filters_information_gain`

,
`mlr_filters_jmim`

,
`mlr_filters_jmi`

,
`mlr_filters_kruskal_test`

,
`mlr_filters_mim`

,
`mlr_filters_mrmr`

,
`mlr_filters_njmim`

,
`mlr_filters_performance`

,
`mlr_filters_permutation`

,
`mlr_filters_relief`

,
`mlr_filters_selected_features`

,
`mlr_filters_variance`

,
`mlr_filters`

## Super class

`mlr3filters::Filter`

-> `FilterCarScore`

## Examples

```
if (requireNamespace("care")) {
task = mlr3::tsk("mtcars")
filter = flt("carscore")
filter$calculate(task)
head(as.data.table(filter), 3)
## changing the filter settings
filter = flt("carscore")
filter$param_set$values = list("diagonal" = TRUE)
filter$calculate(task)
head(as.data.table(filter), 3)
}
#> Estimating optimal shrinkage intensity lambda (correlation matrix): 0.0707
#> feature score
#> 1: wt 0.8062818
#> 2: cyl 0.7918806
#> 3: disp 0.7875962
if (mlr3misc::require_namespaces(c("mlr3pipelines", "care", "rpart"), quietly = TRUE)) {
library("mlr3pipelines")
task = mlr3::tsk("mtcars")
# Note: `filter.frac` is selected randomly and should be tuned.
graph = po("filter", filter = flt("carscore"), filter.frac = 0.5) %>>%
po("learner", mlr3::lrn("regr.rpart"))
graph$train(task)
}
#> $regr.rpart.output
#> NULL
#>
```