Methodology
Every model, algorithm, library, and configuration used in the juryrig project.
All predictive models are scikit-learn classifiers. Python 3.10+, managed via uv.
Models
Scikit-learn1. HistGradientBoostingClassifier (primary)
Histogram-based gradient boosting from scikit-learn. Uses default hyperparameters (no custom tuning).
Post-hoc sigmoid calibration applied via CalibratedClassifierCV.
| Setting | Value |
|---|---|
| Hyperparameters | scikit-learn defaults |
| Calibration | sigmoid (Platt scaling) via CalibratedClassifierCV, cv=3 |
| Preprocessing | OrdinalEncoder for categorical, SimpleImputer for missing |
| Random state | 7 |
2. LogisticRegression (baseline)
Linear classifier from scikit-learn.
| Setting | Value |
|---|---|
| Solver | saga |
| max_iter | 2000 |
| tol | 1e-3 |
| C | 1.0 (default) |
| Preprocessing | MaxAbsScaler + OneHotEncoder, SimpleImputer |
| Random state | 7 |
3. DummyClassifier (floor baseline)
strategy="prior" — predicts training-set class distribution for every sample. Establishes a performance floor.
4. Race-Association Regression Models
Separate logistic regressions used for adjusted race-association analysis (not for prediction):
| Specification | Controls | Hyperparameters |
|---|---|---|
| Core-adjusted | County, charge severity, arrest type, age, gender, ethnicity | LogisticRegression(max_iter=300, C=1.0, solver="saga", random_state=7) |
| Charge-detail | Core controls + law section, charge weight, attempt flag | Same |
Both use OneHotEncoder(drop="first") for categorical encoding.
Calibration
Calibration is applied to the HistGradientBoostingClassifier only.
| Setting | Value |
|---|---|
| Method | Sigmoid (Platt scaling) |
| Cross-validation folds | 3 |
| Implementation | scikit-learn CalibratedClassifierCV |
Calibration evaluation uses 10 quantile-based bins (pd.qcut) to compute bin-wise
average predictions vs. average outcomes.
Evaluation Metrics
| Metric | Role | Definition |
|---|---|---|
| Accuracy | Primary classification | Share of cases classified correctly |
| AUROC | Ranking quality | Area under the ROC curve |
| PR-AUC | Positive-class ranking | Area under the precision-recall curve |
| Brier Score | Calibration quality | Mean squared error of predicted probabilities (lower is better) |
Model selection uses Brier score on the evaluation split. Subgroup metrics computed by Race, Ethnicity, Gender, age_bucket, and Region.
Feature Policy
19 features from OCA-STAT arraignment-time fields. The default configuration (include_all)
includes Gender, Ethnicity, and Race.
Target
| Category | Values |
|---|---|
| Positive | Plea, Verdict-TFG |
| Negative | Dismissed, Dism-ACD, Verdict-ACQ |
| Excluded | Pending, warrant, transfer, other, unknown states |
Leakage-Excluded Fields
Outcome and post-arraignment fields excluded from features:
- Docket Status
- Disposition Type / Detail
- Dismissal Reason
- Most Severe Sentence
- Fines / Fees / Surcharges Imposed
Feature List
Court TypeRegionDistrictCountyCourt
Arresting AgencyArrest TypeArraign YearArraign Month
Top Charge at ArraignmentSeverityWeightLaw
Article.SectionAttempt FlagGenderEthnicity
RaceArrest Age
Data Sources
| Dataset | Source | Grain | Coverage |
|---|---|---|---|
| OCA-STAT | NY Office of Court Administration | One defendant-docket | 2021–2025, monthly refresh |
| DCJS/OCA Supplemental Pretrial | NY Division of Criminal Justice Services / OCA | One criminal cycle | 2019–2024 (Oct 2025 release) |
Both datasets are public. Raw CSVs and processed outputs are not committed to the repository; only aggregate analysis results are published.
Libraries
| Library | Purpose |
|---|---|
scikit-learn | All classifiers, calibration, preprocessing, metrics |
pandas | Data manipulation and feature engineering |
numpy | Numerical operations |
pyarrow | Parquet data storage |
matplotlib | Figure generation (SVG output) |
Model Card
Reference Run| Field | Value |
|---|---|
| Snapshot date | 2026-03-07 |
| Run ID | 20260307_224037 |
| Modeled rows | 1,609,252 |
| Test rows | 271,701 |
| Feature count | 19 |
| Maturity threshold | ≥ 90% disposed share by cohort |
| Best model | HistGradientBoostingClassifier |
| Best AUROC | 0.8644 |
| Best Brier | 0.1496 |