Explainer 13 of 15

Scoring a factorisation

Read first: Domain aggregates by matrix factorisation

One number hides how a factorisation fails. Here is a headline plus seven sub-scores, each on a different axis, none needing labels.

The headline: held-out AUC

  1. Hide a random 10% of the round's entries: what is left of the matrix after earlier rounds, so in round 2 they are fractions, and a cell earlier rounds fully explained counts as empty.
  2. Fit on what remains.
  3. Score each hidden entry by W H, and, for each, one empty cell from the same paragraph's own program: up to eight random picks among that program's columns, keeping the first empty one.
  4. AUC is the chance that a hidden entry scores above an empty cell.

0.5 is chance, 1.0 is perfect. It asks whether the factors capture structure that generalises, or just memorise the cells they were shown.

The axes

scorecomputed asgood is
fidelity‖residual − W H‖ / ‖residual‖low
coverageshare of 1s inside some factor's top-20 fields × top-20 paragraphshigh
stabilityrefit on four random 90% samples of the paragraphs; match factors one to one; mean cosinenear 1
distinctnesslargest cosine between two factorslow
focusmedian share of a factor's loading in its top 20 fieldshigh
reachshare of factors whose top fields span 2+ programs (a class counts all its members' programs)high
class shareshare of the round's entries in unified-class columnshigh

Reading them together

Four matrices

planted blocksCardDemo, round 1CardDemo, round 2random inside each program
held-out AUC1.0000.9100.4790.500
fidelity0.0000.3390.8380.999
coverage100%72.8%14.3%0.1%
stability1.0000.9750.9490.134
distinctness0.0000.5570.1010.000
focus1.0000.9970.8440.132
reach50% (median 1.5 programs)73.3% (median 5.5 programs)30% (median 1)10% (median 1)
class share10%21.4%16.6%0%

Planted blocks: the 14 × 14 matrix from the previous page, threshold 4, k = 2. Its program labels are made up: blocks 0 and 1 are one program's, and F0 is put in a class with a field of an invented second program, which is all its reach and class share come from. CardDemo: threshold 4, k = 30, then threshold 2, k = 10. Random: 3,000 programs of 22 paragraphs, each paragraph making 70 random picks, repeats allowed, among its own program's 200 fields: 66,000 × 600,000 with 3.9 million 1s, threshold 2, k = 10.

Why the empty cells come from the same program

A real corpus matrix is about 99.99% empty, and most of it is one block per program. An empty cell drawn from anywhere almost always pairs a paragraph with another program's field. Ranking a hidden 1 above that is easy, so the AUC would look strong even when each factor is one program's block.

empty cells drawn fromCardDemo round 1CardDemo round 2
anywhere in the matrix0.9810.731
the paragraph's own program0.9100.479

About 0.07 of round 1's score, and all of round 2's lead over chance, is the easy call between programs. The scorecard uses only the second row; the first is the same fit and the same hidden entries, scored once for this page against empty cells drawn uniformly from the whole matrix. A class column counts as belonging to every program its members are in. A hidden entry whose eight picks find no empty cell gets no partner; if none finds one, the AUC is nan.