Link prediction, two ways.
A typed graph with six held-out facts. Choose a relation, train a tiny TransE or RotatE model by negative sampling, and compare its top-k predictions with a rule miner. Every number is computed in your browser.
The link-prediction lab
| # | Candidate | Embedding | Rule | Note |
|---|
Heads marked † have a held-out fact. Filtered ranking removes other known tails for the same head from the candidate list.
Loading the toy graph…
Query
Evaluation
Six held-out facts, one per relation. Filtered ranking; ties count as average rank. Live numbers from this run, not a benchmark.
| Scorer | Hits@1 | Hits@3 | MRR |
|---|
Mined rules
Bodies of one or two atoms, confidence ≥ 0.5, mined on the training split. Support · confidence · head coverage.
Embedding scores are min–max normalized over the candidate set. Rule scores are the maximum confidence of a firing rule, or 0 if none fires.
Two inductive biases, one graph.
The algebra decides
TransE translates, RotatE rotates. The symmetric spouse relation is the clean test: a rule can invert it exactly, while TransE cannot represent a non-trivial symmetric relation without collapsing the two entities.
Precision is not coverage
A rule with confidence 1.0 and support 2 is anecdotal. The table reports support, confidence, and head coverage together, because no single number ranks rules.
Six facts is not a benchmark
Every metric on this page is computed on six held-out edges of a hand-built graph. It shows the mechanism — filtered ranking, negative sampling, rule scoring — not the state of the art.
It is a real TransE/RotatE trainer and a real rule miner, both small enough to read. It is not a knowledge-graph benchmark: the graph is fictional, the test set has six facts, the rule miner searches only one- and two-atom bodies, and the 2D projection is a lossy view of a 12-dimensional space. A result here is a mechanism, not a claim about a real graph.