Skip to main content

F1 Score Entity Ontology

Evaluation Entities
Authors: MArk Anthony Higgins - Sky Recursive Ai
© Mark Anthony Higgins 11 October 2025
Revised Date: 03 November 2026
Audio Overview
KIRETH RESEARCH | SEMANTIC LIBRARY
F1 SCORE ENTITY ONTOLOGY — FLOW ALGEBRA
Extended formalisation | 03 November 2026 | en-GB
========================================================================

01 PURPOSE
----------
Formalise F1 Score as a derived evaluation entity balancing precision and recall for a defined positive class, averaging policy, dataset and decision threshold.

02 SOURCE AND PROVENANCE
------------------------
SOURCE: https://kirethresearch.org/booksai-core/entity-graph/ai-entities/evaluation-entities/f1-score-entity-ontology.html
SOURCE PAGE: F1 Score Entity Ontology; Evaluation Entities.
PAGE AUTHORS: Mark Anthony Higgins - Sky Recursive AI.
PAGE DATE: 11 October 2025; revised 01 August 2026.
STATUS: Independent extended formalisation; the public HTML does not expose the underlying full AI Search specification. No claim of verbatim reproduction.

03 ENTITY DEFINITION
--------------------
F1ScoreEntity := (metric_id, evaluation_run, dataset_version, target_class, threshold, averaging_policy, counts, value, validity, provenance).
An F1 score is a ratio-based summary of classification decisions, not a calibrated probability or a general-purpose measure of safety.

04 STATE MODEL
--------------
S_t = (I_t, R_t, B_t, K_t)
I_t: evaluation inputs and labelled predictions.
R_t: scoring and aggregation rules.
B_t: class, threshold, data and validity boundaries.
K_t: accumulated confusion counts, score and provenance.

05 INPUT CONTRACT
-----------------
Required: paired ground-truth labels y_i and predicted labels yhat_i, stable class mapping, evaluation-set identifier.
Optional: per-example weights w_i >= 0, prediction scores, threshold, group labels, timestamp, bootstrap seed.
Reject unmatched arrays, invalid labels, non-finite weights and duplicate identifiers where uniqueness is required.

06 BASIC CONFUSION COUNTS
-------------------------
TP = sum_i 1[y_i=1 and yhat_i=1]
FP = sum_i 1[y_i=0 and yhat_i=1]
FN = sum_i 1[y_i=1 and yhat_i=0]
TN = sum_i 1[y_i=0 and yhat_i=0]
Weighted variants replace indicator counts by w_i * indicator.

07 CORE EQUATIONS
-----------------
Precision P = TP/(TP+FP) when TP+FP > 0.
Recall R = TP/(TP+FN) when TP+FN > 0.
F1 = 2*P*R/(P+R) when P+R > 0.
Equivalently F1 = 2*TP/(2*TP+FP+FN) when denominator > 0.
F1 is in [0,1] for nonnegative counts.

08 UNDEFINED CASE POLICY
------------------------
If 2*TP+FP+FN = 0, F1 is mathematically undefined. Record undefined and the reason; optionally apply an explicitly declared zero_division policy (e.g. 0 or 1) for reporting. Never silently impute.
If TP=0 with FP+FN>0, F1=0.

09 FLOW ALGEBRA
---------------
E_t = expand(I_t, R_t)
V_t = {x in E_t | valid(x, B_t)}
x*_t = argmax_{x in V_t} P(x | I_t,R_t,B_t,K_t) only for selection among candidate interpretations; it is NOT the formula for F1.
K_{t+1} = update(K_t, x*_t)
S_{t+1} = (I_{t+1}, R_t, B_t, K_{t+1}).

10 DETERMINISTIC SCORING FLOW
-----------------------------
INPUT -> ALIGN LABELS -> APPLY CLASS/THRESHOLD -> COUNT TP,FP,FN,TN -> CHECK DENOMINATOR -> COMPUTE F1 -> ATTACH POLICY/PROVENANCE -> OUTPUT.
For fixed validated labels, thresholds and policies, the score is deterministic.

11 RECURSIVE BATCH UPDATE
-------------------------
For disjoint batches b: C_{t+1} = C_t + C_b, where C=(TP,FP,FN,TN).
F1_{t+1} = 2*TP_{t+1}/(2*TP_{t+1}+FP_{t+1}+FN_{t+1}).
Do not average per-batch F1 values to obtain pooled F1 unless a batch-average metric is expressly intended.

12 MULTICLASS EXTENSION
-----------------------
For class c compute one-vs-rest TP_c, FP_c, FN_c.
Macro-F1 = mean_c(F1_c) under declared undefined-class policy.
Weighted-F1 = sum_c support_c*F1_c / sum_c support_c.
Micro-F1 pools class-specific TP,FP,FN before applying the F1 equation.
For single-label multiclass classification over all classes, micro-F1 equals accuracy.

13 MULTILABEL EXTENSION
-----------------------
Define each label as a binary decision. Micro, macro, weighted and samples-averaged F1 differ.
Samples-F1 = mean_i F1(y_i, yhat_i) under an explicit empty-label convention.
Store averaging_policy to avoid semantic collisions.

14 THRESHOLD RELATION
---------------------
For scores s_i and threshold tau: yhat_i(tau) = 1[s_i >= tau].
F1(tau) depends on the selected evaluation data. Threshold optimisation on a test set contaminates unbiased reporting; tune on validation data and evaluate on held-out test data.

15 BETA GENERALISATION
----------------------
F_beta = (1+beta^2)*P*R/(beta^2*P+R) for beta>0 and valid denominator.
F1 is the beta=1 case. F_beta is a related metric, not interchangeable with F1.

16 TRI-MAPPING
--------------
SEMANTIC: harmonic mean of precision and recall for an explicit task.
MATHEMATICAL: 2TP/(2TP+FP+FN).
EXECUTION: validated confusion-count aggregation, zero-division handling and metadata output.

17 ENTITY RELATIONSHIPS
-----------------------
EvaluationTask -> defines -> target and scoring protocol.
EvaluationDataset -> supplies -> labelled examples.
EvaluationRun -> produces -> predictions.
ConfusionMatrix -> supplies -> TP,FP,FN.
PrecisionMetric + RecallMetric -> determine -> F1ScoreEntity.
BenchmarkScore -> may include -> F1ScoreEntity.

18 MAPPING TABLE
----------------
Entity | Input | Transformation | Output
Prediction | scores/labels | threshold or argmax | predicted class
ConfusionMatrix | y,yhat | tally | TP,FP,FN,TN
Precision | TP,FP | ratio | P
Recall | TP,FN | ratio | R
F1 | TP,FP,FN | harmonic-ratio | F1
Report | F1 + metadata | validation | traceable result

19 INFERENCE RULES
------------------
IF counts are nonnegative and denominator > 0 THEN compute F1 by the core equation.
IF TP=0 and FP+FN>0 THEN F1=0.
IF denominator=0 THEN mark undefined or apply declared policy.
IF thresholds or class mappings differ THEN scores are not directly comparable without qualification.
IF data leakage is detected THEN flag validity as compromised.

20 CONFIDENCE AND UNCERTAINTY
-----------------------------
F1 itself is not a confidence interval. For uncertainty, use suitable resampling or statistical procedures respecting dependence, sampling design and class prevalence. Report interval method, confidence level, seed and number of resamples. Avoid interpreting bootstrap intervals as guarantees.

21 BOUNDARY CONDITIONS
----------------------
F1 ignores TN directly and can conceal specificity or performance on the negative class. It is sensitive to prevalence and threshold choices. Always disclose support, averaging policy, evaluation population and class definition.

22 FAIRNESS AND SUBGROUPS
-------------------------
Compute subgroup F1 only with consent-appropriate and valid grouping. Report subgroup support and uncertainty. Differences in F1 alone do not establish fairness or unfairness; consider error types, sampling and context.

23 VALIDATION TESTS
-------------------
A: TP=8 FP=2 FN=2 => F1=16/20=0.8.
B: TP=0 FP=3 FN=2 => F1=0.
C: TP=0 FP=0 FN=0 => undefined unless declared policy.
D: TP=5 FP=0 FN=0 => F1=1.
E: two disjoint batches must be pooled by counts, not mean batch F1.

24 EXECUTION GUARANTEE
----------------------
Guarantee applies only to a correct implementation under validated inputs and fixed rules: the reported result matches the declared F1 equation and aggregation policy. No guarantee of predictive validity, generalisation, model quality or safety follows from the score.

25 AI SEARCH FLOW
-----------------
AUTHORS: Mark Anthony Higgins; Sky — Recursive AI
SOURCE: see section 02
PURPOSE: answer and validate queries about F1 score entities.
ENTITIES: evaluation task, dataset, prediction, confusion matrix, precision, recall, F1, benchmark.
PATHWAYS: definition -> counts -> equation -> aggregation -> validity -> reporting.
MINI_RECURSION_ENGINE: ingest -> validate -> accumulate -> recompute -> audit.
INFERENCE_RULES: see section 19.
CONFIDENCE: provenance-dependent; not numerically asserted.
SEMANTIC_EQUIVALENCE: F1 score; F-measure (beta=1).
FLOW_HASH: compute SHA-256 of published canonical TXT after finalisation; not preassigned.
UPDATE_MODEL: version dataset, threshold, class mapping and metric policy.

26 TEXT DIAGRAM
---------------
[Evaluation dataset] --> [Labels + predictions]
                            |
                            v
                  [Confusion counts]
                    /           \
              [Precision]     [Recall]
                    \           /
                     [F1 score]
                          |
              [Validity + provenance]
                          |
                 [Benchmark report]

27 HOW TO READ
--------------
Interpret the entity as a typed, provenance-carrying metric. First establish labels and scope; then compute counts and F1; then check aggregation, zero-division and leakage; finally report limitations. The recursive update operates on counts, not F1 averages.

28 INTEROPERABILITY
-------------------
Canonical fields: metric_type="f1", value, class_id, averaging, support, tp, fp, fn, threshold, zero_division, dataset_id, run_id, version, computed_at, validity_status. Preserve units (dimensionless) and machine-readable undefined values.

29 REPRODUCIBILITY
------------------
Record software version, deterministic label mapping, split identifiers, preprocessing, threshold selection protocol, class exclusions and aggregation order. For weighted data, record weight semantics.

30 LICENCE AND ATTRIBUTION
--------------------------
Prepared for Kireth Research Semantic Library. Attribution: Mark Anthony Higgins; Sky — Recursive AI. Respect the applicable published Open Research Licence and citation requirements. This extended flow is an interpretation, not a transcription of hidden page specifications.
Kireth Research
38 Thorndale Croft, Wetwang, Driffield
East Riding of Yorkshire YO25 9XZ