SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2010.05166 · 2020

Robust Fairness under Covariate Shift

arXiv · PDF · Open in the Atlas

Code that ran

2 of 3 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 2 have no contract verdict; 0 failures of our instrument; 1 no recorded run), measured 2026-11-22; 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/2010.05166.json · badge: /api/ran/2010.05166.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
arezae4/fair_covariate_shift canonical (classifier label)
classifier basis: census
2 ran · 1 no recorded run
FunctionStatusWhere it lives
prepare_compas Ran
ran on a synthesized input
arezae4/fair_covariate_shift/prepare_data.py
code served (permissive licence) · get_code("960d10fb2241f586")
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 mock data for the COMPAS dataset files
def create_mock_compas_data():
    """Create small mock datasets that mimic the COMPAS structure"""
    # Create temporary dataframes
    dataA = pd.DataFrame({0: [0, 1, 0, 1, 1]})  # Sensitive attribute
    dataY = pd.DataFrame({0: [1, 0, 1, 0, 1]})  # Target/label
    dataX = pd.DataFrame({
        'feat1': [0.5, 0.3, 0.8, 0.2, 0.9],
        'feat2': [-0.1, 0.4, 0.7, 0.1, 0.6],
        'feat3': [0.2, 0.9, 0.3, 0.5, 0.4],
        'feat4': [1.2, 0.8, 0.5, 0.9, 0.3]
    })
    return dataA, dataY, dataX

# Mock the file system by patching pandas.read_csv
import pandas.io.common as pd_common
original_read_csv = pd.read_csv

mock_data_A, mock_data_Y, mock_data_X = create_mock_compas_data()

def mock_read_csv(filepath_or_buffer, *args, **kwargs):
    """Mock read_csv that returns appropriate data based on filename"""
    filepath = str(filepath_or_buffer)
    if 'IBM_compas_A.csv' in filepath:
        return mock_data_A.copy()
    elif 'IBM_compas_Y.csv' in filepath:
        return mock_data_Y.copy()
    elif 'IBM_compas_X.csv' in filepath:
        return mock_data_X.copy()
    else:
        return original_read_csv(filepath_or_buffer, *args, **kwargs)

pd.read_csv = mock_read_csv

# Define arguments for prepare_compas
ARGS = {
    'normalized': True
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, pandas — 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
prepare_drug Ran
ran on a synthesized input
arezae4/fair_covariate_shift/prepare_data.py
code served (permissive licence) · get_code("2001354cc6569719")
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 mock CSV data in memory using pandas DataFrames
# Since we can't do file I/O, we'll create the data directly

# Mock data for drug_A.csv (single column)
dataA = pd.DataFrame(
    np.random.randn(10),
    columns=[0]
)
dataA.index.name = 'id'

# Mock data for drug_Y.csv (single column)
dataY = pd.DataFrame(
    np.random.randn(10),
    columns=[0]
)
dataY.index.name = 'id'

# Mock data for drug_X.csv (multiple features, some outside [0,1] range)
dataX = pd.DataFrame(
    np.random.randn(10, 4) * 10,  # Scale to ensure values outside [0,1]
    columns=['feat_1', 'feat_2', 'feat_3', 'feat_4']
)
dataX.index.name = 'id'

# Patch pandas.read_csv to return our mock data
original_read_csv = pd.read_csv
call_count = [0]

def mock_read_csv(filepath, **kwargs):
    call_count[0] += 1
    if 'drug_A.csv' in filepath:
        return dataA
    elif 'drug_Y.csv' in filepath:
        return dataY
    elif 'drug_X.csv' in filepath:
        return dataX
    else:
        return original_read_csv(filepath, **kwargs)

pd.read_csv = mock_read_csv

ARGS = {
    'normalized': True
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, pandas — 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
prepare_german Not yet run
unverified (harvested, no recorded run)
arezae4/fair_covariate_shift/prepare_data.py
code served (permissive licence) · get_code("1eb4031b2433e393")
How it ran

no invocation recorded.

Also present in other papers' code

Of 3 samples lifted from this paper's linked repositories, 3 carry a function identity and 0 do not. Of the 3 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 3 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-22.

Repositories linked to this paper

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

Abstract

Making predictions that are fair with regard to protected group membership (race, gender, age, etc.) has become an important requirement for classification algorithms. Existing techniques derive a fair model from sampled labeled data relying on the assumption that training and testing data are identically and independently drawn (iid) from the same distribution. In practice, distribution shift can and does occur between training and testing datasets as the characteristics of individuals interacting with the machine learning system change. We investigate fairness under covariate shift, a relaxation of the iid assumption in which the inputs or covariates change while the conditional label distribution remains the same. We seek fair decisions under these assumptions on target data with unknown labels. We propose an approach that obtains the predictor that is robust to the worst-case in terms of target performance while satisfying target fairness requirements and matching statistical properties of the source data. We demonstrate the benefits of our approach on benchmark prediction tasks.

For agents

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

get_harvested_code_for_paper("2010.05166")
get_code_for_paper("2010.05166")
have("2010.05166")

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

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

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

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

Connect an agent — have() is free.