predict.DiscriminantAnalysis {hana.ml.r}R Documentation

Make Predictions from a Linear Discriminant Analysis Object

Description

Make Predictions from a Linear Discriminant Analysis Object

Usage

## S3 method for class 'DiscriminantAnalysis'
predict(model, data, key, features = NULL,
  verbose = NULL)

Arguments

model

R6Class object
A 'DiscriminantAnalysis' object for prediction.

data

DataFrame
Data for prediction.

key

character
Name of the ID column.

features

character or list of character, optional
Names of the feature columns.
If not provided, it defaults to all non-ID columns.

verbose

logical, optional
Whether or not outputs scores of all classes. If FALSE, only score of the predicted class will be outputed.
Defaults to FALSE.

Value

Predicted values are returned as a DataFrame, structured as follows.

See Also

transform.DiscriminantAnalysis

hanaml.DiscriminantAnalysis

Examples

## Not run: 
Perform the predict on A 'DiscriminantAnalysis' object lda:
> result <- predict(lda, test.set,
                    features=list("ID","X1","X2","X3","X4"),
                    key = "ID",
                    verbose = FALSE)
Output:
> result
     ID            CLASS       SCORE
 0    1      Iris-setosa  130.421263
 1    2      Iris-setosa   99.762784
 2    3      Iris-setosa  108.796296
 3    4      Iris-setosa   94.301777
 4    5      Iris-setosa  133.205924
 ......
 26  27   Iris-virginica   57.274694
 27  28   Iris-virginica  101.668525
 28  29   Iris-virginica   87.257782
 29  30   Iris-virginica  106.747065

## End(Not run)

[Package hana.ml.r version 1.0.8 Index]