transform.DiscriminantAnalysis.RdSimilar to other transform methods, this function transforms values from a fitted "DiscriminantAnalysis" object.
# S3 method for DiscriminantAnalysis transform(model, data, key, features = NULL, proj.dim = NULL)
| model |
|
|---|---|
| data |
|
| key |
|
| features |
|
| proj.dim |
|
S3 methods
DataFrame
Projected result, structured as follows:
1st column, ID, with the same name and data type as data for projection.
other columns with name DISCRIMINANT_i, where i iterates from 1 to the number of elements in features, data type DOUBLE.
Perform transform with a "DiscriminantAnalysis" object "lda":
> result <- transform(lda,
test.set,
key = "ID"
features=list("ID","X1","X2","X3","X4"))
Output:
> result$Collect()
ID DISCRIMINANT_1 DISCRIMINANT_2 DISCRIMINANT_3 DISCRIMINANT_4
1 1 12.313584 -0.245578 NA NA
2 2 10.732231 1.432811 NA NA
3 3 11.215154 0.184080 NA NA
4 4 10.015174 -0.214504 NA NA
...
27 27 -7.058927 -0.877426 NA NA
28 28 -8.754272 -0.095103 NA NA
29 29 -8.935789 1.285655 NA NA
30 30 -8.674729 -1.208049 NA NA