Description Usage Arguments Details Value See Also Examples

Set of functions to compute the Area Under the ROC Curve (AUC)

1 2 3 | ```
AUC.single(pred, labels)
AUC.single.over.classes(target, predicted, g, root = "00")
compute.mean.AUC.single.over.classes(y)
``` |

`pred` |
numeric vector (scores) of the values of the predicted labels |

`labels` |
numeric vector of the true labels (0 negative, 1 positive examples) |

`target` |
matrix with the target multilabels: rows correspond to examples and columns to classes. target[i,j] = 1 if example i belongs to class j, target[i,j] = 0 otherwise. |

`predicted` |
a numeric matrix with predicted values (scores): rows correspond to examples and columns to classes. |

`g` |
a graph of class |

`root` |
the name of the root node (def. "00") |

`y` |
a list of lists. The components of the outer list is a list returned from the function |

`AUC.single`

computes the AUC for a single class.

`AUC.single.over.classes`

computes AUC for a set of classes, including their average values across classes and
the average values across the levels of the hierarchy (if any); level 1 classes are at distance 1 from the root,
level 2 the second level, till to last level correponding to the leaves. Note that if the argument g is missing no per-level values are computed.

`compute.mean.AUC.single.over.classes`

compute means across folds of AUC.single.over.classes. It can be used to automatically computed average values (for each class, level, or average across classes) across folds.

`AUC.single`

returns a numeric value corresponding to the AUC.

`AUC.single.over.classes`

returns a list with three elements:

`- average ` |
the average AUC across classes |

`- per.level` |
a named vector with average AUC for each level of the hierarchy; names correspond to levels |

`- per.class ` |
a named vector with AUC for each class; names correspond to classes |

`compute.mean.AUC.single.over.classes`

returns a list obtained by averaging the results across folds of the input y.
The components are:

`- average ` |
the average AUC across classes |

`- per.level` |
a named vector with average AUC for each level of the hierarchy; names correspond to levels |

`- per.class ` |
a named vector with AUC for each class; names correspond to classes |

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | ```
# preparing pseudo.random scores and target-labels for examples: 100 examples
# and 10 classes
Scores <- matrix(runif(1000),nrow=100);
Targets <- matrix(integer(1000),nrow=100);
Targets[Scores>0.5] <- 1;
# adding noise to scores
Scores <- Scores + matrix(rnorm(1000, sd=0.3),nrow=100);
colnames(Scores) <-colnames(Targets) <- LETTERS[1:10];
# getting scores and labels of class "A"
scores <- Scores[,"A"];
labels <- Targets[,"A"];
# AUC for a single class
AUC.single(scores,labels);
# AUC for the 10 classes
AUC.single.over.classes(Targets, Scores);
``` |

```
Loading required package: limma
Loading required package: graph
Loading required package: BiocGenerics
Loading required package: parallel
Attaching package: 'BiocGenerics'
The following objects are masked from 'package:parallel':
clusterApply, clusterApplyLB, clusterCall, clusterEvalQ,
clusterExport, clusterMap, parApply, parCapply, parLapply,
parLapplyLB, parRapply, parSapply, parSapplyLB
The following object is masked from 'package:limma':
plotMA
The following objects are masked from 'package:stats':
IQR, mad, sd, var, xtabs
The following objects are masked from 'package:base':
Filter, Find, Map, Position, Reduce, anyDuplicated, append,
as.data.frame, cbind, colMeans, colSums, colnames, do.call,
duplicated, eval, evalq, get, grep, grepl, intersect, is.unsorted,
lapply, lengths, mapply, match, mget, order, paste, pmax, pmax.int,
pmin, pmin.int, rank, rbind, rowMeans, rowSums, rownames, sapply,
setdiff, sort, table, tapply, union, unique, unsplit, which,
which.max, which.min
Loading required package: RBGL
PerfMeas: Performance Measures for ranking and classification tasks.
[1] 0.8715152
$average
[1] 0.8554368
$per.level
NULL
$per.class
A B C D E F G H
0.8715152 0.8936170 0.8220612 0.8831533 0.7657005 0.8815737 0.8461538 0.8953535
I J
0.8246465 0.8705929
```

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.