This document details market basket construction, the Apriori and FP-growth algorithms, mining thresholds, benchmark comparisons, gap scoring logic, and non-tech leakage analysis.
Market baskets were built from cleaned tech postings (data/clean.parquet):
- Total baskets in
data/baskets.parquet: 34,569 baskets. - Non-empty baskets: 32,949 baskets contain at least one canonical skill ID from
artifacts/skill_vocab.json. - Empty baskets: 1,620 baskets contain zero recognized canonical skill IDs after normalization.
- Basket format: Record mapping
posting_idto a deduplicated integer list of canonicalskill_ids.
Both algorithms were implemented to mine frequent itemsets over identical baskets:
- Apriori (
mining/apriori.py): Built from scratch using standard level-wise candidate generation (self-join) and subset pruning. - FP-Growth (
mining/rules.pyandmining/fpgrowth_bench.py): Built usingmlxtend.frequent_patterns.fpgrowthover one-hot sparse basket matrices.
Itemset generation was timed across five minimum support thresholds on 34,569 baskets (docs/bench.json):
| Min Support (%) | Support Value | Itemsets Found | Apriori Time (s) | FP-Growth Time (s) | Speedup | Identical Sets | Max Support Diff |
|---|---|---|---|---|---|---|---|
| 5.00% | 0.050 | 13 | 0.1459 | 0.0915 | 1.60x | Yes | 0.0 |
| 3.00% | 0.030 | 34 | 0.5189 | 0.0969 | 5.35x | Yes | 0.0 |
| 2.00% | 0.020 | 62 | 1.5869 | 0.1017 | 15.61x | Yes | 0.0 |
| 1.00% | 0.010 | 168 | 8.0566 | 0.2550 | 31.60x | Yes | 0.0 |
| 0.50% | 0.005 | 501 | 43.6936 | 0.3454 | 126.49x | Yes | 0.0 |
At the production threshold of 0.50% support, FP-growth ran in 0.3454 seconds compared to 43.6936 seconds for Apriori (126.49x speedup). Both algorithms generated identical 501 itemsets. Hardware environment was not recorded in docs/bench.json.
Rules were derived from frequent itemsets using mlxtend.frequent_patterns.association_rules:
- Minimum Support: 0.005 (0.50%, roughly 173 postings). Lower thresholds caused memory blowup on dense tech combinations, while higher thresholds eliminated specialized tools.
- Minimum Confidence: 0.30 (30%). Required that the consequent appear in at least 30% of baskets containing the antecedent.
- Minimum Lift: 1.20. Discarded independent or negatively correlated skill pairs.
- Total Rules Generated: 231 association rules stored in
artifacts/rules.parquetandartifacts/rules.json.
Skill gaps for a target role are ranked using counterfactual probability gains combined with posting frequencies (mining/gap.py):
Candidate skills are pulled from the target role top 20 skills (artifacts/role_profiles.json) and filtered:
- Exclude skills already present in the user input.
- Exclude non-learnable tokens from
taxonomy/non_learnable.txt(such as soft skills and general management terms). - Exclude redundant terms via
_is_redundant_skill(such as "software development life cycle" if "software" is present).
For each candidate skill s:
Where:
-
$\Delta \text{Readiness}(s) = \max(0, P(\text{role} \mid \mathbf{x} \cup {s}) - P(\text{role} \mid \mathbf{x}))$ evaluates counterfactual readiness gain viaml.predict.delta_readiness. -
$\text{Coverage}(s)$ is the empirical frequency of skillsamong training postings for the target role (role_profiles.json).
For each recommended skill, _find_companions identifies up to 2 other gap skills that co-occur in association rules with lift >= 1.50.
Job posting filters in etl/clean.py matched keywords from etl/tech_terms.txt across job titles and skill tags. Postings such as "Technical Recruiter" or "Mechanical Engineering Drafter" passed the filter because their titles contained "technical" or "engineer".
- Non-Tech Rules Count: 69 of the 231 rules (29.9%) in
artifacts/rules.parquetcontain zero terms frometl/tech_terms.txt. - Top Rules by Lift: Top 10 rules by lift are HR generalist pairings (screening, hr generalist activities, joining formalities) with lift values exceeding 90.0.
- Top 20 Non-Tech Tokens in
data/baskets.parquet:- css: 3,175
- qa: 2,331
- c#: 2,194
- development: 2,133
- project management: 2,078
- sap: 1,893
- agile: 1,603
- rest: 1,603
- automation: 1,595
- continuous integration: 1,533
- troubleshooting: 1,423
- oracle: 1,376
- spring boot: 1,338
- application: 1,304
- microservices: 1,296
- html: 1,266
- ml: 1,167
- web services: 1,056
- networking: 1,018
- analytical: 989
These tokens were retained without retraining to preserve real-world job posting distribution patterns.