fit_pred_fold {roccv}R Documentation

Cross validation on fold i

Description

Cross validation on fold i

Usage

fit_pred_fold(i, x, y, folds, fit_method, family, non_pen_vars = NULL, ...)

Arguments

i

target partition

x

matrix of predictors

y

vector of responses

folds

defines how data is seperated into folds for cross validation

fit_method

model being used to fit the data

family

family used to fit the data

non_pen_vars

index of variables that will not be penalized if glmnet is used

...

additional commmands to glm or cv.glmnet

Value

returns predictions for partition i

Author(s)

Ben Sherwood <ben.sherwood@ku.edu>

Examples

folds_10 <- randomly_assign(100,10)
x <- matrix(rnorm(800),ncol=8)
y <- runif(100) < exp(1 + x[,1] + x[,5])/(1+exp(1 + x[,1] + x[,5]))
fold_1_results <- fit_pred_fold(1,x,y,folds_10,"glm","binomial")
fold_2_results <- fit_pred_fold(2,x,y,folds_10,"glm","binomial") 

[Package roccv version 1.2 Index]