Description Usage Arguments Details Value Author(s) Examples
The training data is fit and then the mis-classifcation rate for the test data is computed.
1 | yh_logistic(dfTr, dfTe, alpha = NULL)
|
dfTr |
Training data frame, last column factor response and other columns are numeric inputs. |
dfTe |
Test data frame, columns same variables as in training data frame |
alpha |
alpha=1 for LASSO, alpha=0.5 for half-mixture, alpha=0 for ridge regression |
alpha=0.02 often is numerically better behaved than alpha=0
vector with named values misclassificationRate, logloss, pcorr
A. I. McLeod
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | z <- kyphosis[,c(2:4,1)]
set.seed(37771)
i <- sample(1:81, size=7, replace=TRUE)
dfTe <- z[i,]
i <- setdiff(1:81, i)
dfTr <- z[i,]
yh_logistic(dfTr, dfTe)
yh_logistic(dfTr, dfTe, alpha=1)
## Not run: #cross-validation, takes a few minutes
X <- kyphosis[,3:4]
y <- kyphosis[,4]
cgcv(X, y, yh=yh_logistic, NCores=8)
cgcv(X, y, yh=yh_logistic, NCores=8, alpha=1)
cgcv(X, y, yh=yh_logistic, NCores=8, alpha=0.5)
cgcv(X, y, yh=yh_logistic, NCores=8, alpha=0.02)
#
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.