View source: R/predict.mRaSE.R
predict.mRaSE | R Documentation |
Predict the outcome of new observations based on the estimated mRaSE classifier (Bi, F., Zhu, J. and Feng, Y., 2022).
## S3 method for class 'mRaSE'
predict(object, newx, ...)
object |
object fitted |
newx |
a set of new observations. Each row of |
... |
additional arguments. |
set.seed(0, kind = "L'Ecuyer-CMRG")
train.data <- RaModel("multi_classification", model.no = 1, n = 100,
p = 50, p0 = rep(1/4,4))
test.data <- RaModel("multi_classification", model.no = 1, n = 100,
p = 50, p0 = rep(1/4,4))
xtrain <- train.data$x
colnames(xtrain) <- paste0("V",1:dim(xtrain)[2])
ytrain <- train.data$y
xtest <- test.data$x
colnames(xtest) <- paste0("V",1:dim(xtest)[2])
ytest <- test.data$y
## Not run:
fit <- SmultiRaSE(xtrain, ytrain, B1 = 20, B2 = 50, iteration = 0,
base = 'lda', cores = 1)
ypred <- predict(fit, xtest)
mean(ypred != ytest)
#'
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.