Description Usage Arguments Value Author(s) Examples
Cross validation on fold i
1 | fit_pred_fold(i, x, y, folds, fit_method, family, non_pen_vars = NULL, ...)
|
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 |
returns predictions for partition i
Ben Sherwood <ben.sherwood@ku.edu>
1 2 3 4 5 | 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")
|
Loading required package: glmnet
Loading required package: Matrix
Loading required package: foreach
Loaded glmnet 2.0-16
Loading required package: parallel
Loading required package: pROC
Type 'citation("pROC")' for a citation.
Attaching package: 'pROC'
The following object is masked from 'package:glmnet':
auc
The following objects are masked from 'package:stats':
cov, smooth, var
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.