Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@pat-s
Copy link
Member

@pat-s pat-s commented Dec 6, 2019

fixes #2699

builds upon #2698

As outlined by @annette987, thresholding calculated nselect on the DF which stored all filters (simple and ensemble ones). Therefore it miscalculated the final feature count for subsetting.

Simply moving the calculating of nselect after the block which deals with the selection of the final method first solves the problem.

Also added a test for this.

Reprex

We expect 3 out of 4 features as "E-min" ranks from [1,4].

library(mlr)
#> Loading required package: ParamHelpers

filterFeatures(iris.task, method = "E-min",
  base.methods = c("FSelectorRcpp_gain.ratio", "FSelectorRcpp_information.gain"), thresh = 2)
#> Supervised task: iris-example
#> Type: classif
#> Target: Species
#> Observations: 150
#> Features:
#>    numerics     factors     ordered functionals 
#>           3           0           0           0 
#> Missings: FALSE
#> Has weights: FALSE
#> Has blocking: FALSE
#> Has coordinates: FALSE
#> Classes: 3
#>     setosa versicolor  virginica 
#>         50         50         50 
#> Positive class: NA

Created on 2019-12-06 by the reprex package (v0.3.0)

@pat-s pat-s merged commit 61b00b8 into master Dec 7, 2019
@pat-s pat-s deleted the f-2699 branch December 7, 2019 12:40
vrodriguezf pushed a commit to vrodriguezf/mlr that referenced this pull request Jan 16, 2021
…2700)

* ensure that ensemble filters rank correctly

* rename

* fix filterFeatures() behavior and add test

* style

* method -> filter for internal robustness;
use select.method instead of additonal ensemble if-clause

* make "thresholding" subsetting work for ensemble filters

* add NEWS

* add test

* fix test

* fix tests and upd roxygen, precommit

* style
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Threshold tuning needs adjustment for ensemble filters

3 participants