screen.wgtd.corRank | R Documentation |
Performs feature selection according to the ranking of weighted
correlation coefficient estimates. Implemented via
weightedCorr
.
screen.wgtd.corRank(
Y,
X,
family,
obsWeights,
id,
method = "pearson",
k = 2,
...
)
Y |
Outcome (numeric vector). See |
X |
Predictor variable(s) (data.frame or matrix). See
|
family |
Error distribution to be used in the model:
|
obsWeights |
Optional numeric vector of observation weights. See
|
id |
Cluster identification variable. Currently unused. |
method |
Which correlation coefficient to compute. Currently accepts
|
k |
Minimum number of features to select. |
... |
Currently unused. |
A logical vector with length equal to ncol(X)
# based on examples in SuperLearner package
set.seed(1)
n <- 100
p <- 20
X <- matrix(rnorm(n*p), nrow = n, ncol = p)
X <- data.frame(X)
Y <- X[, 1] + sqrt(abs(X[, 2] * X[, 3])) + X[, 2] - X[, 3] + rnorm(n)
obsWeights <- 1/runif(n)
screen.wgtd.corRank(Y, X, gaussian(), obsWeights, seq(n), k = 3)
screen.wgtd.corRank3 <- function(..., k = 3){
screen.wgtd.corRank(..., k = k)
}
library(SuperLearner)
sl = SuperLearner(Y, X, family = gaussian(), cvControl = list(V = 2),
obsWeights = obsWeights,
SL.library = list(c("SL.glm", "All"),
c("SL.glm.interaction", "screen.wgtd.corRank3")))
sl
sl$whichScreen
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.