train_predict: Extract AUC from multiple (train) folds

Description Usage Arguments Value Examples

Description

Function takes a list with integer vectors representing fold indicies or a single integer vector representing these indicies and predict outcomes based on the training results

Usage

1
2
3
train_predict(folds, X_y)

train_predict(folds, X_y)

Arguments

folds

A list with integer vectors

X_y

A list with predictor matrix and response vector

folds

An integer vectors or a list containing integer vectors

X_y

A list containing the predictor matrix 'X' and the outcome vector 'y'

Value

A numeric vector containing AUC values

A dataframe containing the actual outcome and the predicted value

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
data(pedis)
X_y <- prepare_X_y(pedis, outcome = "minor_amputation", vars = c("p", "d"))
folds <- create_folds(y = X_y$y)
fit <- train_pedis(X = X_y$X, y = X_y$y, folds = folds)
map_train_auc(folds = folds, X_y = X_y)

data(pedis)
X_y <- prepare_X_y(data = pedis, outcome = "minor_amputation", vars = c("p", "d"))
fold_idx <- 1:10
train_predict(folds = 1:10, X_y = X_y)
folds <- list(1:10, 11:20)
train_predict(folds = folds, X_y = X_y)

jnshsrs/PEDISdata documentation built on June 24, 2019, 12:07 p.m.