+
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
f0105e9
docs: add docs for PipeOpFilter
sebffischer Aug 16, 2022
4a7b98c
docs: update news
sebffischer Aug 16, 2022
4d63ea4
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Aug 16, 2022
ed1022f
docs: fix readme
sebffischer Aug 16, 2022
6a25c85
Merge branch 'docs2' of github.com:mlr-org/mlr3filters into docs2
sebffischer Aug 16, 2022
9c39cb1
docs: fix readme
sebffischer Aug 16, 2022
13aeeec
docs: fix readme
sebffischer Aug 16, 2022
44ee8f1
docs: fix MASS dependency in examples
sebffischer Aug 16, 2022
324b730
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Aug 16, 2022
8eb2164
cleanup
sebffischer Aug 25, 2022
0904570
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Aug 16, 2022
45eb75d
docs: fix readme
sebffischer Aug 16, 2022
c4f5fc7
docs: fix readme
sebffischer Aug 16, 2022
d3ab074
docs: fix MASS dependency in examples
sebffischer Aug 16, 2022
f67de91
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Aug 16, 2022
863f450
cleanup
sebffischer Aug 25, 2022
84403d5
Merge branch 'docs2' of github.com:mlr-org/mlr3filters into docs2
sebffischer Aug 25, 2022
4763afe
cleanup
sebffischer Aug 25, 2022
86bb639
Merge branch 'docs2' of github.com:mlr-org/mlr3filters into docs2
sebffischer Aug 25, 2022
b01abda
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Aug 25, 2022
bfbfd6c
chore: don't escape mlr3measures
sebffischer Aug 25, 2022
f4101bd
Merge branch 'docs2' of github.com:mlr-org/mlr3filters into docs2
sebffischer Aug 25, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ Suggests:
lgr,
mlr3learners,
mlr3measures,
mlr3pipelines,
praznik,
rpart,
testthat (>= 3.0.0),
Expand Down
2 changes: 1 addition & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# mlr3filters 0.5.0.9000

- Add references to benchmark paper and praznik paper #104

* Add documentation for PipeOpFilter

# mlr3filters 0.5.0

Expand Down
12 changes: 12 additions & 0 deletions R/FilterAUC.R
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,18 @@
#' filter = flt("auc")
#' filter$calculate(task)
#' head(as.data.table(filter), 3)
#'
#' if (mlr3misc::require_namespaces(c("mlr3pipelines", "rpart"), quietly = TRUE)) {
#' library("mlr3pipelines")
#' task = mlr3::tsk("spam")
#'
#' # Note: `filter.frac` is selected randomly and should be tuned.
#'
#' graph = po("filter", filter = flt("auc"), filter.frac = 0.5) %>>%
#' po("learner", mlr3::lrn("classif.rpart"))
#'
#' graph$train(task)
#' }
FilterAUC = R6Class("FilterAUC",
inherit = Filter,

Expand Down
12 changes: 12 additions & 0 deletions R/FilterAnova.R
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,18 @@
#'
#' # transform to p-value
#' 10^(-filter$scores)
#'
#' if (mlr3misc::require_namespaces(c("mlr3pipelines", "rpart"), quietly = TRUE)) {
#' library("mlr3pipelines")
#' task = mlr3::tsk("spam")
#'
#' # Note: `filter.frac` is selected randomly and should be tuned.
#'
#' graph = po("filter", filter = flt("anova"), filter.frac = 0.5) %>>%
#' po("learner", mlr3::lrn("classif.rpart"))
#'
#' graph$train(task)
#' }
FilterAnova = R6Class("FilterAnova",
inherit = Filter,

Expand Down
12 changes: 12 additions & 0 deletions R/FilterCMIM.R
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,18 @@
#' filter$calculate(task, nfeat = 2)
#' as.data.table(filter)
#' }
#'
#' if (mlr3misc::require_namespaces(c("mlr3pipelines", "rpart", "praznik"), quietly = TRUE)) {
#' library("mlr3pipelines")
#' task = mlr3::tsk("spam")
#'
#' # Note: `filter.frac` is selected randomly and should be tuned.
#'
#' graph = po("filter", filter = flt("cmim"), filter.frac = 0.5) %>>%
#' po("learner", mlr3::lrn("classif.rpart"))
#'
#' graph$train(task)
#' }
FilterCMIM = R6Class("FilterCMIM",
inherit = Filter,

Expand Down
14 changes: 13 additions & 1 deletion R/FilterCarScore.R
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,24 @@
#' filter$calculate(task)
#' head(as.data.table(filter), 3)
#'
#' ## changing filter settings
#' ## changing the filter settings
#' filter = flt("carscore")
#' filter$param_set$values = list("diagonal" = TRUE)
#' filter$calculate(task)
#' head(as.data.table(filter), 3)
#' }
#'
#' 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)
#' }
FilterCarScore = R6Class("FilterCarScore",
inherit = Filter,

Expand Down
11 changes: 11 additions & 0 deletions R/FilterCorrelation.R
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,17 @@
#' filter$param_set$values = list("method" = "spearman")
#' filter$calculate(task)
#' as.data.table(filter)
#' if (mlr3misc::require_namespaces(c("mlr3pipelines", "rpart"), quietly = TRUE)) {
#' library("mlr3pipelines")
#' task = mlr3::tsk("boston_housing")
#'
#' # Note: `filter.frac` is selected randomly and should be tuned.
#'
#' graph = po("filter", filter = flt("correlation"), filter.frac = 0.5) %>>%
#' po("learner", mlr3::lrn("regr.rpart"))
#'
#' graph$train(task)
#' }
FilterCorrelation = R6Class("FilterCorrelation",
inherit = Filter,

Expand Down
12 changes: 12 additions & 0 deletions R/FilterDISR.R
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,18 @@
#' filter$calculate(task)
#' as.data.table(filter)
#' }
#'
#' if (mlr3misc::require_namespaces(c("mlr3pipelines", "rpart", "praznik"), quietly = TRUE)) {
#' library("mlr3pipelines")
#' task = mlr3::tsk("spam")
#'
#' # Note: `filter.frac` is selected randomly and should be tuned.
#'
#' graph = po("filter", filter = flt("disr"), filter.frac = 0.5) %>>%
#' po("learner", mlr3::lrn("classif.rpart"))
#'
#' graph$train(task)
#' }
FilterDISR = R6Class("FilterDISR",
inherit = Filter,

Expand Down
14 changes: 13 additions & 1 deletion R/FilterFindCorrelation.R
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#' @template seealso_filter
#' @export
#' @examples
#' ## Pearson (default)
#' # Pearson (default)
#' task = mlr3::tsk("mtcars")
#' filter = flt("find_correlation")
#' filter$calculate(task)
Expand All @@ -29,6 +29,18 @@
#' filter = flt("find_correlation", method = "spearman")
#' filter$calculate(task)
#' as.data.table(filter)
#'
#' if (mlr3misc::require_namespaces(c("mlr3pipelines", "rpart"), quietly = TRUE)) {
#' library("mlr3pipelines")
#' task = mlr3::tsk("spam")
#'
#' # Note: `filter.frac` is selected randomly and should be tuned.
#'
#' graph = po("filter", filter = flt("find_correlation"), filter.frac = 0.5) %>>%
#' po("learner", mlr3::lrn("classif.rpart"))
#'
#' graph$train(task)
#' }
FilterFindCorrelation = R6Class("FilterFindCorrelation",
inherit = Filter,

Expand Down
27 changes: 22 additions & 5 deletions R/FilterImportance.R
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,28 @@
#' @template seealso_filter
#' @export
#' @examples
#' task = mlr3::tsk("iris")
#' learner = mlr3::lrn("classif.rpart")
#' filter = flt("importance", learner = learner)
#' filter$calculate(task)
#' as.data.table(filter)
#' if (requireNamespace("rpart")) {
#' task = mlr3::tsk("iris")
#' learner = mlr3::lrn("classif.rpart")
#' filter = flt("importance", learner = learner)
#' filter$calculate(task)
#' as.data.table(filter)
#' }
#'
#' if (mlr3misc::require_namespaces(c("mlr3pipelines", "rpart", "mlr3learners"), quietly = TRUE)) {
#' library("mlr3learners")
#' library("mlr3pipelines")
#' task = mlr3::tsk("spam")
#'
#' learner = mlr3::lrn("classif.rpart")
#'
#' # Note: `filter.frac` is selected randomly and should be tuned.
#'
#' graph = po("filter", filter = flt("importance", learner = learner), filter.frac = 0.5) %>>%
#' po("learner", mlr3::lrn("classif.log_reg"))
#'
#' graph$train(task)
#' }
FilterImportance = R6Class("FilterImportance",
inherit = Filter,

Expand Down
15 changes: 15 additions & 0 deletions R/FilterInformationGain.R
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

#' @title Information Gain Filter
#'
#' @name mlr_filters_information_gain
Expand Down Expand Up @@ -29,6 +30,20 @@
#' filterGR$param_set$values = list("type" = "gainratio")
#' filterGR$calculate(task)
#' head(as.data.table(filterGR), 3)
#'
#' }
#'
#' if (mlr3misc::require_namespaces(c("mlr3pipelines", "FSelectorRcpp", "rpart"), quietly = TRUE)) {
#' library("mlr3pipelines")
#' task = mlr3::tsk("spam")
#'
#' # Note: `filter.frac` is selected randomly and should be tuned.
#'
#' graph = po("filter", filter = flt("information_gain"), filter.frac = 0.5) %>>%
#' po("learner", mlr3::lrn("classif.rpart"))
#'
#' graph$train(task)
#'
#' }
FilterInformationGain = R6Class("FilterInformationGain",
inherit = Filter,
Expand Down
14 changes: 13 additions & 1 deletion R/FilterJMI.R
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

#' @title Joint Mutual Information Filter
#'
#' @name mlr_filters_jmi
Expand All @@ -14,7 +15,6 @@
#'
#' `r format_bib("bommert_2020")`
#'
#'
#' @template details_praznik
#' @family Filter
#' @template seealso_filter
Expand All @@ -26,6 +26,18 @@
#' filter$calculate(task, nfeat = 2)
#' as.data.table(filter)
#' }
#'
#' if (mlr3misc::require_namespaces(c("mlr3pipelines", "rpart", "praznik"), quietly = TRUE)) {
#' library("mlr3pipelines")
#' task = mlr3::tsk("spam")
#'
#' # Note: `filter.frac` is selected randomly and should be tuned.
#'
#' graph = po("filter", filter = flt("jmi"), filter.frac = 0.5) %>>%
#' po("learner", mlr3::lrn("classif.rpart"))
#'
#' graph$train(task)
#' }
FilterJMI = R6Class("FilterJMI",
inherit = Filter,

Expand Down
12 changes: 12 additions & 0 deletions R/FilterJMIM.R
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,18 @@
#' filter$calculate(task, nfeat = 2)
#' as.data.table(filter)
#' }
#'
#' if (mlr3misc::require_namespaces(c("mlr3pipelines", "rpart", "praznik"), quietly = TRUE)) {
#' library("mlr3pipelines")
#' task = mlr3::tsk("spam")
#'
#' # Note: `filter.frac` is selected randomly and should be tuned.
#'
#' graph = po("filter", filter = flt("jmim"), filter.frac = 0.5) %>>%
#' po("learner", mlr3::lrn("classif.rpart"))
#'
#' graph$train(task)
#' }
FilterJMIM = R6Class("FilterJMIM",
inherit = Filter,

Expand Down
12 changes: 12 additions & 0 deletions R/FilterKruskalTest.R
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,18 @@
#'
#' # transform to p-value
#' 10^(-filter$scores)
#'
#' if (mlr3misc::require_namespaces(c("mlr3pipelines", "rpart"), quietly = TRUE)) {
#' library("mlr3pipelines")
#' task = mlr3::tsk("spam")
#'
#' # Note: `filter.frac` is selected randomly and should be tuned.
#'
#' graph = po("filter", filter = flt("kruskal_test"), filter.frac = 0.5) %>>%
#' po("learner", mlr3::lrn("classif.rpart"))
#'
#' graph$train(task)
#' }
FilterKruskalTest = R6Class("FilterKruskalTest",
inherit = Filter,

Expand Down
12 changes: 12 additions & 0 deletions R/FilterMIM.R
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,18 @@
#' filter$calculate(task, nfeat = 2)
#' as.data.table(filter)
#' }
#'
#' if (mlr3misc::require_namespaces(c("mlr3pipelines", "rpart", "praznik"), quietly = TRUE)) {
#' library("mlr3pipelines")
#' task = mlr3::tsk("spam")
#'
#' # Note: `filter.frac` is selected randomly and should be tuned.
#'
#' graph = po("filter", filter = flt("mim"), filter.frac = 0.5) %>>%
#' po("learner", mlr3::lrn("classif.rpart"))
#'
#' graph$train(task)
#' }
FilterMIM = R6Class("FilterMIM",
inherit = Filter,

Expand Down
12 changes: 12 additions & 0 deletions R/FilterMRMR.R
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,18 @@
#' filter$calculate(task, nfeat = 2)
#' as.data.table(filter)
#' }
#'
#' if (mlr3misc::require_namespaces(c("mlr3pipelines", "rpart", "praznik"), quietly = TRUE)) {
#' library("mlr3pipelines")
#' task = mlr3::tsk("spam")
#'
#' # Note: `filter.frac` is selected randomly and should be tuned.
#'
#' graph = po("filter", filter = flt("mrmr"), filter.frac = 0.5) %>>%
#' po("learner", mlr3::lrn("classif.rpart"))
#'
#' graph$train(task)
#' }
FilterMRMR = R6Class("FilterMRMR",
inherit = Filter,

Expand Down
12 changes: 12 additions & 0 deletions R/FilterNJMIM.R
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,18 @@
#' filter$calculate(task, nfeat = 2)
#' as.data.table(filter)
#' }
#'
#' if (mlr3misc::require_namespaces(c("mlr3pipelines", "rpart", "praznik"), quietly = TRUE)) {
#' library("mlr3pipelines")
#' task = mlr3::tsk("spam")
#'
#' # Note: `filter.frac` is selected randomly and should be tuned.
#'
#' graph = po("filter", filter = flt("njmim"), filter.frac = 0.5) %>>%
#' po("learner", mlr3::lrn("classif.rpart"))
#'
#' graph$train(task)
#' }
FilterNJMIM = R6Class("FilterNJMIM",
inherit = Filter,

Expand Down
24 changes: 19 additions & 5 deletions R/FilterPerformance.R
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,25 @@
#' @template seealso_filter
#' @export
#' @examples
#' task = mlr3::tsk("iris")
#' learner = mlr3::lrn("classif.rpart")
#' filter = flt("performance", learner = learner)
#' filter$calculate(task)
#' as.data.table(filter)
#' if (requireNamespace("rpart")) {
#' task = mlr3::tsk("iris")
#' learner = mlr3::lrn("classif.rpart")
#' filter = flt("performance", learner = learner)
#' filter$calculate(task)
#' as.data.table(filter)
#' }
#' if (mlr3misc::require_namespaces(c("mlr3pipelines", "rpart"), quietly = TRUE)) {
#' library("mlr3pipelines")
#' task = mlr3::tsk("spam")
#' l = lrn("classif.rpart")
#'
#' # Note: `filter.frac` is selected randomly and should be tuned.
#'
#' graph = po("filter", filter = flt("performance", learner = l), filter.frac = 0.5) %>>%
#' po("learner", mlr3::lrn("classif.rpart"))
#'
#' graph$train(task)
#' }
FilterPerformance = R6Class("FilterPerformance",
inherit = Filter,

Expand Down
Loading
点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载