hanaml.MulticlassAUC is a R wrapper for SAP HANA PAL multi-class AUC.

hanaml.MulticlassAUC(data.original, data.predict, key = NULL)

Arguments

data.original

DataFrame
True class data, structured as follows:

  • ID, INTEGER - column with index.

  • True Class, INTEGER-true data point.

data.predict

DataFrame
True class data, structured as follows:

  • ID, INTEGER - column with index.

  • True Class, INTEGER - true data point.

  • Classifier, DOUBLE - Classifier-computed probability that the data point belongs to that particular class.

key

character
Name of the ID column.

Value

Return a "MulticlassAUC" object with following values:
auc : double
The area under the receiver operating characteristic curve.
roc : DataFrame
False positive rate and true positive rate, structured as follows:

  • ID INTEGER,column with index

  • FPR DOUBLE, representing false positive rate.

  • TPR DOUBLE, representing true positive rate.

Note

For each data point ID, there should be one row for each possible class.

Examples

Input DataFrame data.original and data.predict:


> data.original$Collect()
    ID  ORIGINAL
1   1         1
2   2         1
3   3         1
4   4         2
5   5         2
6   6         2
7   7         3
8   8         3
9   9         3
10 10         3

> data.predict$Collect()
    ID  PREDICT  PROB
1    1        1  0.90
2    1        2  0.05
3    1        3  0.05
......
27   9        3  0.70
28  10        1  0.20
29  10        2  0.20
30  10        3  0.60

Compute Area Under Curve for multi class:


>  multiauc <- hanaml.MulticlassAUC(data.original = data.original,
                                    data.predict = data.predict)

Output:


> multiauc$auc
 1

> multiauc$roc$Collect()
    ID   FPR  TPR
1    0  1.00  1.0
2    1  0.90  1.0
3    2  0.65  1.0
4    3  0.25  1.0
5    4  0.20  1.0
6    5  0.00  1.0
7    6  0.00  0.9
8    7  0.00  0.7
9    8  0.00  0.3
10   9  0.00  0.1
11  10  0.00  0.0

See also