F1: F1 score

View source: R/performance_measures.R

F1R Documentation

F1 score

Description

'F1()' computes the F1 score between the output of a classification prediction model and the actual values of the target.

Usage

F1(ct, multi.class = "macro")

Arguments

ct

Confusion Matrix.

multi.class

Should the results of each class be aggregated, and how? Options: "none", "macro", "micro". (Defaults: "macro").

Details

F1 corresponds to the harmonic mean of Precision and Recall.

Value

F1 (a single value).

Examples

y <- c(rep("a",3),rep("b",2))
y_pred <- c(rep("a",2),rep("b",3))
ct <- table(y,y_pred)
F1(ct)

kerntools documentation built on April 3, 2025, 7:52 p.m.