liveBook · Manning

F-score

As explained in Knowledge Graphs and LLMs in Action

F1 score is the harmonic mean of precision and recall.

F1 score is the harmonic mean of precision and recall. It summarizes how well a model balances correct predictions with finding as many relevant cases as possible. section 12.1.5

Use F1 score when both false positives and missed positives matter. In AML node classification, it evaluates predictions of licit and illicit nodes; in recommendation link prediction, it evaluates predicted user–movie links. section 12.1.5 section 12.2.5

A practical evaluation workflow is:

  • Run the model on a validation dataset during training and track F1 score across epochs. section 12.1.5 section 12.2.5
  • Use a scoring function that supports an averaging strategy for imbalanced data; weighted averaging reflects the distribution of licit and illicit nodes. section 12.1.5
  • Inspect precision and recall alongside F1 score rather than treating the aggregate value as sufficient evidence of model quality. section 12.1.5 section 12.2.5

Comparing GNN models

For AML node classification, compare GCN, GAT, and SAGE using F1 score together with precision and recall. For movie recommendations, apply the same comparison to predicted user–movie links. section 12.1.5 section 12.2.5

Figure 12.5 Performance of GCN, GAT, and SAGE across precision, recall, and F1-score on the validation dataset during the training phase
figure

Compare how GCN, GAT, and SAGE F1-score values change across training epochs on the validation dataset. section 12.1.5

How Knowledge Graphs and LLMs in Action covers it

How deep it goes
Defines the balance between precision and recall and applies it through validation plots and library scoring functions.
Examples
Uses AML licit-versus-illicit node classification and user–movie recommendation link prediction with GCN, GAT, and SAGE models.
What it assumes
Assumes familiarity with model predictions, precision, recall, validation datasets, and either node classification or link prediction.
What you can do after
Evaluate/understand model performance by comparing F1 score with precision and recall across validation epochs.
How it connects
Connects precision, recall, weighted averaging, node classification, link prediction, GNNs, validation datasets, and confusion matrices.

Also explained in

Compare how 14 books explain f-score →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Knowledge Graphs and LLMs in Action. The section links point to the parts of the book it draws on.