Description Usage Arguments Details Value Examples
Function to select the best hierarchical F-score by choosing an appropriate threshold in the scores.
1 2 | find.best.f(target, predicted, n.round = 3, f.criterion = "F",
verbose = TRUE, b.per.example = FALSE)
|
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 continuous predicted values (scores): rows correspond to examples and columns to classes. |
n.round |
number of rounding digits to be applied to predicted ( |
f.criterion |
character. Type of F-measure to be used to select the best F-score. There are two possibilities:
|
verbose |
boolean. If |
b.per.example |
boolean.
|
All the examples having no positive annotations are discarded. The predicted scores matrix (predicted
) is rounded
according to parameter n.round
and all the values of predicted
are divided by max(predicted)
.
Then all the thresholds corresponding to all the different values included in predicted
are attempted, and the threshold
leading to the maximum F-measure is selected.
Names of rows and columns of target
and predicted
matrix must be provided in the same order, otherwise a stop message is returned.
Two different outputs respect to the input parameter b.per.example
:
b.per.example==FALSE
: a list with a single element average. A named vector with 7 elements relative to the best result in terms
of the F.measure: Precision (P), Recall (R), Specificity (S), F.measure (F), av.F.measure (av.F), Accuracy (A) and the best selected Threshold (T).
F is the F-measure computed as the harmonic mean between the average precision and recall; av.F is the F-measure computed as the average across
examples and T is the best selected threshold;
b.per.example==FALSE
: a list with two elements:
average: a named vector with with 7 elements relative to the best result in terms of the F.measure: Precision (P), Recall (R), Specificity (S), F.measure (F), av.F.measure (av.F), Accuracy (A) and the best selected Threshold (T);
per.example: a named matrix with the Precision (P), Recall (R), Specificity (S), Accuracy (A), F-measure (F), av.F-measure (av.F) and the best selected Threshold (T) for each example. Row names correspond to examples, column names correspond respectively to Precision (P), Recall (R), Specificity (S), Accuracy (A), F-measure (F), av.F-measure (av.F) and the best selected Threshold (T);
1 2 3 4 5 6 7 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.