Title: | All Leave-One-Out Models |
---|---|
Description: | Creates all leave-one-out models and produces predictions for test samples. |
Authors: | Damjan Krstajic [aut, cre]
|
Maintainer: | Damjan Krstajic <[email protected]> |
License: | GPL-2 |
Version: | 0.1.1 |
Built: | 2025-02-16 05:31:53 UTC |
Source: | https://github.com/cran/aloom |
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.
aloom(train.x, train.y, test.x, method, model.params, mc.cores = 1, seed = 1)
aloom(train.x, train.y, test.x, method, model.params, mc.cores = 1, seed = 1)
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 |
A list containing predicted.y, predicted.prob.y and aloom.probs
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)
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)