trainTestPartition {bestglm} | R Documentation |
Dataframe used to create training and test datasets using specified fraction for the training sample. The data matrix must be comprised of continuous variables only (no factors).
trainTestPartition(Xy, trainFrac = 2/3)
Xy |
Dataframe with column names, last column is the response variable and others are the regression input variables. The data matrix must be comprised of continuous variables only (no factors). |
trainFrac |
Fraction to be used for the training sample. |
A list with components
XyTr |
Training dataframe. |
XTr |
Matrix, input training variables. |
yTr |
Vector, output training variable. |
XyTe |
Training dataframe. |
XTe |
Matrix, input test variables. |
yTe |
Vector, output test variable. |
XyTr |
Training dataframe. |
XyTr |
Training dataframe. |
XyTr |
Training dataframe. |
A. I. McLeod
set.seed(7733551) out <- trainTestPartition(mcdonald) round(glmnetGridTable(out),4)