F1 score

To talk about an f1 score we must first talk about Precision and Recall.

Precision is the ratio of correctly predicted positive observations divided by the total predicted positive observations. Less formally, of all the people that said they were coming, how many came?

Recall (sensitivity) is the ratio of correctly predicted positive observations to all observations in total.

F1 score is then the weighted average of Precision and Recall.

Here’s how we calculate an f1 score using SharpLearning:

var targets = new double[] { 0, 1, 1 };
var predictions = new double[] { 0, 1, 1 };
var sut = new F1ScoreMetric<double>(1);
var actual = sut.Error(targets, predictions);
Assert.AreEqual(0.0, actual);
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset