aloom {aloom} | R Documentation |
All Leave-One-Out Models
Description
Creates a predictive model for a training set, as well as all leave-one-out predictive models. Produces predictions of all models (original and all leave one-out) for a test set.
Usage
aloom(train.x, train.y, test.x, method, model.params, mc.cores = 1, seed = 1)
Arguments
train.x |
input matrix, of dimension nobs x nvars; each row is an observation vector. |
train.y |
response variable; binary factor of the same length as nrow(train.x) |
test.x |
Matrix of new values for |
method |
name of the model. Currently allowed values are "rf" and "glmnet" |
model.params |
list of model parameters |
mc.cores |
number of cores |
seed |
seed number, default=1 |
Value
A list containing predicted.y, predicted.prob.y and aloom.probs
Examples
library(randomForest)
x1 <- matrix(rnorm(100 * 20), 100, 20)
x2 <- matrix(rnorm(30 * 20), 30, 20)
y1 <- as.factor(sample(c("POS","NEG"), 100, replace = TRUE))
vnames <- paste0("V",seq(20))
colnames(x1) <- vnames
colnames(x2) <- vnames
rownames(x1) <- paste0("train",seq(nrow(x1)))
rownames(x2) <- paste0("test",seq(nrow(x2)))
model.params <- list(ntree=100)
fit <- aloom(x1,y1,x2,method="rf",model.params)
[Package aloom version 0.1.1 Index]