Description Usage Arguments Details Value Examples
View source: R/KIF_functions.R
an interaction screening procedure based on Kendall's Tau.
1 | KIFall(Sample, y, ncor = 2, threshold)
|
Sample |
a numeric matrix containing the data with n rows (observations) and p columns (features). |
y |
the response variable. |
ncor |
number of cores to use for code parallelization. Default is 2. |
threshold |
the number of relevant couples to select. |
KIF measure aims to select the relevant couples for the multi-class classification task. It is based on Kendall's Tau and ranges form 0 to 1. KIF is a model-free procedure, handles continuous, categorical or a mixture of continuous-categorical features, and is invariant under monotonic transformations. KIFall
function computes KIF scores of all possible couples, then returns the "threshold" couples with highest scores.
KIFall
function returns the first "threshold" selected couples among all the selected couples.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | ## Not run:
############### KIFall function ###############
library(mvtnorm)
set.seed(1)
n1 <- 100
n2 <- 100
n <- n1 +n2
p <- 500
sigma <- diag(p)
sigma[upper.tri(sigma)] <- 0.2
sigma[lower.tri(sigma)] <- 0.2
sigma1 <- sigma
sigma2 <- sigma
sigma1[1,2] <- 0.8
sigma1[2,1] <- 0.8
sigma1[3,4] <- 0.8
sigma1[4,3] <- 0.8
sigma2[3,4] <- -0.8
sigma2[4,3] <- -0.8
mean1 <- c(rep(0,p))
mean2 <- c(rep(0,p))
Sample <- rbind(rmvnorm(n1, mean1, sigma1), rmvnorm(n2, mean2, sigma2))
y <- c(rep(1,n1), rep(0,n2))
out <- KIFall(Sample, y, 4, 10)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.