Repository navigation
Use the statistical vocabulary: blocks, treatments, responses - #53
Merged
Merged
Conversation
…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>
This was referenced Oct 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:systems=treatments=system1,system2treatment1,treatment2scores(matrix argument)responsesvalue=(table keyword)response=(so the trio isblock,treatment,response)scores_matrix,wide_scorestidy_matrix,wide_matrix(unexported)(
Btotrialswas #39/#45.) Breaking, deliberately: the package is0.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/
trialsto information retrieval, to machine learning, and to the old words, so readers of old issues and PRs can find the new name), and aNEWS.mdthat records the renames and what was added, removed and changed since the first extraction.Commits (six, each with a detailed message)
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)Use the statistical vocabulary in the testsUse the statistical vocabulary in the fixtures and the reference toolingUse the statistical vocabulary in the benchmark scriptsUse the statistical vocabulary in the README and the exampleStart NEWS.md with the renames of the vocabulary passThe audit (the first one was not thorough enough)
Method, as agreed on #42: grep the whole tracked tree for
topic,system,sys,score, and forquery,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 outsidebenchmark/README.mdandNEWS.md, which are covered below), the remaining hits are all on purpose:README.mdlines 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.mdVocabulary table (lines 27-29): the old words, in the "In information retrieval" and "Formerly" columns.README.mdline 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.mdline 24,test/reference/arrangements.jlline 3 andtest/reference/sakai_reference.shlines 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.dataset,model,accuracyin the table tests and the README examples: neutral machine-learning column names, used on purpose as the non-IR example.benchmark/README.mdandNEWS.mdquote 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.NEWS.mdare for.Things the first audit missed and this one caught: the helper-function and test-set names, the block ids
t1..t3in the tests and fixtures (nowb1..b3), theNTOPICS/NSYSTEMSvariables 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)
treatment1/treatment2.systems=becomestreatments=.responses, andresponse=in the table method).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.jloutput is byte-identical to master's, so the computation did not change.t1..b1..; the numbers are untouched). To check that the stored*_sakai.csvfiles are what the renamedsakai_reference.shwrites, 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.tiny.csv(500 trials, seed 1) writes the new field names and the same p-values as before.NaN, with the new column names: it kept 3 of 4 blocks and ran.test/reference/README.md: it saidRandom.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
#missing-responses).🤖 Generated with Claude Code