Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

fbeta_score

F-beta Score


Description

fbeta_score computes a weighted harmonic mean of Precision and Recall. The beta parameter controls the weighting.

Usage

fbeta_score(actual, predicted, beta = 1)

Arguments

actual

The ground truth binary numeric vector containing 1 for the positive class and 0 for the negative class.

predicted

The predicted binary numeric vector containing 1 for the positive class and 0 for the negative class. Each element represents the prediction for the corresponding element in actual.

beta

A non-negative real number controlling how close the F-beta score is to either Precision or Recall. When beta is at the default of 1, the F-beta Score is exactly an equally weighted harmonic mean. The F-beta score will weight toward Precision when beta is less than one. The F-beta score will weight toward Recall when beta is greater than one.

See Also

Examples

actual <- c(1, 1, 1, 0, 0, 0)
predicted <- c(1, 0, 1, 1, 1, 1)
recall(actual, predicted)

Metrics

Evaluation Metrics for Machine Learning

v0.1.4
BSD_3_clause + file LICENSE
Authors
Ben Hamner [aut, cph], Michael Frasco [aut, cre], Erin LeDell [ctb]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.