📺 A 6-minute walkthrough covering the entire project: data exploration,
feature engineering, model training, and key insights.
📊 Project Overview
This project predicts annual developer compensation (salary) based on factors
like experience, location, technologies, education, and AI tool adoption.
The data comes from the Stack Overflow Annual Developer Survey 2024,
covering 65,437 developers worldwide.
🎯 Objectives
Regression: Predict exact salary in USD
Classification: Categorize developers into salary tiers (Low/Medium/High)
Salary distribution showing extreme right-skewness and the value of log transformation for modeling.
Data Structure
100 categorical (object) columns
13 float columns
1 integer column (ResponseId)
Most predictive features need conversion from text to numeric
Top Paying Countries (by median salary)
Rank
Country
Median Salary
Sample Size
1
USA
$141,000
4,596
2
Israel
$113,334
217
3
Switzerland
$111,417
385
4
Australia
$95,796
505
5
Ireland
$91,295
120
6
Denmark
$88,993
211
7
Canada
$87,231
861
8
UK
$84,038
1,376
Key insight: Geographic location is the most powerful predictor of salary.
The same role can earn 5-10x more in the US/Israel/Switzerland compared to
emerging economies.
Geographic Salary Variance
Boxplot analysis revealed:
USA: Median $140K with high variance ($100K-$200K interquartile range),
many high-end outliers reaching $500K+
Western Europe (Germany, UK): Median $70-85K, moderate variance
Eastern Europe (Poland, Ukraine): Median $35-55K, but with significant
high-end outliers (likely remote workers for foreign companies)
Emerging markets (India, Brazil): Median $15-25K, low variance
Salary range from highest to lowest country median: ~10x difference
Salary by Country
Salary distributions across the top 10 countries (by sample size). USA dominates both in median salary and variance.
Top Paying Developer Roles
Rank
Role
Median Salary
1
Senior Executive (C-Suite, VP)
$120K
2
Engineering Manager
$115K
3
Engineer, Site Reliability (SRE)
$98K
4
Cloud Infrastructure Engineer
$96K
5
Security Professional
$80K
6
Data Engineer
$77K
7
Developer, AI
$75K
8
Data Scientist / ML Specialist
$73K
9
Back-end Developer
$68K
10
Full-stack Developer
$64K
Key insights:
Specialization pays: Infrastructure roles (SRE, Cloud) earn 30-50% more
than general development roles
Management track: Engineering managers and executives top the list
Counter-intuitive finding: AI Developer ranks 7th, not at top despite
the AI hype - market still developing
Full-stack paradox: Largest group (18,260 respondents) but lowest median
in top-15, suggesting market saturation
Top Developer Roles
Top 15 developer roles ranked by median salary. Note how specialized infrastructure roles (SRE, Cloud) outperform general development roles.
Experience vs Salary Relationship
Overall correlation: 0.38 (moderate, due to country variance)
Career growth pattern observed:
Years 0-10: Steep growth ($25K → $78K, 3x increase)
Years 10-20: Continued growth ($78K → $95K)
Years 20+: Plateau effect (~$100-110K, role-dependent)
Within-country correlation is much stronger than overall correlation
Median professional experience in dataset: 8 years
Salary vs Experience
The career growth curve: rapid early growth followed by plateau effect after ~20 years.
Within-country correlations between experience and salary:
Germany: 0.438 (highest - structured market)
India: 0.394 (experience matters)
USA: 0.319 (role/company matter more)
UK: 0.271
Canada: 0.299
Insight: The same career trajectory yields vastly different outcomes
based on geography. A junior developer in USA ($65K) earns more than a
senior developer in India ($45K after 25 years). This makes country a
critical feature for the model.
Experience by Country
The "geography is destiny" effect: same experience yields drastically different salaries across countries.
Technology Indicators (Linear Correlation with Salary)
Technology
Users
%
Correlation
AWS
9,894
43.5%
+0.139
Go
3,388
14.9%
+0.087
Rust
2,853
12.5%
+0.082
Copilot
8,203
36.0%
+0.060
Scala
669
2.9%
+0.058
Azure
5,825
25.6%
+0.047
Python
11,142
48.9%
+0.044
Kubernetes
4,180
18.4%
-0.004
Docker
11,591
50.9%
-0.002
ChatGPT
14,827
65.1%
-0.102
Insights:
AWS is the strongest single technology indicator - likely because
AWS adoption correlates with established tech companies in higher-paying countries
Docker, Kubernetes, Terraform show ~0 linear correlation despite
being valuable skills - they have become industry standards (commoditized)
ChatGPT usage is negatively correlated - consistent with junior
developers relying more on AI tools than senior engineers
These features still provide value through non-linear interactions
in tree-based models (Random Forest, XGBoost)
Key Predictive Features Identified
YearsCodePro - Years of professional coding experience
Country - Geographic location (massive impact)
EdLevel - Education level (8 ordered categories)
DevType - Developer role type (34 categories - needs grouping)
OrgSize - Company size (10 ordered categories)
RemoteWork - Remote/Hybrid/In-person
🛠️ Methodology
Data Preprocessing
Filtered rows with valid salary data (65,437 → 22,765 after outlier removal)
Removed extreme outliers (<$1K and >$500K)
Applied log transformation to target (handles right-skewed distribution)
Country Grouping: 185 countries → 11 regions based on geography and economy
DevType Grouping: 34 roles → 7 broader categories
Multi-select handling:
Created 5 binary indicators for Employment status
Count features for technologies (num_languages, num_databases, etc.)
Binary flags for high-value technologies (uses_AWS, uses_Python, etc.)
One-Hot Encoding: Applied to Region, DevCategory, RemoteWork, Industry
Final dataset: 22,765 samples × 68 features
Models Trained
Regression: Linear Regression, Random Forest, XGBoost
Classification: Logistic Regression, Random Forest, XGBoost
Clustering: K-Means with K=4 (chosen via Silhouette analysis)
📈 Results
Regression Model Performance
Model
R² (log)
R² ($)
MAE ($)
RMSE ($)
Training Time
Linear Regression
0.5319
0.4333
30,917
49,592
<1s
Random Forest
0.5698
0.5121
28,005
46,018
30s
XGBoost (best)
0.5840
0.5326
27,513
45,039
2.6s
Best Model: XGBoost with R² = 0.5326 (explains 53% of salary variance)
Feature Importance Analysis
Top features driving predictions (XGBoost):
Rank
Feature
Importance
1
Region_North_America
36.58%
2
Region_Western_Europe
8.89%
3
Region_Asia_Developing
6.86%
4
Region_Asia_Pacific_Developed
4.62%
5
YearsCodePro
3.28%
Feature Importance by Category
Category
Total Importance
🌍 Region (Geography)
67.0%
💻 Tech indicators
6.9%
⏰ Experience
5.7%
🏭 Industry
5.5%
💼 Employment status
4.9%
🏢 Other
3.4%
💼 Developer Category
3.1%
📊 Tech counts
1.9%
👤 Demographics
1.6%
Key insight: Geography is the dominant predictor (67%), confirming our EDA finding
that location matters more than skills, experience, or role for salary determination.
The same developer in different regions can have 5-10x salary differences.
Feature Importance
Top 20 most important features in XGBoost. Region_North_America alone accounts for 36.6% of model decisions.
Classification Model Performance
Salary categorized into 3 classes (33%/33%/33%):
Low: < $46,185
Medium: $46,185 - $91,719
High: > $91,719
Model
Accuracy
Logistic Regression
68.72%
Random Forest
69.38%
XGBoost (best)
70.39%
Best Classifier: XGBoost with 70.39% accuracy (vs 33% baseline)
Per-Class Performance (XGBoost)
Category
Accuracy
Precision
Recall
F1-Score
Low
75.77%
0.7602
0.7577
0.7589
High
74.14%
0.7595
0.7414
0.7503
Medium
61.57%
0.5999
0.6157
0.6077
Key insights:
Model excels at distinguishing extreme categories (Low/High)
Misclassifications between Low ↔ High are rare (~4%)
Medium category is hardest to classify (boundary cases)
Model tends to predict Medium when uncertain (conservative strategy)
Confusion Matrix
XGBoost confusion matrix. The model rarely confuses Low with High (~4% error rate), but Medium is harder to classify.