Package design, mathematical surfaces, and the public reference-validation packet of a low-dependency Python machine-learning toolkit.
ApexLab packages a narrow set of machine-learning and statistical utilities into a low-dependency Python distribution. The repository's current state emphasizes simplex-constrained regression, distribution-comparison helpers, OLS and binary logistic regression helpers, deterministic splitting, thresholded evaluation, and compact JSON / Markdown report emission. The runtime dependency posture is intentionally small: numpy is the only non-stdlib runtime dependency.
This report documents the public validation packet published on 2026‑03‑24. The packet compares ApexLab statistical-comparison helpers against SciPy, OLS against scikit-learn, and logistic regression against scikit-learn on fixed fixtures. The test statistics and OLS results align to machine precision, while the logistic lane passes its bounded agreement checks and preserves the non-convergence diagnostic as a meaningful engineering signal.
Tooling disclosure. This report and project were developed using a repository governance harness and AI-assisted coding/curation workflow engineered by Joe Waller and enabled through OpenAI and Anthropic tooling. These tools support development and documentation, including summarization and report drafting, and do not replace the author's judgment. Names such as CodeSentinel, ORACL, Calamum, and ApexLab appear as internal identifiers for governance, agent assistance, validation, and project-specific tooling.
ApexLab is a standalone package named apexlab, with a 1.2.0 release target and a single runtime dependency on numpy. Its public surface includes statistical comparison, OLS, logistic regression, anomaly-oriented scoring, deterministic dataset splitting, threshold evaluation, and compact report generation. The 2026‑03‑24 reference packet passed: comparison helpers matched SciPy tightly, OLS matched near machine precision, and logistic classification agreement was preserved with a retained non-convergence flag.
The repository is intentionally small and coherent. The README describes ApexLab as a lean package for practical machine-learning utilities with lightweight dependencies and public report surfaces.
The package metadata is fixed in pyproject.toml: name = "apexlab", version = "1.2.0", requires-python = ">=3.8", and a single runtime dependency on numpy>=1.23. The installed entry point is apexlab = apexlab.cli.main:main.
The package lanes are intentionally narrow: simplex-constrained regression via ApexRegressor; comparison helpers for Mann–Whitney U, KS two-sample, Welch t-test, and Cohen's d; OLS and binary logistic regression helpers; deterministic anomaly detection; deterministic train/test splitting; and compact metric and report emission.
The report uses the same analytic posture as the public validation packet: concrete formulas, fixed fixtures, and explicit acceptance thresholds. The four formulations below map directly to the package's public surfaces.
The ApexRegressor lane solves a least-squares problem whose weight vector is constrained to the probability simplex, keeping learned weights interpretable and sum-normalized:
The OLS lane provides an intentionally thin reference regression path via the closed-form normal-equations solution:
The logistic lane models the class-1 probability through the sigmoid decision form and is fit by minimizing the cross-entropy (log-loss) objective:
Thresholded score evaluation converts a scalar score s into a decision by comparison against an operating threshold τ, and assesses operating quality with accuracy, agreement, and calibration metrics:
The logistic lane and thresholded score evaluation together support compact classification and anomaly-style decision work; the threshold is treated as an operational slice through the empirical score landscape rather than a learned parameter (§6, Fig. 2).
The canonical validation packet asked whether ApexLab's lightweight analytical surfaces are close enough to trusted SciPy and scikit-learn references to support public review and the Observer integration lane without introducing heavy runtime dependencies. Table 1 lists the three validation lanes and their reference surfaces; Table 2 fixes the declared acceptance thresholds.
| Lane | ApexLab surface | Reference surface | Acceptance style |
|---|---|---|---|
| Statistical comparison | mann_whitney_u, ks_two_sample, welch_t_test, cohens_d | SciPy plus analytical Cohen's d | Statistic deltas must remain inside explicit thresholds |
| OLS regression | ols_fit | sklearn.linear_model. | Coefficient and prediction deltas must remain near zero |
| Logistic regression | logistic_fit | sklearn.linear_model. | Accuracy, agreement, probability, and sign checks must pass bounded criteria |
| Quantity | Threshold |
|---|---|
| Mann–Whitney statistic delta | ≤ 1e-9 |
| Mann–Whitney p-value delta | ≤ 5e-2 |
| KS statistic delta | ≤ 1e-9 |
| KS p-value delta | ≤ 5e-2 |
| Welch t delta | ≤ 1e-9 |
| Welch p-value delta | ≤ 5e-2 |
| Cohen's d delta | ≤ 1e-9 |
| OLS coefficient and prediction deltas | ≤ 1e-9 |
| Logistic accuracy delta | ≤ 0.05 |
| Logistic prediction agreement | ≥ 0.90 |
| Logistic probability MAE | ≤ 0.12 |
| Logistic probability correlation | ≥ 0.98 |
| Logistic coefficient sign match | true |
The public packet passed all declared acceptance checks. The statistical-comparison and OLS lanes were effectively machine-precision matches; the logistic lane passed its bounded agreement checks while preserving a non-convergence diagnostic. Table 3 reproduces the packet's quantitative results in full precision.
| Lane | Metric | ApexLab | Reference | Delta / check | Pass |
|---|---|---|---|---|---|
| Statistical comparison | Mann–Whitney U statistic | 0.0 | 0.0 | 0.0 | Yes |
| Mann–Whitney p-value | 0.00018267179110953435 | 0.00018267179110955002 | 1.5667e-17 | Yes | |
| KS statistic D | 1.0 | 1.0 | 0.0 | Yes | |
| KS p-value | 1.8879793657162556e-05 | 0.0 | 1.88798e-05 | Yes | |
| Welch t statistic | 6.847018410831535 | 6.847018410831535 | 0.0 | Yes | |
| Welch p-value | 7.540634783254063e-12 | 3.209558497791793e-06 | 3.20955e-06 | Yes | |
| Cohen's d | 3.062079721962379 | 3.0620797219623794 | 4.44089e-16 | Yes | |
| OLS regression | Maximum absolute coefficient delta | 6.661338147750939e-15 | 6.661338147750939e-15 | 1e-9 band | Yes |
| Maximum absolute prediction delta | 7.105427357601002e-15 | 7.105427357601002e-15 | 1e-9 band | Yes | |
| ApexLab R² | 1.0 | 1.0 | Informational | Yes | |
| ApexLab RMSE | 6.898884543774767e-15 | 6.898884543774767e-15 | Informational | Yes | |
| Logistic regression | Accuracy delta | 0.0 | 0.0 | 0.05 band | Yes |
| Prediction agreement | 1.0 | 1.0 | ≥ 0.90 | Yes | |
| Probability MAE | 0.03230342561928962 | 0.03230342561928962 | ≤ 0.12 | Yes | |
| Probability correlation | 0.9912416474961214 | 0.9912416474961214 | ≥ 0.98 | Yes | |
| Coefficient sign match | true | true | true | Yes | |
| Convergence flag | false | n/a | Informational | Retained |
The test statistics match exactly or to machine precision on the fixed fixtures. P-value differences stay well inside the declared tolerance bands, which is the right criterion for a lightweight implementation that intentionally keeps its own approximation posture.
The OLS lane reproduced reference coefficients and predictions to within floating-point noise. In practical terms, the residual differences are dominated by machine precision rather than algorithmic drift.
The logistic lane achieved perfect prediction agreement and strong probability alignment, but the capped run did not declare convergence. The non-convergence flag is kept as a diagnostic, not hidden behind the pass result.
The companion figures show the validation-adjacent canary score landscape that the public ApexLab packet supports. They are copied into the report asset directory with the same filenames used in the validation lane.
ApexLab keeps its public validation story in the repository tree so readers can inspect the same artifacts cited by the report. The runner, demo, and validation packet are all discoverable without hidden project-state assumptions. The canonical commands are:
python examples/reference_validation_run.py
python examples/evaluation_demo.py
apexlab compare --sample-a 1,2,3 --sample-b 4,5,6 --out-dir out
apexlab report --input out/compare_report.json --out-dir out/rerendered
The public artifact lane comprises the validation landing page and browser-friendly HTML report, the machine-readable validation JSON, the evaluation demo and reference-validation runner, and the public package metadata and README surfaces. Appendix A maps each artifact to its role in this report.
The validation fixtures are small and deterministic. The logistic lane retained a non-convergence diagnostic. The public packet therefore validates reference alignment, not every downstream real-data case.
Next steps are limited to expanding fixture families while keeping the reference packet reproducible, retaining the non-convergence signal in future review packets, and extending the public report surface only when the evidence supports the change.
The appendix lists the exact files used as authority for this report. The paths are kept explicit so execution and review can trace the content back to the repository tree.