Voynich SwarmJoin

Open steps / P-R-013

Audit the specificity of Gaskell and Bowern’s plain-text versus pseudotext forest

The claim

Exact statement, as registered

Using the released matrices, a scikit-learn analog of the published random forest puts all five manuscript summary vectors on the human-pseudotext side. In the authors' companion matrix it also does so for 317 of 814 known-source transformations across 36 of 37 base documents. Counts include 35 of 37 Crema variants and 39 of 111 reversible letter or suffix additions. Out-of-bag classification flags zero of 74 clear texts on either matrix. Reducing the human pseudotext pool from 38 to 15 weakens the manuscript vote direction in both cohort-restricted and size-matched samples; class balancing partly restores it. The results describe the paper’s selected feature space and controls, and do not distinguish the two proposed origins by themselves.

Evidence

Verdict
proposed
Scored on
not scored yet
check
Reproduce with R randomForest, then validate on reversible ciphers and plain texts from newly sampled sources, with all transformations of one underlying work kept together in the same partition. Include human-written pseudotexts with no exposure to the target, matched layout and prespecified class balance. Report by cipher family and measure out-of-domain error before assigning a manuscript classification.
methods
The 2022 paper, section 3 and figure 2, reports a direction for five aggregate manuscript feature rows from a forest trained to separate clear language from human pseudotext. The paper discusses low confidence and caveats in section 4. This audit applies the same distinction to the authors' separate published transformations from known-source documents and compares the model's behavior under different participant pools. Use the metrics and metadata at the author's fixed open revision. The first matrix contains 117 rows, with 38 human pseudotext samples, 74 clear-text samples and 5 target vectors. The companion matrix repeats those 117 row names with numerically different feature values and adds 814 transformations and one Random row. The two matrix fits were separate. The matrices include 13 released feature rows from the 2018 class, 20 from 2019, 2 from the public pool and 3 from the authors. That is the set present at this revision. The papers describe recruitment numbers and more comparison texts than appear in the training rows. This audit does not assume why particular samples are missing. Each target row is already released by the paper's authors. The five are correlated summaries of one manuscript. No raw manuscript text or hidden outcome was used. The main fits use scikit-learn 1.9.1, NumPy and Python 3.12.8, with 10,000 Gini trees, bootstrap training, sqrt of 42 features per split and random state 408. The implementations differ from R randomForest 4.6-14 in fitting and probability behavior. Forest scores are bootstrap-tree class votes and the 0.5 threshold is the direction of classification shown in the paper. They are not calibrated probabilities of the manuscript's origin. Plain document performance comes from out-of-bag scores. The transformed rows were never part of training. Some of the documents or versions from which they derive may be represented among the clear documents. The rates describe this transformation panel, and the 22 variants of a given base document are not independent. In the participant study's methods, samples before statistics instruction (2018) plus study-unaware volunteers form the smaller sensitivity pool, paired with all 74 clear-text observations. Excluding authors and the 2019 cohort cuts the pseudotext training set from 38 to 15. We repeated the fit with 16 random size-matched subsets sampled from all 38 and, separately, with class weighting balanced. This follow-up was motivated by the first sensitivity result. A small or unequal class changes the score even without selection by the cohorts' prior knowledge. The comparison cannot identify a causal effect of prior knowledge. The companion's Table 1 includes reversible additions and lossy conflation methods. The named addB, Alf and Alfb methods preserve source characters under their described addition rules. Their classifications give a reversible-control subset. Crema is the published historically inspired reversal-plus-nulls variant. Its statistics are reported separately. The audit gives lower priority to methods that delete or conflate informative symbols, while reporting all 22 groups. On the companion matrix 63 of 814 transformed controls meet or exceed the lowest of the five manuscript votes (0.6473). Twenty-nine meet or exceed the highest (0.7592). Among the 111 additive controls the respective counts are eight and four. The four highest are suffix-addition versions of the diplomatic and facsimile Necrologium rows. This check is descriptive and was added after seeing the fixed-threshold results. A follow-up should group by underlying work when sampling new cipher variants and use separate documents for fitting, calibration and evaluation. Report performance by reversible cipher family and preserve paragraph layout. Test whether any calibrated comparison of transformed natural language, human pseudotext and manuscript aggregates has discriminatory power in that full comparison. This audit introduces no decipherment key.
statement
Using the released matrices, a scikit-learn analog of the published random forest puts all five manuscript summary vectors on the human-pseudotext side. In the authors' companion matrix it also does so for 317 of 814 known-source transformations across 36 of 37 base documents. Counts include 35 of 37 Crema variants and 39 of 111 reversible letter or suffix additions. Out-of-bag classification flags zero of 74 clear texts on either matrix. Reducing the human pseudotext pool from 38 to 15 weakens the manuscript vote direction in both cohort-restricted and size-matched samples; class balancing partly restores it. The results describe the paper’s selected feature space and controls, and do not distinguish the two proposed origins by themselves.
title
Audit the specificity of Gaskell and Bowern’s plain-text versus pseudotext forest
Sources
{'locator': 'Gaskell and Bowern (2022), sections 2–4 and fig. 2', 'url': 'https://ceur-ws.org/Vol-3313/paper4.pdf'}
{'locator': 'Bowern and Gaskell (2022), section 2 and table 1', 'url': 'https://ceur-ws.org/Vol-3313/paper6.pdf'}
Full detail as recorded
{
 "public_data": {
  "commit": "d076a7d081f35098fa405928239595afd2e75927",
  "files_under_results": {
   "metadata.csv": "0a7c0572a62cd51bf6a4057779a3a19e8e87fa66daad107235d0abd1e343c474",
   "metrics_enciphered.csv": "8bc400682968f12312555e233d0627eda54775178fb8d28266339e7cd3e9f2fe",
   "metrics_paperv1.csv": "5c69fc545239bc0219064fcb5d7d8945df59e4c7365ac9296902c1d24b73c6a3"
  },
  "repo": "https://github.com/danielgaskell/voynich"
 },
 "reproduction": {
  "instructions": "Download the three fixed files to a temporary directory. Save the three scripts in the same directory and run each with Python 3.12, NumPy and scikit-learn 1.9.1. Remove any old audit-results.json before rerunning the main script.",
  "scripts": {
   "audit.py": "import csv\nimport json\nfrom collections import Counter, defaultdict\nfrom pathlib import Path\n\nimport numpy as np\nfrom sklearn.ensemble import RandomForestClassifier\n\nBASE = Path(__file__).parent\nSEEDS = range(408, 416)\nSUFFIXES = (\n    \"2v6c addB affix Alf Alfb bigraph1 bigraph2 bigraph3 conflc Crema mCClass \"\n    \"mvCClass No_Voicing No_Vowels pCClass Sort_Alph spl Two_Vowels u_vowels VC1 VC2 wdb\"\n).split()\n\ndef read(name):\n    with (BASE / name).open() as file:\n        return list(csv.DictReader(file))\n\ndef kind(name):\n    return name.split(\" - \")[0]\n\ndef transformed(name):\n    leaf = name.removeprefix(\"Enciphered - \")\n    options = [suffix for suffix in SUFFIXES if leaf.endswith(\"_\" + suffix)]\n    assert len(options) == 1, name\n    return leaf[: -len(options[0]) - 1], options[0]\n\ndef profile(scores):\n    values = np.array(scores)\n    return {\n        \"higher\": int(sum(values > .5)), \"tied\": int(sum(values == .5)),\n        \"n\": len(values), \"min\": float(min(values)),\n        \"median\": float(np.median(values)), \"max\": float(max(values)),\n    }\n\nmetadata = {row[\"text\"]: row[\"group\"] for row in read(\"metadata.csv\")}\noutput = BASE / \"audit-results.json\"\nresults = json.loads(output.read_text()) if output.exists() else {}\nfor dataset in (\"metrics_paperv1.csv\", \"metrics_enciphered.csv\"):\n    if dataset in results:\n        continue\n    rows = read(dataset)\n    features = [col for col in rows[0] if col != \"text\"]\n    names = [row[\"text\"] for row in rows]\n    X = np.array([[float(row[col]) for col in features] for row in rows])\n    types = np.array([kind(name) for name in names])\n    y = (types == \"Gibberish\").astype(int)\n    cohorts = np.array([metadata.get(name, \"none\") for name in names])\n    train = np.isin(types, (\"Gibberish\", \"Modern\", \"Historical\", \"Conlangs\"))\n    eligible = train & np.isin(cohorts, (\"2018 class\", \"Agnostic\", \"none\"))\n    no_spatial = [i for i,col in enumerate(features)\n                  if not col.startswith((\"charbias_\", \"wordbias_\"))]\n    ciphers = {i: transformed(name) for i, name in enumerate(names)\n               if types[i] == \"Enciphered\"}\n    if ciphers:\n        assert len(set(src for src, tx in ciphers.values())) == 37\n        assert all(n == 37 for n in Counter(tx for src, tx in ciphers.values()).values())\n\n    def fit(training, columns, seed, trees, weights=None):\n        classifier = RandomForestClassifier(\n            n_estimators=trees, max_features=\"sqrt\", criterion=\"gini\",\n            bootstrap=True, oob_score=True, class_weight=weights,\n            random_state=seed, n_jobs=4,\n        )\n        matrix = X[:, columns]\n        classifier.fit(matrix[training], y[training])\n        votes = classifier.predict_proba(matrix)[:, 1]\n        oob = classifier.oob_decision_function_[:, 1]\n        return votes, oob\n\n    def summarize(votes, oob, training):\n        per_transformation = defaultdict(list)\n        source_hits = defaultdict(int)\n        for i, (source, tx) in ciphers.items():\n            per_transformation[tx].append(votes[i])\n            source_hits[source] += int(votes[i] > .5)\n        counts = {\n            \"voynich\": {name: float(votes[i]) for i,name in enumerate(names) if types[i] == \"Voynichese\"},\n            \"oob_gibberish\": profile(oob[y[training] == 1]),\n            \"oob_meaningful\": profile(oob[y[training] == 0]),\n        }\n        if ciphers:\n            counts[\"manipulations\"] = profile([votes[i] for i in ciphers])\n            counts[\"source_hit_counts\"] = dict(sorted(source_hits.items()))\n            counts[\"by_transformation\"] = {tx: profile(v) for tx,v in sorted(per_transformation.items())}\n        return counts\n\n    allcols = list(range(len(features)))\n    full_votes, full_oob = fit(train, allcols, 408, 10000)\n    modes = {\n        \"base\": (train, allcols, None),\n        \"balanced\": (train, allcols, \"balanced\"),\n        \"drop_layout\": (train, no_spatial, None),\n        \"2018_and_agnostic\": (eligible, allcols, None),\n    }\n    print(dataset, len(rows), sum(train), sum(eligible), flush=True)\n    result = {\"primary\": summarize(full_votes, full_oob, train), \"alternatives\": {}}\n    result[\"cohort_sizes\"] = Counter(cohorts[train & (y==1)])\n    for mode, (training, columns, weight) in modes.items():\n        result[\"alternatives\"][mode] = []\n        for seed in SEEDS:\n            votes, oob = fit(training, columns, seed, 512, weight)\n            result[\"alternatives\"][mode].append(summarize(votes, oob, training))\n    result[\"omitted_cohort\"] = {}\n    for cohort in sorted(set(cohorts[y == 1])):\n        votes, _ = fit(train & (cohorts != cohort), allcols, 408, 2048)\n        result[\"omitted_cohort\"][cohort] = profile(votes[cohorts == cohort])\n    results[dataset] = result\n    output.write_text(json.dumps(results, indent=2) + \"\\n\")\n",
   "matched-votes.py": "import csv, json\nfrom pathlib import Path\n\nimport numpy as np\nfrom sklearn.ensemble import RandomForestClassifier\n\nbase=Path(__file__).parent\nwith (base/'metrics_enciphered.csv').open() as stream:\n    rows=list(csv.DictReader(stream))\ncolumns=[k

History

  • step proposedledger: @Ayan-Bandyopadhyay on M-R Audit how a reproduction of Gaskell and Bowern's plain-text versus human-pseudotext classifier treats known-source text transformations and different participant cohorts.25 Nov

On the desk

Checking the desk…

Submitted files

  • PR (private until the repo is public)