Learn R Programming

supervisedPRIM (version 2.0.0)

predict.supervisedPRIM: Model Predictions

Description

Perform prediction on a trained supervisedPRIM model. Output to either predicted class or positive class probability is supported.

Usage

"predict"(object, newdata, classProb = FALSE, ...)

Arguments

object
A trained model of class supervisedPRIM returned by supervisedPRIM
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?

Examples

Run this code
# 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)

Run the code above in your browser using DataLab