Skip to content

Explainer: What Is Unsupervised Learning?#74

Merged
yakew7 merged 1 commit into
yakew7:mainfrom
AnayDhawan:explainer/unsupervised-learning
Jul 14, 2026
Merged

Explainer: What Is Unsupervised Learning?#74
yakew7 merged 1 commit into
yakew7:mainfrom
AnayDhawan:explainer/unsupervised-learning

Conversation

@AnayDhawan

Copy link
Copy Markdown
Contributor

Closes #35.

Concept: Unsupervised learning (k-means clustering) finds structure in unlabelled data, and can recover protected-group structure even when the protected attributes themselves are excluded from the feature set.

Why it belongs in this repo: Every existing audit here starts from a labeled outcome. This explainer covers the no-label case, which the repo didn't have an example of yet, and ties it back to proxy-variables.md and proxy-entanglement.md since the mechanism (proxy features carrying protected-group signal) is the same one, just discovered without supervision.

What's included:

  • Real k-means clustering run against the Benefits Denial audit's adult.csv (32,561 records), using a feature set that excludes sex, race, and native.country outright.
  • Actual output, not illustrative numbers: one resulting cluster is 89.3% male vs a near-even split in the other, and Black applicants appear at more than double the rate in one cluster vs the other. National origin, honestly, does NOT show a meaningful cluster split in this run, and the explainer says so rather than omitting the negative result.
  • A follow-up run stripping the two most obvious sex proxies (relationship, marital.status) shows the demographic split weakens substantially but doesn't vanish, illustrating proxy entanglement in the unsupervised setting.
  • Runnable detection code (cluster_without_protected_attributes + check_cluster_demographic_skew) that generalizes the pattern to any audit's dataset.
  • 4 limitations (no ground truth to evaluate against, k/distance-metric as unavoidable assumptions, harder disparate-impact auditing without labels, dimensionality reduction erasing the very signal being audited for).

All numbers in the PR were generated by actually running the code in the explainer against the repo's own Benefits Denial/adult.csv, not invented.

Closes yakew7#35. Anchors on the Benefits Denial audit's adult.csv: runs
k-means on a feature set that excludes sex, race, and native.country
outright, then checks post-hoc whether the resulting clusters line up
with those attributes anyway. They do for sex (89.3% male in one
cluster) and race (2x Black rate between clusters), but not for
national origin, which the limitations section covers honestly rather
than overclaiming.
@vercel

vercel Bot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

@AnayDhawan is attempting to deploy a commit to the yashkewlani2020-gmailcom's projects Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions

Copy link
Copy Markdown

Hey @AnayDhawan, your first PR on Fair Code, that's awesome, thank you.

This project is about making AI more accountable, and contributions like yours are what keep that work going. We'll review your changes shortly.

If you haven't already, give the contributing guide a quick read: it covers how audits are structured and what we look for in a review.

@yakew7
yakew7 marked this pull request as ready for review July 14, 2026 08:16
@yakew7
yakew7 merged commit 160f452 into yakew7:main Jul 14, 2026
9 of 10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

What Is Unsupervised Learning?

2 participants