Learn R Programming

sirus (version 0.3.3)

sirus.predict: Predict.

Description

Compute SIRUS predictions for new observations.

Usage

sirus.predict(sirus.m, data.test)

Arguments

sirus.m

A SIRUS model generated by sirus.fit.

data.test

Testing data (dataframe of new observations).

Value

Predictions. For classification, vector of the predicted probability of each new observation to be of class 1.

Examples

Run this code
# NOT RUN {
## load SIRUS
require(sirus)

## prepare data
data <- iris
y <- rep(0, nrow(data))
y[data$Species == 'setosa'] = 1
data$Species <- NULL

#' ## fit SIRUS
sirus.m <- sirus.fit(data, y)

## predict
predictions <- sirus.predict(sirus.m, data)

# }

Run the code above in your browser using DataLab