Skip to content

Methods · Causal inference · Algorithmic fairness

Counterfactual Fairness Assessment

Counterfactual fairness asks whether a model's prediction for a person would stay the same if that person's protected attribute had been different while everything not caused by it stayed the same, under an explicit causal model of how the attribute affects the features.

반사실적 공정성은 보호 속성이 영향을 주는 경로에 대한 인과모형을 세운 뒤, 한 사람의 보호 속성만 달랐다면 모형의 예측이 그대로였을지를 따집니다.

Would my model give the same score to this applicant if only their sex or ethnicity had been different?

다른 조건은 그대로 두고 지원자의 성별이나 인종만 달랐다면 내 모형이 같은 점수를 주었을까요?

Each feature is modelled as a linear effect of the protected attribute plus person-specific noise. The noise is recovered from the data, the attribute is switched, and the counterfactual features are rebuilt. The change in the predictions of the attribute-unaware and attribute-aware models measures counterfactual unfairness, and a predictor built only on the noise terms shows the accuracy cost of a counterfactually fair model.

When to use Counterfactual Fairness Assessment

When to use something else

Assumptions and requirements

What the analysis reports

How to report it

Switching the protected attribute changed the unaware model's predictions by [value] on average; the counterfactually fair predictor had a cross-validated AUC of [value] versus [value].

Related methods

How this method is validated

이 방법의 검증 근거

  • Independent computation. 1 reference test compares the results with statsmodels at a stated tolerance of 1e-6.

    독립 계산. statsmodels 대조 참조 시험 1건 통과(허용오차 1e-6).

Tolerances are relative differences (absolute differences for values near zero). R comparisons and reference tests are re-run before each release of the analysis engine.

허용오차는 상대 차이입니다(0 근처 값은 절대 차이). R 대조와 참조 시험은 분석 엔진을 배포할 때마다 다시 돌립니다.

Run Counterfactual Fairness Assessment on Quorant

Data you need
a table (CSV or Excel) with an outcome variable, a grouping variable and predictor (feature) columns
Price
400 credits for one analysis up to 10,000 rows (complexity level 3); larger or wider data costs more. Optional methodologist review: 1800 credits.
Checking
Compared with independent computations
Before you pay
A free pre-analysis diagnosis checks your data and gives an exact quote; nothing is deducted until you approve it.

Method ID Q81073 · Reviewed 2026-10-25