Description Usage Arguments Details Value Examples
Compute the Precision-Recall (PxR) values through precrec package.
1 2 3 4 5 6 7 8 9 | precision.at.all.recall.levels.single.class(labels, scores)
precision.at.given.recall.levels.over.classes(
target,
predicted,
folds = NULL,
seed = NULL,
recall.levels = seq(from = 0.1, to = 1, by = 0.1)
)
|
labels |
vector of the true labels (0 negative, 1 positive examples). |
scores |
a numeric vector of the values of the predicted labels (scores). |
target |
matrix with the target multilabel: 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. |
folds |
number of folds on which computing the PXR. If |
seed |
initialization seed for the random generator to create folds. Set |
recall.levels |
a vector with the desired recall levels ( |
precision.at.all.recall.levels.single.class
computes the precision at all recall levels just for a single class.
precision.at.given.recall.levels.over.classes
computes the precision at fixed recall levels over classes.
precision.at.all.recall.levels.single.class
returns a two-columns matrix, representing a pair of precision and recall values.
The first column is the precision, the second the recall;
precision.at.given.recall.levels.over.classes
returns a list with two elements:
average: a vector with the average precision at different recall levels across classes;
fixed.recall: a matrix with the precision at different recall levels: rows are classes, columns precision at different recall levels;
1 2 3 4 5 6 7 8 9 10 11 12 | data(labels);
data(scores);
data(graph);
root <- root.node(g);
L <- L[,-which(colnames(L)==root)];
S <- S[,-which(colnames(S)==root)];
labels <- L[,1];
scores <- S[,1];
rec.levels <- seq(from=0.25, to=1, by=0.25);
pxr.single <- precision.at.all.recall.levels.single.class(labels, scores);
pxr <- precision.at.given.recall.levels.over.classes(L, S, folds=5, seed=23,
recall.levels=rec.levels);
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.