ML22 재현 가능한 비교 / Reproducible comparisons

기본 사용 / Quick start
1. 이 폴더에 네 actual*.csv와 두 코드 파일을 함께 둡니다.
   Keep the four actual*.csv inputs beside the Python/R programs.
2. Python (standard library only):
   python reproduce-wine-churn-comparison.py --source-dir . --output-dir run-python
3. R >=4.5 (base environment, tools::sha256sum):
   Rscript reproduce-wine-churn-comparison.R --source-dir . --output-dir run-r
4. 출력 폴더는 새롭거나 비어 있어야 합니다. Earlier outputs are preserved.

원자료 / Factual inputs
* Wine: 1,599 red + 4,898 white native records; 11 chemical inputs + quality.
  Combined model adds a declared red indicator; source unit is a wine record.
  Cortez, Cerdeira, Almeida, Matos and Reis (2009); DOI10.24432/C56S3T; CC BY4.0.
  https://archive.ics.uci.edu/dataset/186/wine+quality
* NLS: 3,613 native male records from 1976, with 52 native fields and original IDs.
  Native lwage76 target; 603 missing labels retained without assuming their cause.
  https://davidcard.berkeley.edu/data_sets.html
* Iranian Churn: 3,150 records, 13 predictors + Churn, native header spacing retained.
  First-nine-month attributes and end-of-month-twelve labels per official documentation.
  Seven native charge-code values 10 are retained despite the documented range 0..9.
  DOI10.24432/C5JW3Z; CC BY4.0.
  https://archive.ics.uci.edu/dataset/563/iranian+churn+dataset

Original ZIPs are retained unchanged in originals/. The codebook, names and SAS
files are alongside the code.
The actual CSVs preserve every native field/token with source-row tracking.
The programs open only the four declared CSVs, not models or answer outputs.

분할과 비교 / Split and comparison
ASCII original-ID or X-only fingerprint groups are sorted then shuffled by
LCG32 Fisher-Yates, seed 20261104. Group rank modulo four assigns test/validation/train/train
before completeness. Fingerprints do not authenticate physical identity or IID
sampling. All five candidates share the same complete training frame and train-only
means/ranges. Constant, ridge lambda .01/.1/1, stump minLeafRows5.
Validation mean MSE selects; exact ties keep declaration order. Test never selects.
Optional --criterion worst-cohort is a separate declared experiment.

출력 / Outputs (7CSV)
benchmark-metrics.csv: risks and binary diagnostics for every candidate, role and cohort.
model-parameters.csv: transforms and parameters, declared units.
complete-prediction-ledger.csv: all 13,260 original rows and selected/baseline predictions.
candidate-selection.csv: validationcriterion and testMSE for every candidate.
paired-test-losses.csv: all planned test rows, retaining missing labels.
group-deletion.csv: frozenprediction/selection delete-one-group diagnostics.
graph-values.csv: original-source-order coordinates, not calendar time.

Python keeps exact rational strings from native decimals. R uses binary64 fits
and risks, explicit stump tie tolerance 1e-12, approximate numeric output columns.
R native fingerprint canonicalization guards exact-small-integer arithmetic.
Exact-zero, nonzero/displayzero, displayoverflow and undefined are distinct.
Graph CSVs can have different row order: compare by dataset/id/series keys.
Do not read an empty R exact column as zero.

해석 / Scope
Wine numeric loss is an ordinal-score convention, not consumer utility or price.
NLS prediction is not an education causal effect. Churn scores are not proved
calibrated, and default 0.5 classification predicts no positives in the test.
Test paired deletion freezes models and selection; no automatic CI/p-value.
Cross-dataset raw MSE units differ and are not averaged/ranked together.
Original paper scores and this chapter's new comparison are different protocols.

그림 재현 / Figure reproduction
The comparison creates seven CSVs. A separate supplied postprocessor creates
source-chart-coordinates.csv and source-figure-data.json for all twelve charts:
python plot-comparison-results.py --input-dir run-python --output-dir run-plots --coordinates-only
Remove --coordinates-only to create all 24 SVG and 24 PNG originals; this optional
step requires Matplotlib and a Korean-capable font. Source order is not time.
The exact coordinate CSV has 9,909 point slots, preserving 477 missing coordinates.
These are new chapter figures, distinct from original-paper figures.
