predict.DiscriminantAnalysis.Rd
Similar to other predict methods, this function predicts fitted values from a fitted "DiscriminantAnalysis" object.
# S3 method for DiscriminantAnalysis
predict(model, data, key, features = NULL, verbose = NULL)
S3
methods
R6Class object
A 'DiscriminantAnalysis' object for prediction.
DataFrame
DataFrame containting the data.
character
Name of the ID column.
character of list of characters, optional
Name of feature columns for prediction.
If not provided, it defaults to all non-key columns of data.
logical, optional
Whether or not outputs scores of all classes.
If FALSE, only score of the predicted class will be outputed.
Defaults to FALSE.
Predicted values are returned as a DataFrame, structured as follows.
ID column, with same name and type as data's ID column.
Label column, with same name and type as training data's labelcolumn.
SCORE column, score of each of the class.
Perform the prediction on a "DiscriminantAnalysis" object lda:
> result <- predict(lda,
data,
key = "ID")