Skip to content

Use the statistical vocabulary: blocks, treatments, responses - #53

Merged
jerome-white merged 6 commits into
masterfrom
issue-42-vocabulary
Oct 22, 2026
Merged

jerome-white merged 6 commits into
masterfrom
issue-42-vocabulary

Conversation

@jerome-white

@jerome-white jerome-white commented Oct 22, 2026 •

Copy link
Copy Markdown
Owner

Closes #42. Part of #38.

What this does

Replaces the information-retrieval words the package came with (topic, system, score, B) by the statistical ones, in the API, the code, the tests, the fixtures, the reference tooling, the benchmark scripts and the docs, using the decisions taken on #42:

Before Now
systems= treatments=
result fields system1, system2 treatment1, treatment2
scores (matrix argument) responses
value= (table keyword) response= (so the trio is block, treatment, response)
scores_matrix, wide_scores tidy_matrix, wide_matrix (unexported)
topic, system, score everywhere else block, treatment, response

(B to trials was #39/#45.) Breaking, deliberately: the package is 0.1.0-DEV, nothing depends on it, so there is no deprecation. Error messages changed with the words ("need at least two treatments", "responses contain N NaN values", "more than one response for block ... and treatment ...").

Also: a Vocabulary section in the README (a table mapping block/treatment/response/trials to information retrieval, to machine learning, and to the old words, so readers of old issues and PRs can find the new name), and a NEWS.md that records the renames and what was added, removed and changed since the first extraction.

Commits (six, each with a detailed message)

  1. Use the statistical vocabulary in the library: blocks, treatments, responses (src/, plus the call sites in tests, snapshot script and example, so the suite passes)
  2. Use the statistical vocabulary in the tests
  3. Use the statistical vocabulary in the fixtures and the reference tooling
  4. Use the statistical vocabulary in the benchmark scripts
  5. Use the statistical vocabulary in the README and the example
  6. Start NEWS.md with the renames of the vocabulary pass

The audit (the first one was not thorough enough)

Method, as agreed on #42: grep the whole tracked tree for topic, system, sys, score, and for query, relevan, retriev, TREC, NTCIR, IR, dataset; classify each hit as rename, keep or glossary; rerun at the end and list what remains.

Before: over a hundred hits in src/ and several hundred in the tests (counted per word, so a line with two words counts twice; the table is on #42), plus the reference scripts, the benchmark files, the example and the README. After (everything outside benchmark/README.md and NEWS.md, which are covered below), the remaining hits are all on purpose:

  • README.md lines 4-5: the opening sentence says "treatments (systems, models, methods) over blocks (topics, datasets, folds)", to say what the words mean in the fields it is used in.
  • README.md Vocabulary table (lines 27-29): the old words, in the "In information retrieval" and "Formerly" columns.
  • README.md line 133: the example of an undefined block, "a topic with no relevant documents", after "a dataset where the metric is undefined for every model".
  • test/reference/README.md line 24, test/reference/arrangements.jl line 3 and test/reference/sakai_reference.sh lines 4-5: one sentence each saying that Sakai's tool calls blocks topics and treatments systems, where the scripts describe the file format of his program.
  • The NTCIR URL of Discpower (README and script) and the tool's name: a citation, not vocabulary.
  • dataset, model, accuracy in the table tests and the README examples: neutral machine-learning column names, used on purpose as the non-IR example.
  • benchmark/README.md and NEWS.md quote the old words: the first is a record of measurements and is kept as recorded, with a note at the top that maps its words (B, systems, topics, scores) to the new ones; the second is the rename history.
  • Git history, issues and PRs keep the old words; that is what the Vocabulary table and NEWS.md are for.

Things the first audit missed and this one caught: the helper-function and test-set names, the block ids t1..t3 in the tests and fixtures (now b1..b3), the NTOPICS/NSYSTEMS variables of the shell script, the printed header of the benchmark, the header of Sakai's reference output (system1,system2,...), and the fixtures' own header (topic,system,score).

Decisions made (on #42, by the owner)

  • Output fields: treatment1/treatment2.
  • systems= becomes treatments=.
  • The measured value is the response (responses, and response= in the table method).
  • Start a NEWS.md.

Verification

  • ] test: 136 pass + 1 deliberately broken, at 1 and at 4 threads: the same count as master, since only names changed.
  • benchmark/snapshot.jl output is byte-identical to master's, so the computation did not change.
  • The fixtures were renamed in place (headers and the ids t1..b1..; the numbers are untouched). To check that the stored *_sakai.csv files are what the renamed sakai_reference.sh writes, I ran the script on the three fixtures (it downloads and builds Discpower, a few seconds each): its output is identical to the stored files.
  • The example script run on tiny.csv (500 trials, seed 1) writes the new field names and the same p-values as before.
  • The README recipe for complete cases was run on a tidy file with a NaN, with the new column names: it kept 3 of 4 blocks and ran.
  • 80 columns checked on every tracked text file except the fixtures and the recorded benchmark tables.
  • One stale statement was fixed on the way, in test/reference/README.md: it said Random.seed! does not make multi-threaded runs reproducible (true before Run trials in fixed-size chunks so results do not depend on the thread count #25).

Not covered

  • The README rendering on GitHub (the table, the anchor link #missing-responses).
  • The Julia 1.9 CI job, which is the first run of this code there.
  • The recorded benchmark tables were not re-run with the new column headers.

🤖 Generated with Claude Code

jerome-white and others added 6 commits October 22, 2026 10:04
…sponses

The library spoke the language of the IR tool it came from (topics,
systems, scores). The structure is a randomized block design, so it now
uses the neutral names, chosen on #42:

- keyword `systems=` -> `treatments=`;
- result fields `system1`, `system2` -> `treatment1`, `treatment2`;
- the tidy-table keyword `value=` -> `response=` (so the trio is block,
  treatment, response), and the matrix argument `scores` -> `responses`;
- helpers: `scores_matrix` -> `tidy_matrix`, `wide_scores` ->
  `wide_matrix`, `_table_scores` -> `_table_responses`;
- internals: `nsystems` -> `ntreatments`, `ntopics` -> `nblocks`,
  `sysmeans` -> `means`, the index dictionaries and loop variables;
- every docstring, comment and error message ("need at least two
  treatments", "responses contain N NaN values", "more than one response
  for block ... and treatment ...", "N treatment names for M
  treatments"), and the examples in the docstrings.

"Response" is the statistics term for what is measured in a designed
experiment, where blocks and treatments are the factors. The other
candidates, measurement and observation, are discussed on #42.

The call sites in the tests, the snapshot script and the example are
updated in the same commit so that the suite passes (the keyword and the
field names changed). Their own variable names, comments and fixtures,
and the README, are done in the next commits, because they do not change
what the code does.

The computation is untouched: the suite passes with the same count (136
plus the 1 deliberately broken) and benchmark/snapshot.jl output is
byte-identical to master's.

Refs #42
Part of #38

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Renames the identifiers, test names and comments of the tests to blocks,
treatments and responses, to follow the library (previous commit):

- constants and helpers: SCORES -> RESPONSES, NAMES -> TREATMENTS,
  TOPICS -> BLOCKS, read_scores -> read_responses, and the table-building
  helpers of test/table_input.jl (tidy_table_of, wide_table_of; the old
  tidy_columns_of was named after a function that no longer exists);
- local variables (scores, systems, topics, ntopics, nsystems) and the
  descriptions of the test sets ("4 blocks x 3 treatments",
  "default treatment names are column numbers", "NaN responses are
  rejected", "a single block always gives p = 1");
- block ids in the tests: "t1".."t3" -> "b1".."b3", so they do not read as
  topics (the treatment names A, B, C are unchanged);
- long lines that the renames produced are re-wrapped to 80 columns.

Nothing else changes: the suite passes with the same count (136 plus the 1
deliberately broken). The fixtures in test/data and the reference scripts,
which read them, are renamed in the next commit.

Refs #42
Part of #38

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The fixtures were in the format of Sakai's tool (topic,system,score with
ids t1..). They are now block,treatment,response with ids b1.., and the
reference outputs of his code are treatment1,treatment2,difference,p, to
match the library's result fields. Only names change in the files; the
numbers are untouched.

The reference scripts follow: sakai_reference.sh (variables NBLOCKS and
NTREATMENTS, comments and the header it writes) and arrangements.jl say
block and treatment, and note once, where they describe his permuted-matrix
format, that Sakai's tool calls blocks topics and treatments systems. The
README in test/reference does the same, with trials for the number of
trials in the tolerance formula and "his `B`" for his parameter.

Checked by running the renamed sakai_reference.sh on the three renamed
fixtures (it downloads and builds Discpower, a few seconds each): its
output is identical to the stored *_sakai.csv files, so the files are
what the script writes, not only edited by hand.

One stale statement is corrected on the way: the README said that
Random.seed! does not make multi-threaded runs reproducible, so failures
should be re-run. Since #25 the p-values for a seed are the same at any
thread count, and the tests seed the generator, so a failure is
reproducible and not a flake.

The suite passes with the same count (136 plus the 1 deliberately broken).

Refs #42
Part of #38

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
benchmark/randomized_tukey.jl and benchmark/snapshot.jl say blocks,
treatments and responses: the grid constants (TREATMENTS, BLOCKS), the
variables, the comments, and the column headers the benchmark prints
(treatments | blocks | trials).

benchmark/README.md is a record of measurements, so the tables and the
analysis text are kept as they were recorded, with their old headers and
words; a note at the top says what they map to (B is trials, systems are
treatments, topics are blocks, scores are responses) and that new runs
print the new headers. Only the paragraph that describes what the script
does now is rewritten.

Checked: benchmark/snapshot.jl output is byte-identical to master's, since
only names and one re-wrapped line change.

Refs #42
Part of #38

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
README: adds a "Vocabulary" section with a table that maps block,
treatment, response and trials to the words of information retrieval and of
machine learning and to what they were called before (topic, system, score,
B), so a reader of an old issue or pull request can find the new name, and
says that the citations and the reference tests keep Sakai's own words
where they quote his tool. The rest of the text, the code examples, the
section "Missing scores" (now "Missing responses", and its anchor link) and
the recipes for complete cases use treatments, blocks and responses; the
tidy recipe reads rows.response. The example data file is called data.csv.
Two things stay on purpose, as examples of the fields it is used in: the
opening sentence names systems and topics next to treatments and blocks, and
the note on undefined blocks mentions a topic with no relevant documents
after a dataset where a metric is undefined.

examples/run.jl reads the columns block, treatment and response (the
fixtures use these names now) and its comments say responses.
benchmark/README.md has one paragraph re-wrapped to 80 columns.

Checked: the example script run on test/data/tiny.csv with 500 trials and
seed 1 writes treatment1,treatment2,mean1,mean2,difference,pvalue and the
same p-values as before (0.386 and 0.0 for the first two pairs).

Refs #42
Part of #38

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Adds the release notes the earlier issues left open (#39, #42), with one
"Unreleased" section because the package is pre-release and untagged. It
records what each renamed term became (B -> trials, systems= ->
treatments=, system1/system2 -> treatment1/treatment2, scores -> responses,
value= -> response=, the two unexported helpers, and the words in
documentation, identifiers and fixtures), the changed error messages, and,
so that the file is a usable history and not only a rename list, what was
added (the generator argument, table input, thread-count-independent
results), removed (the CLI, with a pointer to the commit that has it) and
changed (NaN is an error; p-values counted by binary search without
allocation) since the first extraction, with the issue and pull request
numbers.

Refs #42
Part of #38

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@jerome-white jerome-white self-assigned this Oct 22, 2026
@jerome-white
jerome-white merged commit a0c8bb0 into master Oct 22, 2026
4 checks passed
@jerome-white
jerome-white deleted the issue-42-vocabulary branch October 22, 2026 04:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Neutral vocabulary: blocks and treatments in docs and output

1 participant