Method
BTTF
BTTF combines four traditional code measurements, two embedding-based measurements of semantic organization, and five causal-LM predictability measurements in a Ridge predictor. The 11 features are selected through stability analysis and consensus across 15 pretrained-model combinations. This viewer uses OpenCoder-1.5B-Base and Jina Embeddings v2 Base Code.
Score scale: 0–1; higher is more readable.
Evaluation in this viewer
Training uses within-dataset percentile targets and equal total weight for each dataset. Inference applies the fitted imputation, training-range clipping, standardization, and Ridge coefficients. This viewer uses the fixed diagnostic model, not CV/LODO predictions. Cloud scores average three runs.
Selected features
| Feature | Measurement |
|---|---|
| Operator density | How many operations are packed into each non-empty line. |
| Literal-tail surprisal | How unexpected the most unusual numbers and strings are given the preceding code. |
| Identifier-onset surprisal | How hard it is to anticipate the beginning of an identifier name from the preceding code. |
| Computation-and-control pattern count | How many distinct groups of related computations and control decisions the code contains. These groups are identified by clustering their embedding vectors. |
| Decision density | How many comparisons are packed into each non-empty line. |
| Expression-literal density | How many operations the code contains relative to literal values such as numbers and strings. |
| Longest line length | The length of the longest line, including comments and indentation. |
| Assignment-value surprisal | How unexpected the assigned values are given the preceding code. |
| Declaration-surprisal variation | How much declarations differ in how easy they are to anticipate from preceding code. |
| Short-identifier context dependence | How much short names depend on information farther back in the code. |
| Identifier embedding dispersion | How spread out the identifier names are in embedding space. Names that the embedding model represents similarly lie closer together. |
Dataset results
| Dataset | Coverage | Spearman ρ |
|---|---|---|
| MBJP | 17/17 | 0.868 |
| Buse | 100/100 | 0.69 |
| Scalabrino | 200/200 | 0.565 |
| Dorn | 360/360 | 0.565 |
| Schnappinger | 304/304 | 0.626 |
| JetBrains | 119/119 | 0.559 |
| Java transformations | 1400/1400 | — |
| Python transformations | 1400/1400 | — |