Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,5 @@
/mining/ eccentricAryan404 @TODO_ADITYA
/ml/ @TODO_ADITYA eccentricAryan404
/api/ Archit1302-wolf ssp0009
/fixtures/ Archit1302-wolf ssp0009
/scripts/ Archit1302-wolf ssp0009
/api/routes/match.py AtulACleaver Archit1302-wolf
/api/routes/readiness.py AtulACleaver Archit1302-wolf
/api/routes/gap.py AtulACleaver Archit1302-wolf
/frontend/ ssp0009 Archit1302-wolf
/docs/contracts.md AtulACleaver @TODO_ADITYA eccentricAryan404 Archit1302-wolf ssp0009
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ artifacts/*
!artifacts/*.json
*.pkl
*.parquet
!fixtures/*
.vercel/
__pycache__/
.ipynb_checkpoints/
.env
Expand Down
49 changes: 49 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
PYTHON := $(if $(wildcard .venv/bin/python),.venv/bin/python,python)

.PHONY: all setup raw clean-data label train rules export all bench test api web fetch-data reset

setup:
@if [ ! -d .venv ]; then python3.12 -m venv .venv 2>/dev/null || python3 -m venv .venv; fi
.venv/bin/pip install -r requirements-dev.txt
cd frontend && npm ci

raw:
$(PYTHON) -m etl.raw

clean-data:
$(PYTHON) -m etl.profile
$(PYTHON) -m etl.clean

label:
$(PYTHON) -m etl.label

train:
$(PYTHON) -m ml.train

rules:
$(PYTHON) -m mining.rules

export:
$(PYTHON) -m ml.export_runtime

all:
$(PYTHON) -m etl.pipeline

bench:
$(PYTHON) -m mining.fpgrowth_bench

test:
$(PYTHON) -m ruff check .
$(PYTHON) -m pytest -q

api:
$(PYTHON) -m uvicorn api.main:app --reload --port 8000

web:
cd frontend && npm run dev

fetch-data:
gh release download data-v3 --dir data/

reset:
rm -rf data/*.parquet data/*.csv data/stats artifacts/*.pkl artifacts/*.parquet
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ skillgraph/
├── taxonomy/ # Aryan — hand-edited skill aliases & role families
├── api/ # Archit — FastAPI serving layer
├── frontend/ # Shashank — Vite + React UI
├── fixtures/ # Archit — fake artifacts for dev
├── tests/ # each person owns their module's tests
├── docs/ # data audit, contracts, model writeup
├── data/ # GITIGNORED — rebuilt by the pipeline
Expand Down
Empty file removed api/cache.py
Empty file.
Empty file removed api/routes/__init__.py
Empty file.
Empty file removed api/routes/analyze.py
Empty file.
Empty file removed api/routes/gap.py
Empty file.
Empty file removed api/routes/health.py
Empty file.
Empty file removed api/routes/match.py
Empty file.
Empty file removed api/routes/readiness.py
Empty file.
Empty file removed api/routes/roles.py
Empty file.
Empty file removed api/routes/skills.py
Empty file.
2 changes: 1 addition & 1 deletion artifacts/metrics.json
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@
"n_dropped_no_skills": 103,
"n_val": 1915,
"n_test": 1916,
"built_at": "2026-10-03T19:48:24Z",
"built_at": "2026-10-05T14:09:43Z",
"band_cutoffs": {
"prob_ready": 0.6,
"prob_close": 0.3,
Expand Down
12 changes: 6 additions & 6 deletions artifacts/skills_autocomplete.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
{
"id": 2,
"name": "qa",
"display": "Qa",
"display": "QA",
"aliases": [
"software testing",
"automation testing",
Expand All @@ -37,7 +37,7 @@
{
"id": 4,
"name": "javascript",
"display": "Javascript",
"display": "JavaScript",
"aliases": [
"javascript"
]
Expand All @@ -61,7 +61,7 @@
{
"id": 7,
"name": "css",
"display": "Css",
"display": "CSS",
"aliases": [
"css"
]
Expand Down Expand Up @@ -125,15 +125,15 @@
{
"id": 15,
"name": "ml",
"display": "Ml",
"display": "ML",
"aliases": [
"machine learning"
]
},
{
"id": 16,
"name": "html",
"display": "Html",
"display": "HTML",
"aliases": [
"html"
]
Expand All @@ -149,7 +149,7 @@
{
"id": 18,
"name": "cicd",
"display": "Cicd",
"display": "CI/CD",
"aliases": [
"cicd"
]
Expand Down
File renamed without changes.
77 changes: 77 additions & 0 deletions docs/bench.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
[
{
"min_sup_pct": "5.00%",
"min_sup": 0.05,
"support": 0.05,
"itemsets": 13,
"apriori_itemsets": 13,
"fpgrowth_itemsets": 13,
"apriori_time_sec": 0.1459,
"fpgrowth_time_sec": 0.0915,
"apriori_s": 0.1459,
"fpgrowth_s": 0.0915,
"speedup": 1.6,
"identical": "yes",
"max_support_diff": 0.0
},
{
"min_sup_pct": "3.00%",
"min_sup": 0.03,
"support": 0.03,
"itemsets": 34,
"apriori_itemsets": 34,
"fpgrowth_itemsets": 34,
"apriori_time_sec": 0.5189,
"fpgrowth_time_sec": 0.0969,
"apriori_s": 0.5189,
"fpgrowth_s": 0.0969,
"speedup": 5.35,
"identical": "yes",
"max_support_diff": 0.0
},
{
"min_sup_pct": "2.00%",
"min_sup": 0.02,
"support": 0.02,
"itemsets": 62,
"apriori_itemsets": 62,
"fpgrowth_itemsets": 62,
"apriori_time_sec": 1.5869,
"fpgrowth_time_sec": 0.1017,
"apriori_s": 1.5869,
"fpgrowth_s": 0.1017,
"speedup": 15.61,
"identical": "yes",
"max_support_diff": 0.0
},
{
"min_sup_pct": "1.00%",
"min_sup": 0.01,
"support": 0.01,
"itemsets": 168,
"apriori_itemsets": 168,
"fpgrowth_itemsets": 168,
"apriori_time_sec": 8.0566,
"fpgrowth_time_sec": 0.255,
"apriori_s": 8.0566,
"fpgrowth_s": 0.255,
"speedup": 31.6,
"identical": "yes",
"max_support_diff": 0.0
},
{
"min_sup_pct": "0.50%",
"min_sup": 0.005,
"support": 0.005,
"itemsets": 501,
"apriori_itemsets": 501,
"fpgrowth_itemsets": 501,
"apriori_time_sec": 43.6936,
"fpgrowth_time_sec": 0.3454,
"apriori_s": 43.6936,
"fpgrowth_s": 0.3454,
"speedup": 126.49,
"identical": "yes",
"max_support_diff": 0.0
}
]
11 changes: 11 additions & 0 deletions docs/data_audit.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,3 +108,14 @@ Total Rows: 97,929
## Skills
- Rows with empty/null skills: 571
- Distinct raw tokens: 59,479
- Tokens exported (count >= 5): 14,843 covering 91.3% of mentions

## Baskets Audit: 34,569 vs 30,134

The original project plan stated 30,134 baskets, whereas data-v3 produced 34,569 baskets. The difference arose from how tech postings were filtered and cleaned across project stages.

In the initial exploratory plan, a draft filter selected 33,724 postings based on skill tags. After dropping exact duplicates and empty skill lists, 30,134 rows survived. The plan assumed mining baskets would match that preliminary count of 30,134 postings (comprising 13,185 generic software engineer rows, 4,086 unmatched rows, and 12,863 role-labelled rows).

In the pipeline implementation in `etl/clean.py`, the tech filter checked 32 keywords from `etl/tech_terms.txt` across both `title` and `tagsAndSkills` columns of `data/raw/indian-job-market-dataset-2025.xlsx`. This broader check identified 38,271 candidate tech postings. Cleaning dropped 100 exact duplicates, 80 rows with no skills after splitting, and 3,522 reposts, leaving 34,569 rows saved to `data/clean.parquet`.

In `etl/label.py`, the `build_baskets` function created one basket per row of `data/clean.parquet`, saving 34,569 records to `data/baskets.parquet`. In that file, 32,949 baskets contain one or more canonical skill IDs and 1,620 contain empty lists after mapping against `artifacts/skill_vocab.json`.
34 changes: 34 additions & 0 deletions docs/reproducibility.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Reproducibility Audit

The pipeline was verified by running `make reset` followed by `make all`. All rebuilt artifacts were compared against the committed artifacts in `artifacts/`.

## Artifact Comparison

| Metric / Artifact | Committed Value | Rebuilt Value | Match |
|---|---|---|---|
| Vocab size (`skill_vocab.json`) | 800 | 800 | yes |
| Vocab SHA256 (`skill_vocab.json`) | d749eb5d5044fea1e366972fba1bf94351c822dd580ac66a0e711a6f8f92dece | d749eb5d5044fea1e366972fba1bf94351c822dd580ac66a0e711a6f8f92dece | yes |
| Test macro F1 (`metrics.json`) | 0.7424 | 0.7424 | yes |
| Test accuracy (`metrics.json`) | 0.7463 | 0.7463 | yes |
| Test top-3 accuracy (`metrics.json`) | 0.9254 | 0.9254 | yes |
| Rule count (`rules.json` and `rules.parquet`) | 336 | 336 | yes |

## Test Set Class Counts

Test class supports were compared between committed `artifacts/metrics.json` and the rebuilt run.

| Role Family | Committed Test Support | Rebuilt Test Support | Match |
|---|---|---|---|
| Backend | 191 | 191 | yes |
| Data / BI Analyst | 204 | 204 | yes |
| Data Science / ML | 180 | 180 | yes |
| DevOps / Cloud | 340 | 340 | yes |
| ERP / Enterprise | 223 | 223 | yes |
| Frontend | 117 | 117 | yes |
| Full Stack | 194 | 194 | yes |
| Mobile | 65 | 65 | yes |
| QA / Test | 243 | 243 | yes |
| Support / IT Ops | 159 | 159 | yes |
| **Total Test Postings** | **1,916** | **1,916** | **yes** |

Every rebuilt metric and artifact matched the committed baseline exactly.
15 changes: 15 additions & 0 deletions etl/clean.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
import re
import time

import pandas as pd

from etl.stats import write_stage_stats

DROP_REASONS = {}

def drop(df, mask, reason):
Expand All @@ -11,7 +14,9 @@ def drop(df, mask, reason):
return df[~mask]

def main():
t0 = time.time()
df = pd.read_parquet('data/raw.parquet')
rows_in = len(df)

# 1. Filter to tech subset
with open('etl/tech_terms.txt', 'r') as f:
Expand Down Expand Up @@ -117,5 +122,15 @@ def norm_company(name):
print(f"{n:>7,} {reason}")
print(f"{len(df):>7,} rows surviving")

elapsed = time.time() - t0
write_stage_stats(
stage="clean",
rows_in=rows_in,
rows_out=len(df),
drops_by_reason=DROP_REASONS,
elapsed_seconds=elapsed,
output_files=['data/clean.parquet'],
)

if __name__ == '__main__':
main()
21 changes: 21 additions & 0 deletions etl/label.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import json
import re
import time

import pandas as pd

import etl.normalize as norm
from etl.stats import write_stage_stats


def load_families(csv_path):
Expand All @@ -29,6 +31,7 @@ def label_title(title, patterns):
return None

def main():
t0 = time.time()
print("Labeling dataset...")
clean_df = pd.read_parquet('data/clean.parquet')

Expand Down Expand Up @@ -109,5 +112,23 @@ def main():
print(f"\nFinal labelled rows for dataset.parquet: {len(dataset_df)}")
dataset_df.to_parquet('data/dataset.parquet', index=False)

elapsed = time.time() - t0
write_stage_stats(
stage="label",
rows_in=len(clean_df),
rows_out=len(dataset_df),
drops_by_reason={
"unmatched": len(unmatched),
"Software Engineer (generic)": int(dist.get('Software Engineer (generic)', 0)),
},
elapsed_seconds=elapsed,
output_files=[
'data/baskets.parquet',
'data/dataset.parquet',
'artifacts/skill_vocab.json',
'artifacts/skills_autocomplete.json',
],
)

if __name__ == '__main__':
main()
1 change: 1 addition & 0 deletions etl/paths.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@
DATA_DIR = REPO_ROOT / "data"
TAXONOMY_DIR = REPO_ROOT / "taxonomy"
RAW_XLSX = DATA_DIR / "raw" / "indian-job-market-dataset-2025.xlsx"
STATS_DIR = DATA_DIR / "stats"
41 changes: 41 additions & 0 deletions etl/pipeline.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import subprocess
import sys
import time

STAGES = [
("raw", [sys.executable, "-m", "etl.raw"]),
("profile", [sys.executable, "-m", "etl.profile"]),
("clean", [sys.executable, "-m", "etl.clean"]),
("label", [sys.executable, "-m", "etl.label"]),
("train", [sys.executable, "-m", "ml.train"]),
("rules", [sys.executable, "-m", "mining.rules"]),
("export", [sys.executable, "-m", "ml.export_runtime"]),
]


def run_all():
times = {}
total_start = time.time()
for name, cmd in STAGES:
print(f"\n{'='*20} Running stage: {name} {'='*20}")
t0 = time.time()
res = subprocess.run(cmd, check=False)
if res.returncode != 0:
print(f"Error: Stage {name} failed with exit code {res.returncode}", file=sys.stderr)
sys.exit(res.returncode)
elapsed = time.time() - t0
times[name] = elapsed
print(f"=== Stage {name} finished in {elapsed:.2f}s ===")

total_elapsed = time.time() - total_start
print("\n" + "=" * 45)
print("PIPELINE WALL TIME SUMMARY")
print("=" * 45)
for name, elapsed in times.items():
print(f" {name:15s}: {elapsed:6.2f}s")
print(f" {'TOTAL':15s}: {total_elapsed:6.2f}s")
print("=" * 45)


if __name__ == "__main__":
run_all()
Loading
Loading