TR-APEXLAB-2026-07 · POLYMATH GLOBAL · APEXLAB PROJECT · TECHNICAL REPORT

ApexLab: Lightweight Machine-Learning Toolkit and Reference Validation

Package design, mathematical surfaces, and the public reference-validation packet of a low-dependency Python machine-learning toolkit.

Abstract

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.

1Executive Summary

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.

2Package Identity and Scope

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.

3Methods and Mathematical Formulation

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.

3.1Simplex-constrained regression

The ApexRegressor lane solves a least-squares problem whose weight vector is constrained to the probability simplex, keeping learned weights interpretable and sum-normalized:

minw ‖Xw − y‖²   s.t.  wi ≥ 0,  Σi wi = 1
(1)

3.2Ordinary least squares

The OLS lane provides an intentionally thin reference regression path via the closed-form normal-equations solution:

β̂ = (Xᵀ X)−1 Xᵀ y
(2)

3.3Binary logistic regression

The logistic lane models the class-1 probability through the sigmoid decision form and is fit by minimizing the cross-entropy (log-loss) objective:

p(y = 1 | x) = σ(xᵀβ) = 11 + e−xᵀβ
(3)
ℒ(β) =Σi [ yi log pi + (1 − yi) log (1 − pi) ]
(4)

3.4Thresholded evaluation

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:

ŷi = 𝟙[ si τ ]
(5)

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).

4Validation Design and Acceptance Thresholds

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.

TABLE 1 · Validation lanes and reference surfaces (packet 2026-03-24)
LaneApexLab surfaceReference surfaceAcceptance style
Statistical comparisonmann_whitney_u, ks_two_sample, welch_t_test, cohens_dSciPy plus analytical Cohen's dStatistic deltas must remain inside explicit thresholds
OLS regressionols_fitsklearn.linear_model.LinearRegressionCoefficient and prediction deltas must remain near zero
Logistic regressionlogistic_fitsklearn.linear_model.LogisticRegressionAccuracy, agreement, probability, and sign checks must pass bounded criteria
TABLE 1 Each lane compares an ApexLab public surface against an external reference implementation on fixed fixtures.
TABLE 2 · Declared acceptance thresholds
QuantityThreshold
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 matchtrue
TABLE 2 Acceptance bands as declared in the packet. Statistic tolerances are tight (1e-9); p-value tolerances are deliberately looser (5e-2) — see the method note below.
Method note The p-value tolerances are looser than the statistic tolerances because ApexLab's implementation intentionally uses a lightweight analytical posture rather than delegating every calculation to SciPy. The test statistics themselves are expected to agree tightly; the p-value approximations are judged against explicit, published bands. The validation packet's role is not to claim universal correctness — it is to show that the lightweight package is faithful enough on fixed fixtures to support the repository's public reporting posture.

5Results and Interpretation

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.

TABLE 3 · Reference-validation results (packet 2026-03-24)
LaneMetricApexLabReferenceDelta / checkPass
Statistical comparisonMann–Whitney U statistic0.00.00.0Yes
Mann–Whitney p-value0.000182671791109534350.000182671791109550021.5667e-17Yes
KS statistic D1.01.00.0Yes
KS p-value1.8879793657162556e-050.01.88798e-05Yes
Welch t statistic6.8470184108315356.8470184108315350.0Yes
Welch p-value7.540634783254063e-123.209558497791793e-063.20955e-06Yes
Cohen's d3.0620797219623793.06207972196237944.44089e-16Yes
OLS regressionMaximum absolute coefficient delta6.661338147750939e-156.661338147750939e-151e-9 bandYes
Maximum absolute prediction delta7.105427357601002e-157.105427357601002e-151e-9 bandYes
ApexLab R²1.01.0InformationalYes
ApexLab RMSE6.898884543774767e-156.898884543774767e-15InformationalYes
Logistic regressionAccuracy delta0.00.00.05 bandYes
Prediction agreement1.01.0≥ 0.90Yes
Probability MAE0.032303425619289620.03230342561928962≤ 0.12Yes
Probability correlation0.99124164749612140.9912416474961214≥ 0.98Yes
Coefficient sign matchtruetruetrueYes
Convergence flagfalsen/aInformationalRetained
TABLE 3 All declared acceptance checks passed. Delta-type metrics report the observed difference in both value columns; band entries name the acceptance criterion the observed value was judged against.

5.1Statistical comparison

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.

5.2OLS regression

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.

5.3Logistic regression

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.

6Figures and Plots

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.

Canary anomaly-score distribution on log-count scale
FIG. 1 Log-count view of the canary anomaly-score distribution. The long tail is easier to inspect in this scale because low-frequency score regions are not visually flattened.
Threshold impact analysis at the current operating point
FIG. 2 Threshold impact analysis at the current operating point. The packet uses the current threshold τ (Eq. 5) as an operational slice through the empirical score landscape.
Canary anomaly-score distribution on linear-count scale
FIG. 3 Linear-count view of the same score distribution. This complements the log view by emphasizing the dense central mass.
FIG. 4 Package-to-report trace. Color encodes role: indigo = validation execution, amber = provenance-bearing artifact packet, teal = public rendering surface.

7Reproducibility and Public Artifacts

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.

8Limitations and Next Steps

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.


AAppendix A · Source Map

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.