Description Usage Arguments Author(s) Examples
View source: R/supervisedPRIM.R
Perform prediction on a trained supervisedPRIM
model. Output
to either predicted class or positive class probability is supported.
1 2 |
object |
A trained model of class |
newdata |
The new data on which to create predictions |
classProb |
Should the function return the estimated class |
... |
additional arguments (ignored) probabilities instead of the predicted class? |
David Shaub
1 2 3 4 5 6 7 8 | # Train a model to determine if a flower is setosa
data(iris)
yData <- factor(ifelse(iris$Species == "setosa", "setosa", "other"), levels = c("setosa", "other"))
xData <- iris
xData$Species <- NULL
primModel <- supervisedPRIM(x = xData, y = yData)
# Predict on the original dataset
predictions <- predict(primModel, newdata = xData)
|
Loading required package: prim
Warning messages:
1: In rgl.init(initValue, onlyNULL) : RGL: unable to open X11 display
2: 'rgl_init' failed, running with rgl.useNULL = TRUE
3: .onUnload failed in unloadNamespace() for 'rgl', details:
call: fun(...)
error: object 'rgl_quit' not found
4: no DISPLAY variable so Tk is not available
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.