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

Make Projections from a Linear Discriminant Analysis Object

Description

Make Projections from a Linear Discriminant Analysis Object

Usage

## S3 method for class 'DiscriminantAnalysis'
transform(model, data, key,
  features = NULL, proj.dim = NULL)

Arguments

model

R6Class object
A 'DiscriminantAnalysis' object for projection.

data

DataFrame
data for transform.

key

character
Name of the ID column.
Defaults to the first column.

features

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

proj.dim

integer, optional
Dimension of the projected space, equivalent to the number of discriminant used for projection.
Defaults to the number of obtained discriminants.

Value

DataFrame Projected result, structured as follows:

See Also

predict.DiscriminantAnalysis

hanaml.DiscriminantAnalysis

Examples

## Not run: 
 Perform transform with a DiscriminantAnalysis object 'lda':
 > result <- transform(lda,
                       test.set,
                       key = "ID"
                       features=list("ID","X1","X2","X3","X4"))
 > result$Collect()
     ID  DISCRIMINANT_1  DISCRIMINANT_2 DISCRIMINANT_3 DISCRIMINANT_4
 0    1       12.313584       -0.245578           None           None
 1    2       10.732231        1.432811           None           None
 2    3       11.215154        0.184080           None           None
 3    4       10.015174       -0.214504           None           None
 ...
 26  27       -7.058927       -0.877426           None           None
 27  28       -8.754272       -0.095103           None           None
 28  29       -8.935789        1.285655           None           None
 29  30       -8.674729       -1.208049           None           None

## End(Not run)

[Package hana.ml.r version 1.0.8 Index]