logicFS (version 1.42.0)

predict.mlogreg: Predict Method for mlogreg Objects

Description

Prediction for test data using an object of class mlogreg.

Usage

"predict"(object, newData, type = c("class", "prob"), ...)

Arguments

object
an object of class mlogreg, i.e.\ the output of the function mlogreg.
newData
a matrix or data frame containing new data. If omitted object\$data, i.e.\ the original training data, are used. Each row of newData must correspond to a new observation. Each row of newData must contain the same variable as the corresponding column of the data matrix used in mlogreg, i.e.\ x if the default method of mlogreg has been used, or data without the column containing the response if the formula method has been used.
type
character vector indicating the type of output. If "class", a vector containing the predicted classes of the observations will be returned. If "prob", the class probabilities for each level and all observations are returned.
...
Ignored.

Value

A numeric vector containing the predicted classes (if type = "class"), or a matrix composed of the class probabilities (if type = "prob").

See Also

mlogreg