Skip to content
Snippets Groups Projects
Verified Commit ffbb347f authored by Gärber, Florian's avatar Gärber, Florian
Browse files

fix: Add missing permutation MAA param

parent 2bc5203b
No related branches found
No related tags found
No related merge requests found
...@@ -52,6 +52,7 @@ MutualImpurityReduction <- function(REL) { ...@@ -52,6 +52,7 @@ MutualImpurityReduction <- function(REL) {
#' @param p.threshold (Default = 0.01) P-value threshold #' @param p.threshold (Default = 0.01) P-value threshold
#' @param method The method to use. One of: `"Janitza"` or `"Permutation"`. #' @param method The method to use. One of: `"Janitza"` or `"Permutation"`.
#' @param permutation.num (If method is `"Permutation"`) Number of AIR permutations to determine p-value. (Default: 100) #' @param permutation.num (If method is `"Permutation"`) Number of AIR permutations to determine p-value. (Default: 100)
#' @param permutation.MeanAdjustedAgreement If method is `"Permutation"` and `MIR` used `MeanAdjustedAgreement`.
#' #'
#' @returns A list: #' @returns A list:
#' * `method`: The method used. #' * `method`: The method used.
...@@ -64,7 +65,8 @@ MutualImpurityReductionVariableSelection <- function( ...@@ -64,7 +65,8 @@ MutualImpurityReductionVariableSelection <- function(
MIR, MIR,
p.threshold = 0.01, p.threshold = 0.01,
method = c("Janitza", "Permutation"), method = c("Janitza", "Permutation"),
permutation.num = 100 permutation.num = 100,
permutation.MeanAdjustedAgreement = NULL
) { ) {
if (!inherits(MIR, "MutualImpurityReduction")) { if (!inherits(MIR, "MutualImpurityReduction")) {
stop("`MIR` must be a `MutualImpurityReduction` object.") stop("`MIR` must be a `MutualImpurityReduction` object.")
...@@ -80,6 +82,7 @@ MutualImpurityReductionVariableSelection <- function( ...@@ -80,6 +82,7 @@ MutualImpurityReductionVariableSelection <- function(
"Permutation" = MIR_VarSel_Permutation( "Permutation" = MIR_VarSel_Permutation(
MIR = MIR, MIR = MIR,
p.threshold = 0.01, p.threshold = 0.01,
perm = permutation.MeanAdjustedAgreement,
num.permutations = permutation.num num.permutations = permutation.num
), ),
) )
......
...@@ -8,7 +8,8 @@ MutualImpurityReductionVariableSelection( ...@@ -8,7 +8,8 @@ MutualImpurityReductionVariableSelection(
MIR, MIR,
p.threshold = 0.01, p.threshold = 0.01,
method = c("Janitza", "Permutation"), method = c("Janitza", "Permutation"),
permutation.num = 100 permutation.num = 100,
permutation.MeanAdjustedAgreement = NULL
) )
} }
\arguments{ \arguments{
...@@ -19,6 +20,8 @@ MutualImpurityReductionVariableSelection( ...@@ -19,6 +20,8 @@ MutualImpurityReductionVariableSelection(
\item{method}{The method to use. One of: \code{"Janitza"} or \code{"Permutation"}.} \item{method}{The method to use. One of: \code{"Janitza"} or \code{"Permutation"}.}
\item{permutation.num}{(If method is \code{"Permutation"}) Number of AIR permutations to determine p-value. (Default: 100)} \item{permutation.num}{(If method is \code{"Permutation"}) Number of AIR permutations to determine p-value. (Default: 100)}
\item{permutation.MeanAdjustedAgreement}{If method is \code{"Permutation"} and \code{MIR} used \code{MeanAdjustedAgreement}.}
} }
\value{ \value{
A list: A list:
......
...@@ -74,19 +74,19 @@ test_that("MAA-MIR", { ...@@ -74,19 +74,19 @@ test_that("MAA-MIR", {
p.mir <- MutualImpurityReductionVariableSelection( p.mir <- MutualImpurityReductionVariableSelection(
mir, mir,
method = "Permutation", method = "Permutation",
# perm = MeanAdjustedAgreement( permutation.MeanAdjustedAgreement = MeanAdjustedAgreement(
# RandomForestSurrogates( RandomForestSurrogates(
# x = SMD_example_data[, -1], x = SMD_example_data[, -1],
# y = SMD_example_data[, 1], y = SMD_example_data[, 1],
# num.trees = 100, num.trees = 100,
# importance = "impurity_corrected", importance = "impurity_corrected",
# permutate = TRUE, permutate = TRUE,
# num.threads = 1, num.threads = 1,
# seed = 1964531019, # set.seed(42);runif(1,0,.Machine$integer.max) seed = 1964531019, # set.seed(42);runif(1,0,.Machine$integer.max)
# s = 10 s = 10
# ), ),
# t = 5, num.threads = 1 t = 5, num.threads = 1
# ), ),
permutation.num = 100, permutation.num = 100,
p.t = 0.01 p.t = 0.01
) )
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment