hanaml.Auc {hana.ml.r}R Documentation

Area Under Curve (AUC)

Description

hanaml.Auc is a R wrapper for PAL Auc.

Usage

hanaml.Auc(conn.context, data,
            key = NULL, positive.label = NULL)

Arguments

conn.context

ConnectionContext
The connection to the SAP HANA system.

data

DataFrame
DataFrame containing the data. structured as follows:

  • ID: column with index.

  • True Class: true data point.

  • Classifier: computed probability that the data point belongsto the positive class.

key

character
Name of the ID column.

positive.label

: character, optional
If original label is not 0 or 1, specifies the label value which will be mapped to 1.

Format

R6Class object.

Details

Area under curve (AUC) is a traditional method to evaluate the performance of classification algorithms. Basically, it can evaluate binary classifiers, but it can also be extended to multiple-class condition easily.

Value

Return an "Auc" 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:

See Also

hanaml.MulticlassAuc

Examples

## Not run: 
Input DataFrame data:

data$Collect()

    ID  ORIGINAL  PREDICT
0   1         0     0.07
1   2         0     0.01
2   3         0     0.85
3   4         0     0.30
4   5         0     0.50
5   6         1     0.50
6   7         1     0.20
7   8         1     0.80
8   9         1     0.20
9  10         1     0.95

Compute Area Under Curve:
> auc_fit <- hanaml.Auc(conn.context = conn, data = data)

Output:

> auc_fit$auc
 0.66

> auc_fit$roc$Collect()

    ID  FPR  TPR
0   0  1.0  1.0
1   1  0.8  1.0
2   2  0.6  1.0
3   3  0.6  0.6
4   4  0.4  0.6
5   5  0.2  0.4
6   6  0.2  0.2
7   7  0.0  0.2
8   8  0.0  0.0

## End(Not run)

[Package hana.ml.r version 1.0.8 Index]