powered by
Calculates weighted F1 score or F measure defined as the harmonic mean of precision and recall, see https://en.wikipedia.org/wiki/Precision_and_recall for some background. The higher, the better.
f1_score(actual, predicted, w = NULL, ...)
Observed values (0 or 1).
Predicted values (0 or 1).
Optional case weights.
Further arguments passed to precision and recall.
precision
recall
A numeric vector of length one.
precision, recall.
precision, recall
# NOT RUN { f1_score(c(0, 0, 1, 1), c(0, 0, 1, 1)) f1_score(c(1, 0, 0, 1), c(0, 0, 1, 1)) f1_score(c(1, 0, 0, 1), c(0, 0, 1, 1), w = 1:4) # }
Run the code above in your browser using DataLab