SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 1910.10255 · 2019

An Empirical Study on Learning Fairness Metrics for COMPAS Data with Human Supervision

arXiv · PDF · Open in the Atlas

Code that ran

4 of 4 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 0 have no contract verdict; 4 failures of our instrument; 0 no recorded run), measured 2026-11-23; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/1910.10255.json · badge: /api/ran/1910.10255.svg

Each repository's role is a label: a classifier's output recorded on the link, or, where no role is recorded, what the Papers with Code archive marked. The line under it names its basis. Neither says who wrote the code.

RepositoryRoleRan
hansen7/LearnFairMetric_Empirical canonical (classifier label)
classifier basis: classifier_2025
4 ran · 0 no recorded run
FunctionStatusWhere it lives
load_dataset_hcon Ran
ran; our contract draft was wrong, not the code
hansen7/LearnFairMetric_Empirical/code/my_LSML_.py
code served (permissive licence) · get_code("70c03d4b573cbdd0")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import pandas as pd
import numpy as np

# Create minimal mock data that satisfies the function's requirements
# The function expects pandas DataFrames with specific columns

def create_mock_broward_data(n_samples=1000):
    """Create a minimal mock BROWARD dataset"""
    data = {
        'id': np.arange(n_samples),
        'race': np.random.randint(1, 4, n_samples),
        'sex': np.random.randint(0, 2, n_samples),
        'age': np.random.randint(18, 80, n_samples),
        'juv_fel_count': np.random.randint(0, 5, n_samples),
        'juv_misd_count': np.random.randint(0, 5, n_samples),
        'priors_count': np.random.randint(0, 10, n_samples),
        'charge_degree (misd/fel)': np.random.randint(0, 2, n_samples),
        'two_year_recid': np.random.randint(0, 2, n_samples),
    }
    return pd.DataFrame(data)

def create_mock_hcon_data(indices):
    """Create a minimal mock HCON dataset"""
    return pd.DataFrame(index=indices)

# Monkey-patch the file reading functions to return mock data
import sys
from unittest.mock import patch

# Create the mock datasets
broward_df = create_mock_broward_data(1000)
hcon_indices = np.arange(100, 300)  # 200 test samples
hcon_df = create_mock_hcon_data(hcon_indices)

# Define ARGS for the load_dataset_hcon function
ARGS = {
    'onehot': True,
}

# Monkey-patch pd.read_csv and pd.read_pickle to return our mock data
original_read_csv = pd.read_csv
original_read_pickle = pd.read_pickle

def mock_read_csv(path, *args, **kwargs):
    if 'BROWARD_CLEAN' in path:
        return broward_df.copy()
    return original_read_csv(path, *args, **kwargs)

def mock_read_pickle(path, *args, **kwargs):
    if 'HCON_long_lik' in path:
        return hcon_df.copy()
    return original_read_pickle(path, *args, **kwargs)

pd.read_csv = mock_read_csv
pd.read_pickle = mock_read_pickle
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, pandas, scipy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple — a tuple output has no array shape of its own; none is stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
one_hot_vec Ran
ran; our contract draft was wrong, not the code
hansen7/LearnFairMetric_Empirical/code/my_LSML_.py
code served (permissive licence) · get_code("f6d3e5b75f3b7538")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1) and returned tuple. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import pandas as pd
import numpy as np

# Create sample DataFrames with the required 'race' column
X_train = pd.DataFrame({
    'race': [1, 2, 3, 1, 2],
    'feature1': [0.1, 0.2, 0.3, 0.4, 0.5],
    'feature2': [1.0, 2.0, 3.0, 4.0, 5.0],
    'feature3': [10, 20, 30, 40, 50]
})

X_test = pd.DataFrame({
    'race': [1, 2, 3],
    'feature1': [0.15, 0.25, 0.35],
    'feature2': [1.5, 2.5, 3.5],
    'feature3': [15, 25, 35]
})

ARGS = {
    'X_train': X_train,
    'X_test': X_test
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
numpy, pandas, scipy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple — a tuple output has no array shape of its own; none is stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
quadruplets_gen Ran
ran; our contract draft was wrong, not the code
hansen7/LearnFairMetric_Empirical/code/my_LSML_.py
code served (permissive licence) · get_code("b1a1e755e629ee5d")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple, ndim 2, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import pandas as pd
import numpy as np

# Create sample data for X_df (features dataframe)
# 6 samples, 4 features
X_data = np.array([
    [1.0, 2.0, 3.0, 4.0],
    [2.0, 3.0, 4.0, 5.0],
    [3.0, 4.0, 5.0, 6.0],
    [4.0, 5.0, 6.0, 7.0],
    [5.0, 6.0, 7.0, 8.0],
    [6.0, 7.0, 8.0, 9.0],
])
X_df = pd.DataFrame(X_data, columns=['feat0', 'feat1', 'feat2', 'feat3'])

# Create sample data for lik_df (likelihood/class labels)
# Must be a pandas Series with same index as X_df
lik_df = pd.Series([0, 1, 2, 0, 1, 2], index=X_df.index, name='likelihood')

ARGS = {
    'X_df': X_df,
    'lik_df': lik_df,
    'subsample': 1e-05
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, pandas, scipy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 2, dtype family float — a tuple output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
similarity_edges_from_metric_by_knn_hcon Ran
ran; our contract draft was wrong, not the code
hansen7/LearnFairMetric_Empirical/code/Similarity_Edges.py
code served (permissive licence) · get_code("9ab3735b708c7ca6")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1) and returned dict. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np
import pandas as pd

# Create a small test dataframe with a pandas Index
np.random.seed(0)
n_samples = 5
n_features = 4

# Create feature data
X_data = np.random.randn(n_samples, n_features)

# Create dataframe with explicit index
X_test = pd.DataFrame(
    X_data,
    index=pd.Index(['sample_0', 'sample_1', 'sample_2', 'sample_3', 'sample_4'], name='idx'),
    columns=[f'feat_{i}' for i in range(n_features)]
)

# Create a metric dictionary with Mahalanobis-like distance matrices
# One matrix per respondent
respondent_idx = 1
d_metric_dict = {
    'R1': np.eye(n_features),  # Identity matrix for simplicity
    'R2': np.eye(n_features) * 0.5,
}

n_neighbors = 2

ARGS = {
    'X_test': X_test,
    'respondent_idx': respondent_idx,
    'n_neighbors': n_neighbors,
    'd_metric_dict': d_metric_dict,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
matplotlib, numpy, pandas, seaborn — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block

Also present in other papers' code

Of 4 samples lifted from this paper's linked repositories, 4 carry a function identity and 0 do not. Of the 4 distinct functions with an identity, 0 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 0 later) and 4 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-23.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

The notion of individual fairness requires that similar people receive similar treatment. However, this is hard to achieve in practice since it is difficult to specify the appropriate similarity metric. In this work, we attempt to learn such similarity metric from human annotated data. We gather a new dataset of human judgments on a criminal recidivism prediction (COMPAS) task. By assuming the human supervision obeys the principle of individual fairness, we leverage prior work on metric learning, evaluate the performance of several metric learning methods on our dataset, and show that the learned metrics outperform the Euclidean and Precision metric under various criteria. We do not provide a way to directly learn a similarity metric satisfying the individual fairness, but to provide an empirical study on how to derive the similarity metric from human supervisors, then future work can use this as a tool to understand human supervision.

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("1910.10255")
get_code_for_paper("1910.10255")
have("1910.10255")

The run record, dated, one paper per request, free:

curl https://syntology.ai/api/ran/1910.10255.json

A badge for a README (the split and the date, never a ratio):

[![Syntology run record](https://syntology.ai/api/ran/1910.10255.svg)](https://syntology.ai/paper/1910.10255)

Connect an agent — have() is free.