---
id: "compas-two-years"
slug: "compas-two-years"
name: "Compas Two Years"
domain: "Legal & Public Safety"
taskType: "binary_classification"
numRows: 5278
numColumns: 14
targetColumn: "two_year_recidivism"
primaryMetric: "1 - AUC Error"
primaryScore: "0.2701"
parquetUrl: "https://huggingface.co/datasets/carlahq/demo-tabular-benchmarks/resolve/main/data/compas-two-years/compas-two-years.parquet"
spreadsheetUrl: "https://docs.google.com/spreadsheets/d/1Vl_6F-pz0zfHn3yJ5iLyY0Bxbo3SthB6HMk9pQa6rXg/edit?usp=sharing"
canonicalUrl: "https://carlahq.eu/datasets/compas-two-years"
---

# Dataset: Compas Two Years (compas-two-years)

> Canonical benchmark containing 5,278 criminal defendant profiles from Broward County used to evaluate algorithmic fairness and predict two-year recidivism risk.

## Dataset Overview

| Attribute | Value |
| :--- | :--- |
| **Task Type** | `binary_classification` |
| **Business Domain** | Legal & Public Safety |
| **Target Column** | `two_year_recidivism` |
| **Rows (Instances)** | 5,278 |
| **Features (Columns)** | 14 |
| **Primary Evaluation Metric** | 1 - AUC Error |
| **Best Benchmark Score** | **0.2701** |

## Business Decision Context
**Context:** Pre-trial and sentencing risk assessment algorithms evaluate criminal defendants to guide bail, parole, and supervision determinations within municipal and state justice systems.
**Objective:** Predict whether a defendant will be rearrested for a new offense within a two-year observation window following their assessment.
**Decision Impact:** Accurate assessment balances public safety with individual civil liberties. High false positive rates lead to unwarranted detention, severe societal disruption, and disproportionate demographic harm, while false negatives expose communities to preventable public safety risks.

## Feature Schema
| Column Name | Data Type | Role | Distinct Values | Missing Values (%) | Description |
| :--- | :--- | :--- | :--- | :--- | :--- |
| `two_year_recidivism` | `numeric` | target | 2 | 0 | Binary target variable indicating if the individual was rearrested within two years (1 = Recidivated, 0 = No Recidivism). |
| `sex_indicator` | `numeric` | feature | 2 | 0 | Binary encoding of defendant biological sex (1 for Male, 0 for Female). |
| `age_years` | `numeric` | feature | 62 | 0 | Recorded age of the defendant in years at the time of the COMPAS screening. |
| `juvenile_felony_count` | `numeric` | feature | 9 | 0 | Total count of prior juvenile felony offenses recorded on the defendant's record. |
| `juvenile_misdemeanor_count` | `numeric` | feature | 10 | 0 | Total count of prior juvenile misdemeanor charges. |
| `juvenile_other_offense_count` | `numeric` | feature | 8 | 0 | Total count of prior non-felony, non-misdemeanor juvenile infractions or charges. |
| `prior_adult_convictions_count` | `numeric` | feature | 36 | 0 | Total count of prior adult criminal charges and convictions. |
| `is_age_25_to_45` | `numeric` | feature | 2 | 0 | Binary one-hot encoded flag indicating if the defendant's age falls between 25 and 45 inclusive (1 = True, 0 = False). |
| `is_age_greater_than_45` | `numeric` | feature | 2 | 0 | Binary one-hot encoded flag indicating if the defendant is older than 45 years (1 = True, 0 = False). |
| `is_age_under_25` | `numeric` | feature | 2 | 0 | Binary one-hot encoded flag indicating if the defendant is younger than 25 years (1 = True, 0 = False). |
| `is_race_african_american` | `numeric` | feature | 2 | 0 | Binary one-hot encoded flag indicating defendant identification as African American (1 = True, 0 = False). |
| `is_race_caucasian` | `numeric` | feature | 2 | 0 | Binary one-hot encoded flag indicating defendant identification as Caucasian (1 = True, 0 = False). |
| `is_felony_charge` | `numeric` | feature | 2 | 0 | Binary one-hot flag indicating the current arrest charge is classified as a Felony (1 = True, 0 = False). |
| `is_misdemeanor_charge` | `numeric` | feature | 2 | 0 | Binary one-hot flag indicating the current arrest charge is classified as a Misdemeanor (1 = True, 0 = False). |

## Empirical Benchmark Leaderboard
| Rank | Algorithm / Model | Model Family | Runtime | Accuracy | ROC AUC | F1-Score |
| :--- | :--- | :--- | :--- | :--- | :--- | :--- |
| 1 | **Streaming nanotabicl** | Tabular Foundation Model | PyTorch/Python | **68.42%** | 0.7387 | 0.6446 |
| 2 | **TabPFN v3** | Tabular Foundation Model | PyTorch/Python | **68.35%** | 0.7385 | 0.6432 |
| 3 | **EXAONE Tabular** | Tabular Foundation Model | PyTorch/Python | **68.35%** | 0.7388 | 0.6418 |
| 4 | **Google TabFM v1.0** | Tabular Foundation Model | PyTorch/Python | **68.20%** | 0.7381 | 0.6422 |
| 5 | **nanotabicl Vanilla** | Tabular Foundation Model | PyTorch/Python | **68.17%** | 0.7391 | 0.6395 |
| 6 | **Carla Engine (TabICLv2 WebGPU)** | Tabular Foundation Model | Browser | **67.90%** | 0.7353 | 0.6247 |
| 7 | **Full TabICLv2 (PyTorch Reference)** | Tabular Foundation Model | PyTorch/Python | **67.15%** | 0.7299 | 0.6371 |

### Repeated Cross-Validation Fold Scores (TabICLv2 Reference)
| Fold | Train Samples | Test Samples | Metric Score | Latency |
| :--- | :--- | :--- | :--- | :--- |
| Fold 0 | 3518 | 1760 | 0.2722 | 1753ms |
| Fold 1 | 3519 | 1759 | 0.3240 | 1715ms |
| Fold 2 | 3519 | 1759 | 0.2655 | 1720ms |
| Fold 0 | 3518 | 1760 | 0.2629 | 1720ms |
| Fold 1 | 3519 | 1759 | 0.2656 | 1724ms |
| Fold 2 | 3519 | 1759 | 0.2562 | 1731ms |
| Fold 0 | 3518 | 1760 | 0.2411 | 1724ms |
| Fold 1 | 3519 | 1759 | 0.2879 | 1722ms |
| Fold 2 | 3519 | 1759 | 0.2557 | 1723ms |

## Provenance & Downloadable Artifacts
- **Dataset Parquet File:** [Direct Parquet Download](https://huggingface.co/datasets/carlahq/demo-tabular-benchmarks/resolve/main/data/compas-two-years/compas-two-years.parquet)
- **Google Sheets Interactive Demo:** [Open in Google Sheets](https://docs.google.com/spreadsheets/d/1Vl_6F-pz0zfHn3yJ5iLyY0Bxbo3SthB6HMk9pQa6rXg/edit?usp=sharing)
- **OpenML Source:** [OpenML Dataset](https://www.openml.org/d/42192)
- **Academic Paper / Citation:** [Read Research Paper](https://www.propublica.org/article/machine-bias-risk-assessments-in-criminal-sentencing)
- **Canonical HTML Page:** [https://carlahq.eu/datasets/compas-two-years](https://carlahq.eu/datasets/compas-two-years)
