age int64 | status int64 | sex int64 | orientation int64 | body_type int64 | diet int64 | drinks int64 | drugs int64 | education int64 | ethnicity int64 | height float64 | income int64 | job int64 | location int64 | pets int64 | religion int64 | sign int64 | smokes int64 | days_since_online int64 | num_languages float64 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
22 | 3 | 1 | 2 | 0 | 0 | 4 | 0 | 3 | 0 | 75 | 43,840 | 19 | 1 | 14 | 0 | 4 | 1 | 2 | 1 |
35 | 3 | 1 | 2 | 2 | 3 | 2 | 2 | 3 | 8 | 70 | 80,000 | 8 | 1 | 14 | 0 | 2 | 0 | 1 | 3 |
38 | 0 | 1 | 2 | 10 | 0 | 4 | 1 | 4 | 5 | 68 | 181,707 | 8 | 1 | 5 | 2 | 7 | 0 | 3 | 3 |
23 | 3 | 1 | 2 | 10 | 5 | 4 | 0 | 3 | 8 | 71 | 20,000 | 18 | 1 | 10 | 2 | 7 | 0 | 2 | 2 |
29 | 3 | 1 | 2 | 1 | 0 | 4 | 0 | 3 | 0 | 66 | 68,730 | 0 | 1 | 14 | 3 | 0 | 0 | 3 | 1 |
29 | 3 | 1 | 2 | 2 | 0 | 4 | 0 | 3 | 8 | 67 | 60,954 | 3 | 1 | 10 | 1 | 10 | 0 | 1 | 2 |
32 | 3 | 0 | 2 | 4 | 0 | 4 | 0 | 3 | 8 | 65 | 0 | 10 | 1 | 14 | 4 | 11 | 0 | 5 | 1 |
31 | 3 | 0 | 2 | 2 | 0 | 4 | 0 | 3 | 8 | 65 | 1,074 | 0 | 1 | 14 | 4 | 8 | 0 | 1 | 2 |
24 | 3 | 0 | 2 | 4 | 0 | 4 | 1 | 3 | 8 | 67 | 34,651 | 10 | 1 | 14 | 4 | 4 | 3 | 1 | 1 |
37 | 3 | 1 | 2 | 1 | 0 | 1 | 0 | 2 | 8 | 65 | 0 | 18 | 1 | 14 | 1 | 2 | 0 | 2 | 1 |
35 | 0 | 1 | 2 | 2 | 0 | 4 | 1 | 3 | 8 |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 | 3 | 0 | 2 | 4 | 0 | 4 | 0 | 4 | 0 | 64 | 67,544 | 7 | 1 | 11 | 0 | 1 | 0 | 6 | 1 |
28 | 3 | 0 | 2 | 4 | 1 | 4 | 0 | 5 | 7 | 64 | 160,849 | 9 | 1 | 11 | 3 | 1 | 0 | 1 | 3 |
OKCupid Dating Profiles — Exploratory Data Analysis
Building a Foundation for a Matchmaking Recommendation System
The Goal
Can we group OKCupid users into distinct "dating personas" based on their lifestyle metrics, and use those groupings as the foundation for a matchmaking recommendation system?
This notebook takes 57,428 raw OKCupid user profiles and transforms them into a clean, fully numeric dataset ready for clustering. Every decision — from which columns to drop to how to handle missing values — is made with one question in mind: will this help us find meaningful groups of people?
Dataset
| Property | Detail |
|---|---|
| Source | OKCupid Profiles — Kaggle |
| Raw profiles | 57,428 users |
| Raw columns | 31 (demographics + lifestyle + 10 free-text essay fields) |
| Cleaned columns | 19 (all numeric, all meaningful) |
| Missing values after cleaning | 0 |
Notebook Structure
The notebook is divided into four main acts:
Act 1 — Data Collection
The dataset is loaded directly from Kaggle using kagglehub — no manual download or API key file needed.
Act 2 — Data Wrangling The raw data is transformed step by step into a clean, fully numeric dataset.
Act 3 — Exploratory Visualization Individual features are explored through histograms, bar charts, and box plots. Relationships between features are uncovered through scatter plots, heatmaps, and stacked bar charts.
Act 4 — Research Questions Two targeted questions are posed and answered visually to test whether distinct user groups actually exist in the data.
Data Wrangling — Step by Step
The raw data needed significant cleaning before any analysis was possible. Here is every transformation applied, in order:
1 — Dropping Irrelevant Columns
Essay columns (essay0–essay9): Ten free-text "about me" fields were removed. These require natural language processing to be useful and are out of scope for a numeric clustering EDA.
Offspring column: Removed because it has a high rate of missing values and does not meaningfully contribute to lifestyle-based persona grouping.
2 — Parsing Dates
The last_online column was a formatted string (YYYY-MM-DD-HH-MM). It was converted into a single number: days_since_online — the number of days since each user was last active. This turns an unanalysable string into a real engagement metric.
3 — Cleaning Free-Text Categoricals
Three columns had the actual category value glued to a user-written commentary:
| Column | Raw example | Cleaned result |
|---|---|---|
religion |
"agnosticism and very serious about it" | "agnosticism" |
sign |
"pisces but it doesn't matter" | "pisces" |
diet |
"mostly vegetarian" | "vegetarian" |
4 — Simplifying High-Cardinality Columns
| Column | Before | After |
|---|---|---|
ethnicity |
193 unique values (multi-listed) | First ethnicity only → 9 unique |
speaks |
5,765 unique language combos | num_languages count (1–7) |
location |
166 city–state pairs | State/region only → 32 unique |
5 — Ordinal Encoding Education
Education has a natural order. It was mapped to a 0–6 integer scale:
| Number | Meaning |
|---|---|
| 0 | Dropped out of high school |
| 1 | High school graduate |
| 2 | Two-year college |
| 3 | College / University (Bachelor's) |
| 4 | Master's program |
| 5 | Law school / Med school |
| 6 | PhD program |
6 — Label Encoding All Remaining Columns
Every other text column (sex, religion, job, status, orientation, etc.) was sorted alphabetically and assigned an integer starting at 0. A full reverse-mapping dictionary was saved so any number can be translated back to its original label.
7 — Handling the Income Sentinel
The income column used -1 to mean "not stated." This was replaced with NaN before imputation so the model treated it as genuinely missing rather than as a real value of negative one dollar.
8 — Predictive Imputation
Instead of deleting rows with missing data or filling with column averages, IterativeImputer was used. This trains a regression model on all other columns to predict each missing value — capturing real relationships like the link between religion and diet, or between job and education level. The dataset went from 14.7% missing cells to 0%.
9 — Outlier Removal
IQR analysis identified three categories of extreme values that would distort clustering:
| Feature | Filter | Reason |
|---|---|---|
| Age | Removed > 70 | Outside the realistic dating pool |
| Height | Removed < 50 in or > 85 in | Biologically implausible — data entry errors |
| Income | Removed > $250,000 | Extreme right skew distorts distance calculations |
Result: A fully numeric, zero-missing-value dataset ready for clustering.
Exploratory Visualizations
Univariate — Who Are the Users?
Age Distribution The user base peaks sharply between ages 25 and 32, with a long right tail. The platform is clearly dominated by young adults in their late 20s and early 30s.
Sex Distribution Approximately 60% of users are male and 40% female — a notable imbalance that has implications for any recommendation system.
Sexual Orientation The dataset includes users across multiple orientations. Straight users make up the large majority, with gay and bisexual users also represented.
Relationship Status The vast majority of users list themselves as "single," confirming this is an active-use dataset rather than a collection of abandoned profiles.
Religion Distribution Agnosticism and atheism are the two most common religions in this dataset — reflecting the platform's San Francisco Bay Area user base.
Job Distribution Tech, student, and "other" dominate. This is consistent with the geographic and demographic concentration of the dataset.
Bivariate — How Do Features Relate?
Sex vs Income Men significantly outnumber women in every income bracket above $50,000. The income gap between sexes is visible and consistent across age groups.
Income Distribution The income distribution is heavily right-skewed, with the majority of users earning under $100,000 and a long tail of high earners.
Sex vs Education Both sexes show similar education distributions overall, but men are slightly overrepresented at the college/university level.
Age vs Median Income Median income rises steadily from the 18–25 group up to the 41–50 bracket, then levels off — a classic career-progression pattern.
Religion vs Drinking Habits A stacked bar chart reveals that religions associated with abstinence (Islam, specific Christian denominations) show markedly lower drinking rates, while atheists and agnostics cluster toward "socially" and "often."
Multivariate — Where Do Patterns Converge?
Full Correlation Heatmap
The complete correlation matrix across all 19 numeric features shows that drinks, smokes, and drugs form a cluster of moderate positive correlations — users who drink heavily are more likely to smoke and use drugs.
Research Questions
Question A — Which combination of 3 lifestyle features produces the largest user groups?
Method: Count the number of users in every unique drinks × smokes × drugs combination. Display as a treemap (rectangle size = group size) and a ranked bar chart.
Plot: Treemap + horizontal bar chart
Finding: A small number of lifestyle combinations account for the majority of users. The dominant group is socially-drinking, non-smoking, non-drug-using users — the "mainstream social" proto-persona. This concentration confirms that the data is not uniform: users genuinely cluster around a few lifestyle profiles.
Verdict: ✅ Supports the persona theory — dominant groups exist.
Question B — Which 3 features contribute so little that removing them won't affect grouping?
Method:
- Coefficient of Variation (CV) bar chart — features with low CV are nearly constant across all users and cannot separate them into groups.
- Correlation heatmap (lower triangle) — features that are highly correlated with another are redundant; removing one loses no information.
Plot: Side-by-side: CV bar chart + correlation heatmap
Finding: Features with the lowest variance are the weakest separators. Any feature that is both low-variance and strongly correlated with another feature is a prime candidate for removal before clustering. This gives a principled, data-driven answer to feature selection.
Verdict: ✅ Identifies 3 removable features — reduces noise before clustering.
Conclusion
The research question is supported by the data.
Four pieces of evidence back the hypothesis that distinct dating personas exist in this dataset:
- Lifestyle habits are correlated — drinks, smokes, and drugs move together, forming a natural habit-cluster axis.
- A few combinations dominate — the treemap shows users concentrate around a small number of lifestyle profiles rather than spreading uniformly.
- Features have high separating power — age, income, and days_since_online show high variance, giving any clustering algorithm meaningful axes to work with.
- Demographic patterns are systematic — the gender income gap and generational smoking patterns confirm that the data has internal structure, not random noise.
The cleaned dataset produced by this notebook is the direct input for the next step: K-Means or hierarchical clustering to formally identify and label the personas.
How to Run This Notebook
- Open in Google Colab
- Run Cell 3 (
!pip install kagglehub) — no API key needed - Run all cells top to bottom
- The cleaned CSV is saved to
/mnt/user-data/outputs/okcupid_cleaned.csv
Dependencies: pandas, numpy, matplotlib, seaborn, scikit-learn, squarify, kagglehub
File Structure
EDA_OKCUPID_personas.ipynb ← Main notebook
KAGGLE_README.md ← This file
Benjamin — Data Science Assignment 1, 2026
- Downloads last month
- 74















