Learn R Programming

QuanDA (version 1.0.0)

predict.quanda: Make Predictions from a `quanda` Object

Description

Produces fitted values for new predictor data using a fitted `quanda()` object.

Usage

# S3 method for quanda
predict(object, newx, type = c("class", "loss"), ...)

Value

Numeric vector of length n_new.

Arguments

object

Fitted `quanda()` object from which predictions are to be derived.

newx

Matrix of new predictor values for which predictions are desired. This must be a matrix and is a required argument.

type

Type of prediction required. Type `"class"` produces the predicted binary class labels and type `"loss"` returns the fitted values. Default is "class".

...

Not used.

See Also

quanda

Examples

Run this code
data(breast)
X <- as.matrix(X)
y <- as.numeric(as.character(y))
y[y==-1]=0
fit <- quanda(X, y)

Run the code above in your browser using DataLab