Explainer: What Is Unsupervised Learning?#74
Merged
Conversation
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.
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. |
|
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
marked this pull request as ready for review
July 14, 2026 08:16
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.mdandproxy-entanglement.mdsince the mechanism (proxy features carrying protected-group signal) is the same one, just discovered without supervision.What's included:
adult.csv(32,561 records), using a feature set that excludessex,race, andnative.countryoutright.relationship,marital.status) shows the demographic split weakens substantially but doesn't vanish, illustrating proxy entanglement in the unsupervised setting.cluster_without_protected_attributes+check_cluster_demographic_skew) that generalizes the pattern to any audit's dataset.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.