Latest commit

History

15 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

🧠 Tech Stack Recommender

Content-Based Recommendation Engine for Technology Stack Selection

TF-IDF · Cosine Similarity · Ranking · Top-N Filtering · Cold-Start Handling

Pythonscikit-learnStreamlitTests

Internship Capstone Project
A practical recommendation system that converts user preferences into ranked technology-stack recommendations using transparent, explainable machine-learning techniques.


✨ Project Overview

Tech Stack Recommender is a content-based recommendation system designed to answer a practical engineering question:

“Given what I want to build and the technologies I am interested in, which technology stack should I choose?”

The system compares a user's stated preferences against a catalog of technology stacks. It represents both sides in a shared TF-IDF feature space, calculates cosine similarity, ranks every candidate, and returns a concise Top-N recommendation list.

The implementation follows the capstone architecture shown in the project specification:

INPUT → PROCESSING → SCORING → SORTING → FILTERING → OUTPUT

It deliberately uses content-based filtering rather than collaborative filtering, because the assignment focuses on matching users directly to item attributes without requiring a historical user-interaction dataset.


🎯 Objectives

The project is built around the following objectives:

  • Capture explicit user preferences.
  • Require a minimum of three meaningful inputs.
  • Translate natural-language preferences into a numerical representation.
  • Represent users and technology stacks in the same feature space.
  • Use TF-IDF instead of simple binary 0/1 matching.
  • Measure relevance using cosine similarity.
  • Score the complete catalog.
  • Sort candidates by relevance.
  • Return a configurable Top-N list to reduce choice overload.
  • Handle the cold-start problem with a practical fallback.
  • Provide both a command-line implementation and a visual demonstration interface.

🏗️ System Architecture

 ┌─────────────────────────┐
│ USER │
│ │
│ Role / Domain │
│ Project Requirements │
│ Skills / Interests │
└────────────┬────────────┘
│
▼
┌─────────────────────────┐
│ INPUT │
│ Validate 3+ inputs │
└────────────┬────────────┘
│
▼
┌─────────────────────────┐
│ PREPROCESSING │
│ │
│ Normalize text │
│ Build user document │
└────────────┬────────────┘
│
┌───────────────────┴───────────────────┐
│ │
▼ ▼
┌──────────────────────┐ ┌──────────────────────┐
│ USER PROFILE │ │ ITEM CATALOG │
│ │ │ │
│ User document │ │ Tech-stack documents │
└──────────┬───────────┘ └──────────┬───────────┘
│ │
└───────────────────┬───────────────────┘
▼
┌─────────────────────────┐
│ TF-IDF │
│ │
│ Shared vocabulary │
│ Weighted feature space │
└────────────┬────────────┘
│
▼
┌─────────────────────────┐
│ COSINE SIMILARITY │
│ │
│ user vector ↔ item │
│ vector │
└────────────┬────────────┘
│
▼
┌─────────────────────────┐
│ SCORING │
│ Score every candidate │
└────────────┬────────────┘
│
▼
┌─────────────────────────┐
│ SORTING │
│ Score DESC │
└────────────┬────────────┘
│
▼
┌─────────────────────────┐
│ FILTERING │
│ Top-N │
└────────────┬────────────┘
│
▼
┌─────────────────────────┐
│ OUTPUT │
│ Ranked recommendations │
└─────────────────────────┘

🔬 Machine Learning Pipeline

1. Input

The application collects at least three user inputs:

InputExample
Target role / domaindata science
Project requirementsanalytics dashboard
Skills / interestsPython SQL cloud
Optional interestsmachine learning

2. Preprocessing

Text is normalized so that different surface forms can be compared consistently. The system removes irrelevant punctuation, normalizes case, and builds a single user-profile document.

Each catalog item is converted into a content document using:

  • Category
  • Frontend
  • Backend
  • Database
  • Deployment target
  • Technology tags
  • Description

3. TF-IDF Vectorization

Instead of treating every word as equally important, the system uses Term Frequency–Inverse Document Frequency.

TF(t,d) = count of term t in document d / total terms in d
IDF(t) = log(Total documents / documents containing t)
TF-IDF = TF × IDF

This gives more weight to descriptive terms and reduces the influence of generic words that appear throughout the catalog.

The same fitted vectorizer transforms both the catalog and user profile, ensuring a shared vocabulary space.

4. Similarity Scoring

The system uses cosine similarity:

 A · B
cosine(A,B) = ─────────────
||A|| ||B||

A score closer to 1.0 means stronger directional alignment between the user profile and the technology-stack content.

Cosine similarity is particularly appropriate here because recommendation quality should depend primarily on the orientation of preferences, rather than the absolute length of the text vectors.

5. Ranking

Every catalog item receives a similarity score. Candidates are then sorted in descending order:

Candidate A → 0.91
Candidate B → 0.84
Candidate C → 0.77
Candidate D → 0.45
Candidate E → 0.32

6. Top-N Filtering

Only the highest-scoring candidates are returned. The default is Top 3, directly reflecting the project's choice-overload objective.

0.91 ──┐
0.84 ──┤ ← Recommended
0.77 ──┘
0.45 ┐
0.32 ┘ ← Filtered out

🧊 Cold-Start Strategy

A recommendation system must still behave sensibly when little or no matching information exists.

User Cold Start

If a new user's terms contain no vocabulary known by the catalog, cosine similarity cannot provide meaningful personalized scores.

The system detects this condition and activates a global popularity fallback:

Unknown user profile
↓
No matching TF-IDF vocabulary
↓
Cold-start detected
↓
Popularity ranking
↓
Top-N recommendations

This implements the assignment's cold-start / popularity-fallback concept without introducing unnecessary collaborative-filtering infrastructure.

Item Cold Start

A new technology stack does not require historical user interactions. Once its metadata is added to the catalog, its content can be represented and compared against user preferences.

This is a key benefit of content-based recommendation.


🧩 Why Content-Based Filtering?

The assignment explicitly focuses on content-based filtering.

Collaborative Filtering

User A ── bought ── Item X
User B ── bought ── Item X
↓
infer similarity

This requires historical user behavior.

Content-Based Filtering

User preferences
↓
Feature representation
↓
Compare against item attributes
↓
Recommend similar items

This project uses the second approach because it directly matches the available information and remains effective for new items.


📁 Project Structure

Techstack-recommender/
│
├── app/
│ ├── __init__.py
│ ├── cli.py # Command-line application
│ ├── config.py # Paths and configuration
│ ├── data_loader.py # Dataset loading/validation
│ ├── preprocessing.py # Text normalization and documents
│ ├── recommender.py # TF-IDF + cosine recommendation engine
│ └── streamlit_app.py # Visual demonstration UI
│
├── data/
│ └── tech_stacks.csv # Technology-stack catalog
│
├── tests/
│ └── test_recommender.py # Core behavior tests
│
├── .env.example # Environment template
├── .gitignore # Git exclusions
├── README.md # Project documentation
├── requirements.txt # Python dependencies
└── run.py # Application entry point

🛠️ Technology Stack

TechnologyPurpose
PythonCore application language
pandasCatalog loading and tabular data handling
scikit-learnTF-IDF vectorization and cosine similarity
StreamlitOptional interactive demonstration UI
pytestAutomated testing
CSVLightweight, transparent catalog storage

Deliberately not used

The assignment does not require an LLM, RAG, vector database, authentication system, relational database, or external API. These technologies were intentionally excluded to keep the solution aligned with the specification and easy to demonstrate.


🚀 Getting Started

Prerequisites

  • Python 3.10+ recommended
  • pip
  • Git

No API key or external service account is required.

Windows PowerShell

python -m venv .venv
.\.venv\Scripts\Activate.ps1
python -m pip install --upgrade pip
pip install -r requirements.txt

macOS / Linux

python3 -m venv .venv
source .venv/bin/activate
python -m pip install --upgrade pip
pip install -r requirements.txt

▶️ Run the Application

CLI — Core Assignment Demonstration

python run.py

Example interaction:

=== CAPSTONE: TECH STACK RECOMMENDER ===
Content-based filtering | TF-IDF + cosine similarity
1) Target role/domain: data science
2) Project needs: analytics dashboard
3) Skills/interests: Python SQL cloud
4) Optional extra interests: machine learning

The system then returns the highest-scoring technology stacks.

Streamlit — Visual Demonstration

streamlit run app/streamlit_app.py

The Streamlit application is a presentation layer over the same recommendation engine. It does not contain a separate or simplified recommendation algorithm.


🧪 Testing

Run the automated test suite:

pytest -q

The suite covers the project's critical paths:

  • Minimum input validation
  • Content-based ranking
  • Cosine-score validity
  • Top-N filtering
  • Cold-start fallback

Expected result:

4 passed

📊 Example Recommendation Flow

For a user interested in:

Role: Data Science
Needs: Analytics Dashboard
Interests: Python, SQL, Cloud

the system might produce a result conceptually similar to:

RankRecommendationMatch
🥇 1Python Data Science StackHigh
🥈 2SQL Reporting StackHigh
🥉 3Data Engineering StackModerate

The exact scores are calculated dynamically from the TF-IDF representation of the catalog and user profile.


📚 Dataset

The included data/tech_stacks.csv catalog contains technology-stack candidates with attributes such as:

  • Frontend
  • Backend
  • Database
  • Deployment
  • Category
  • Tags
  • Description
  • Popularity

The catalog is intentionally human-readable so that the recommendation logic remains transparent and easy to explain during an internship presentation or supervisor review.

To add a new stack, add a row containing the required fields and restart the application.


🧱 Design Principles

Correctness first

The implementation follows the mathematical approach specified by the project rather than replacing it with a more complicated model.

Explainability

A recommendation can be traced through:

User input
↓
Normalized terms
↓
TF-IDF representation
↓
Cosine similarity
↓
Score
↓
Rank
↓
Top-N output

Simplicity

The system uses a local CSV catalog instead of adding a database solely for architectural appearance.

Extensibility

The core TechStackRecommender class is independent of the CLI and Streamlit interface, making it straightforward to integrate into another application later.


🔐 Security & Configuration

There are currently no secrets or API credentials in the project.

The repository includes .env.example as a safe configuration placeholder. The .gitignore also excludes .env and common local Python artifacts.


📋 Requirement Traceability

Assignment RequirementImplementationStatus
Tech Stack Recommenderapp/recommender.py
Input → Processing → OutputCLI + recommender pipeline
Minimum 3 user inputsapp/cli.py
Content-Based FilteringTechStackRecommender
Shared feature vocabularySingle fitted TF-IDF vectorizer
Vector mappingpreprocessing.py
TF-IDF weightingTfidfVectorizer
Avoid binary overlapWeighted TF-IDF features
Cosine similaritycosine_similarity()
Score available itemsrecommend()
Sort by relevanceDescending score sort
Top-N filtering.head(top_n)
Choice overload reductionTop-3 default
User cold startPopularity fallback
Item cold startMetadata-based scoring
Demonstration UIStreamlit
Automated teststests/test_recommender.py

📦 Deliverables

Core submission

  • ✅ Complete source code
  • ✅ Recommendation engine
  • ✅ Technology-stack dataset
  • ✅ Requirements file
  • ✅ README documentation
  • ✅ Automated tests
  • ✅ Working CLI demonstration

Recommended presentation material

  • Architecture diagram
  • Screenshot of the Streamlit interface
  • Screenshot of sample recommendations
  • Short explanation of TF-IDF
  • Short explanation of cosine similarity
  • Cold-start demonstration
  • Test output showing passing tests

🎓 Capstone Context

This repository implements the Tech Stack Recommender capstone following the supplied internship project specification and its progression from:

Passive Classification → Active Prediction

The final system converts structured and unstructured preference signals into an actionable ranked recommendation list while remaining transparent, deterministic, and easy to demonstrate.


👨‍💻 Author

Hadeed Jalani
AI / ML Internship Project — Tech Stack Recommender


⭐ If this project helped you, consider starring the repository.

Built with Python · TF-IDF · Cosine Similarity · Content-Based Recommendation

About

Content-based Tech Stack Recommendation Engine using TF-IDF and Cosine Similarity to rank personalized technology stacks from user preferences, with Top-N filtering and cold-start handling.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Add copy buttons to all
 blocks\n(function() {\n function addCopyButtons() {\n document.querySelectorAll('pre code').forEach(function(codeBlock) {\n if (codeBlock.parentElement.hasAttribute('data-copy-added')) return;\n codeBlock.parentElement.setAttribute('data-copy-added', 'true');\n \n var btn = document.createElement('button');\n btn.textContent = 'Copy';\n btn.style.cssText = 'position:absolute;top:4px;right:4px;padding:2px 8px;font-size:11px;background:#4ecdc4;border:none;border-radius:4px;color:#1a1a2e;cursor:pointer;opacity:0.7;transition:opacity 0.2s;';\n btn.onmouseover = function() { this.style.opacity = '1'; };\n btn.onmouseout = function() { this.style.opacity = '0.7'; };\n btn.onclick = function() {\n navigator.clipboard.writeText(codeBlock.textContent).then(function() {\n btn.textContent = 'Copied!';\n setTimeout(function() { btn.textContent = 'Copy'; }, 1500);\n });\n };\n codeBlock.parentElement.style.position = 'relative';\n codeBlock.parentElement.appendChild(btn);\n });\n }\n \n addCopyButtons();\n \n // Re-run on dynamic content\n var observer = new MutationObserver(addCopyButtons);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Add Copy Buttons to Code Blocks");
}
} catch(__e) { console.warn('[Userscript:Add Copy Buttons to Code Blocks]', __e); }
})();
(function(){
try {
var __m = "github.com";
var __re = new RegExp('^' + "github\\.com" + '
Skip to content

Latest commit

History

15 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

🧠 Tech Stack Recommender

Content-Based Recommendation Engine for Technology Stack Selection

TF-IDF · Cosine Similarity · Ranking · Top-N Filtering · Cold-Start Handling

Pythonscikit-learnStreamlitTests

Internship Capstone Project
A practical recommendation system that converts user preferences into ranked technology-stack recommendations using transparent, explainable machine-learning techniques.


✨ Project Overview

Tech Stack Recommender is a content-based recommendation system designed to answer a practical engineering question:

“Given what I want to build and the technologies I am interested in, which technology stack should I choose?”

The system compares a user's stated preferences against a catalog of technology stacks. It represents both sides in a shared TF-IDF feature space, calculates cosine similarity, ranks every candidate, and returns a concise Top-N recommendation list.

The implementation follows the capstone architecture shown in the project specification:

INPUT → PROCESSING → SCORING → SORTING → FILTERING → OUTPUT

It deliberately uses content-based filtering rather than collaborative filtering, because the assignment focuses on matching users directly to item attributes without requiring a historical user-interaction dataset.


🎯 Objectives

The project is built around the following objectives:

  • Capture explicit user preferences.
  • Require a minimum of three meaningful inputs.
  • Translate natural-language preferences into a numerical representation.
  • Represent users and technology stacks in the same feature space.
  • Use TF-IDF instead of simple binary 0/1 matching.
  • Measure relevance using cosine similarity.
  • Score the complete catalog.
  • Sort candidates by relevance.
  • Return a configurable Top-N list to reduce choice overload.
  • Handle the cold-start problem with a practical fallback.
  • Provide both a command-line implementation and a visual demonstration interface.

🏗️ System Architecture

 ┌─────────────────────────┐
│ USER │
│ │
│ Role / Domain │
│ Project Requirements │
│ Skills / Interests │
└────────────┬────────────┘
│
▼
┌─────────────────────────┐
│ INPUT │
│ Validate 3+ inputs │
└────────────┬────────────┘
│
▼
┌─────────────────────────┐
│ PREPROCESSING │
│ │
│ Normalize text │
│ Build user document │
└────────────┬────────────┘
│
┌───────────────────┴───────────────────┐
│ │
▼ ▼
┌──────────────────────┐ ┌──────────────────────┐
│ USER PROFILE │ │ ITEM CATALOG │
│ │ │ │
│ User document │ │ Tech-stack documents │
└──────────┬───────────┘ └──────────┬───────────┘
│ │
└───────────────────┬───────────────────┘
▼
┌─────────────────────────┐
│ TF-IDF │
│ │
│ Shared vocabulary │
│ Weighted feature space │
└────────────┬────────────┘
│
▼
┌─────────────────────────┐
│ COSINE SIMILARITY │
│ │
│ user vector ↔ item │
│ vector │
└────────────┬────────────┘
│
▼
┌─────────────────────────┐
│ SCORING │
│ Score every candidate │
└────────────┬────────────┘
│
▼
┌─────────────────────────┐
│ SORTING │
│ Score DESC │
└────────────┬────────────┘
│
▼
┌─────────────────────────┐
│ FILTERING │
│ Top-N │
└────────────┬────────────┘
│
▼
┌─────────────────────────┐
│ OUTPUT │
│ Ranked recommendations │
└─────────────────────────┘

🔬 Machine Learning Pipeline

1. Input

The application collects at least three user inputs:

InputExample
Target role / domaindata science
Project requirementsanalytics dashboard
Skills / interestsPython SQL cloud
Optional interestsmachine learning

2. Preprocessing

Text is normalized so that different surface forms can be compared consistently. The system removes irrelevant punctuation, normalizes case, and builds a single user-profile document.

Each catalog item is converted into a content document using:

  • Category
  • Frontend
  • Backend
  • Database
  • Deployment target
  • Technology tags
  • Description

3. TF-IDF Vectorization

Instead of treating every word as equally important, the system uses Term Frequency–Inverse Document Frequency.

TF(t,d) = count of term t in document d / total terms in d
IDF(t) = log(Total documents / documents containing t)
TF-IDF = TF × IDF

This gives more weight to descriptive terms and reduces the influence of generic words that appear throughout the catalog.

The same fitted vectorizer transforms both the catalog and user profile, ensuring a shared vocabulary space.

4. Similarity Scoring

The system uses cosine similarity:

 A · B
cosine(A,B) = ─────────────
||A|| ||B||

A score closer to 1.0 means stronger directional alignment between the user profile and the technology-stack content.

Cosine similarity is particularly appropriate here because recommendation quality should depend primarily on the orientation of preferences, rather than the absolute length of the text vectors.

5. Ranking

Every catalog item receives a similarity score. Candidates are then sorted in descending order:

Candidate A → 0.91
Candidate B → 0.84
Candidate C → 0.77
Candidate D → 0.45
Candidate E → 0.32

6. Top-N Filtering

Only the highest-scoring candidates are returned. The default is Top 3, directly reflecting the project's choice-overload objective.

0.91 ──┐
0.84 ──┤ ← Recommended
0.77 ──┘
0.45 ┐
0.32 ┘ ← Filtered out

🧊 Cold-Start Strategy

A recommendation system must still behave sensibly when little or no matching information exists.

User Cold Start

If a new user's terms contain no vocabulary known by the catalog, cosine similarity cannot provide meaningful personalized scores.

The system detects this condition and activates a global popularity fallback:

Unknown user profile
↓
No matching TF-IDF vocabulary
↓
Cold-start detected
↓
Popularity ranking
↓
Top-N recommendations

This implements the assignment's cold-start / popularity-fallback concept without introducing unnecessary collaborative-filtering infrastructure.

Item Cold Start

A new technology stack does not require historical user interactions. Once its metadata is added to the catalog, its content can be represented and compared against user preferences.

This is a key benefit of content-based recommendation.


🧩 Why Content-Based Filtering?

The assignment explicitly focuses on content-based filtering.

Collaborative Filtering

User A ── bought ── Item X
User B ── bought ── Item X
↓
infer similarity

This requires historical user behavior.

Content-Based Filtering

User preferences
↓
Feature representation
↓
Compare against item attributes
↓
Recommend similar items

This project uses the second approach because it directly matches the available information and remains effective for new items.


📁 Project Structure

Techstack-recommender/
│
├── app/
│ ├── __init__.py
│ ├── cli.py # Command-line application
│ ├── config.py # Paths and configuration
│ ├── data_loader.py # Dataset loading/validation
│ ├── preprocessing.py # Text normalization and documents
│ ├── recommender.py # TF-IDF + cosine recommendation engine
│ └── streamlit_app.py # Visual demonstration UI
│
├── data/
│ └── tech_stacks.csv # Technology-stack catalog
│
├── tests/
│ └── test_recommender.py # Core behavior tests
│
├── .env.example # Environment template
├── .gitignore # Git exclusions
├── README.md # Project documentation
├── requirements.txt # Python dependencies
└── run.py # Application entry point

🛠️ Technology Stack

TechnologyPurpose
PythonCore application language
pandasCatalog loading and tabular data handling
scikit-learnTF-IDF vectorization and cosine similarity
StreamlitOptional interactive demonstration UI
pytestAutomated testing
CSVLightweight, transparent catalog storage

Deliberately not used

The assignment does not require an LLM, RAG, vector database, authentication system, relational database, or external API. These technologies were intentionally excluded to keep the solution aligned with the specification and easy to demonstrate.


🚀 Getting Started

Prerequisites

  • Python 3.10+ recommended
  • pip
  • Git

No API key or external service account is required.

Windows PowerShell

python -m venv .venv
.\.venv\Scripts\Activate.ps1
python -m pip install --upgrade pip
pip install -r requirements.txt

macOS / Linux

python3 -m venv .venv
source .venv/bin/activate
python -m pip install --upgrade pip
pip install -r requirements.txt

▶️ Run the Application

CLI — Core Assignment Demonstration

python run.py

Example interaction:

=== CAPSTONE: TECH STACK RECOMMENDER ===
Content-based filtering | TF-IDF + cosine similarity
1) Target role/domain: data science
2) Project needs: analytics dashboard
3) Skills/interests: Python SQL cloud
4) Optional extra interests: machine learning

The system then returns the highest-scoring technology stacks.

Streamlit — Visual Demonstration

streamlit run app/streamlit_app.py

The Streamlit application is a presentation layer over the same recommendation engine. It does not contain a separate or simplified recommendation algorithm.


🧪 Testing

Run the automated test suite:

pytest -q

The suite covers the project's critical paths:

  • Minimum input validation
  • Content-based ranking
  • Cosine-score validity
  • Top-N filtering
  • Cold-start fallback

Expected result:

4 passed

📊 Example Recommendation Flow

For a user interested in:

Role: Data Science
Needs: Analytics Dashboard
Interests: Python, SQL, Cloud

the system might produce a result conceptually similar to:

RankRecommendationMatch
🥇 1Python Data Science StackHigh
🥈 2SQL Reporting StackHigh
🥉 3Data Engineering StackModerate

The exact scores are calculated dynamically from the TF-IDF representation of the catalog and user profile.


📚 Dataset

The included data/tech_stacks.csv catalog contains technology-stack candidates with attributes such as:

  • Frontend
  • Backend
  • Database
  • Deployment
  • Category
  • Tags
  • Description
  • Popularity

The catalog is intentionally human-readable so that the recommendation logic remains transparent and easy to explain during an internship presentation or supervisor review.

To add a new stack, add a row containing the required fields and restart the application.


🧱 Design Principles

Correctness first

The implementation follows the mathematical approach specified by the project rather than replacing it with a more complicated model.

Explainability

A recommendation can be traced through:

User input
↓
Normalized terms
↓
TF-IDF representation
↓
Cosine similarity
↓
Score
↓
Rank
↓
Top-N output

Simplicity

The system uses a local CSV catalog instead of adding a database solely for architectural appearance.

Extensibility

The core TechStackRecommender class is independent of the CLI and Streamlit interface, making it straightforward to integrate into another application later.


🔐 Security & Configuration

There are currently no secrets or API credentials in the project.

The repository includes .env.example as a safe configuration placeholder. The .gitignore also excludes .env and common local Python artifacts.


📋 Requirement Traceability

Assignment RequirementImplementationStatus
Tech Stack Recommenderapp/recommender.py
Input → Processing → OutputCLI + recommender pipeline
Minimum 3 user inputsapp/cli.py
Content-Based FilteringTechStackRecommender
Shared feature vocabularySingle fitted TF-IDF vectorizer
Vector mappingpreprocessing.py
TF-IDF weightingTfidfVectorizer
Avoid binary overlapWeighted TF-IDF features
Cosine similaritycosine_similarity()
Score available itemsrecommend()
Sort by relevanceDescending score sort
Top-N filtering.head(top_n)
Choice overload reductionTop-3 default
User cold startPopularity fallback
Item cold startMetadata-based scoring
Demonstration UIStreamlit
Automated teststests/test_recommender.py

📦 Deliverables

Core submission

  • ✅ Complete source code
  • ✅ Recommendation engine
  • ✅ Technology-stack dataset
  • ✅ Requirements file
  • ✅ README documentation
  • ✅ Automated tests
  • ✅ Working CLI demonstration

Recommended presentation material

  • Architecture diagram
  • Screenshot of the Streamlit interface
  • Screenshot of sample recommendations
  • Short explanation of TF-IDF
  • Short explanation of cosine similarity
  • Cold-start demonstration
  • Test output showing passing tests

🎓 Capstone Context

This repository implements the Tech Stack Recommender capstone following the supplied internship project specification and its progression from:

Passive Classification → Active Prediction

The final system converts structured and unstructured preference signals into an actionable ranked recommendation list while remaining transparent, deterministic, and easy to demonstrate.


👨‍💻 Author

Hadeed Jalani
AI / ML Internship Project — Tech Stack Recommender


⭐ If this project helped you, consider starring the repository.

Built with Python · TF-IDF · Cosine Similarity · Content-Based Recommendation

About

Content-based Tech Stack Recommendation Engine using TF-IDF and Cosine Similarity to rank personalized technology stacks from user preferences, with Top-N filtering and cold-start handling.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Force GitHub README to respect dark mode\n(function() {\n var style = document.createElement('style');\n style.textContent = '\n .markdown-body {\n color-scheme: dark light;\n }\n .markdown-body pre { background: #161b22 !important; }\n .markdown-body code { background: rgba(110, 118, 129, 0.4) !important; }\n .markdown-body table th, .markdown-body table td { border-color: #30363d !important; }\n .markdown-body img { background: #0d1117; }\n .markdown-body blockquote { border-left-color: #8b949e; }\n .markdown-body hr { border-color: #30363d; }\n ';\n document.head.appendChild(style);\n})();", "GitHub Dark Mode README Fix"); } } catch(__e) { console.warn('[Userscript:GitHub Dark Mode README Fix]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

Latest commit

History

15 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

🧠 Tech Stack Recommender

Content-Based Recommendation Engine for Technology Stack Selection

TF-IDF · Cosine Similarity · Ranking · Top-N Filtering · Cold-Start Handling

Pythonscikit-learnStreamlitTests

Internship Capstone Project
A practical recommendation system that converts user preferences into ranked technology-stack recommendations using transparent, explainable machine-learning techniques.


✨ Project Overview

Tech Stack Recommender is a content-based recommendation system designed to answer a practical engineering question:

“Given what I want to build and the technologies I am interested in, which technology stack should I choose?”

The system compares a user's stated preferences against a catalog of technology stacks. It represents both sides in a shared TF-IDF feature space, calculates cosine similarity, ranks every candidate, and returns a concise Top-N recommendation list.

The implementation follows the capstone architecture shown in the project specification:

INPUT → PROCESSING → SCORING → SORTING → FILTERING → OUTPUT

It deliberately uses content-based filtering rather than collaborative filtering, because the assignment focuses on matching users directly to item attributes without requiring a historical user-interaction dataset.


🎯 Objectives

The project is built around the following objectives:

  • Capture explicit user preferences.
  • Require a minimum of three meaningful inputs.
  • Translate natural-language preferences into a numerical representation.
  • Represent users and technology stacks in the same feature space.
  • Use TF-IDF instead of simple binary 0/1 matching.
  • Measure relevance using cosine similarity.
  • Score the complete catalog.
  • Sort candidates by relevance.
  • Return a configurable Top-N list to reduce choice overload.
  • Handle the cold-start problem with a practical fallback.
  • Provide both a command-line implementation and a visual demonstration interface.

🏗️ System Architecture

 ┌─────────────────────────┐
│ USER │
│ │
│ Role / Domain │
│ Project Requirements │
│ Skills / Interests │
└────────────┬────────────┘
│
▼
┌─────────────────────────┐
│ INPUT │
│ Validate 3+ inputs │
└────────────┬────────────┘
│
▼
┌─────────────────────────┐
│ PREPROCESSING │
│ │
│ Normalize text │
│ Build user document │
└────────────┬────────────┘
│
┌───────────────────┴───────────────────┐
│ │
▼ ▼
┌──────────────────────┐ ┌──────────────────────┐
│ USER PROFILE │ │ ITEM CATALOG │
│ │ │ │
│ User document │ │ Tech-stack documents │
└──────────┬───────────┘ └──────────┬───────────┘
│ │
└───────────────────┬───────────────────┘
▼
┌─────────────────────────┐
│ TF-IDF │
│ │
│ Shared vocabulary │
│ Weighted feature space │
└────────────┬────────────┘
│
▼
┌─────────────────────────┐
│ COSINE SIMILARITY │
│ │
│ user vector ↔ item │
│ vector │
└────────────┬────────────┘
│
▼
┌─────────────────────────┐
│ SCORING │
│ Score every candidate │
└────────────┬────────────┘
│
▼
┌─────────────────────────┐
│ SORTING │
│ Score DESC │
└────────────┬────────────┘
│
▼
┌─────────────────────────┐
│ FILTERING │
│ Top-N │
└────────────┬────────────┘
│
▼
┌─────────────────────────┐
│ OUTPUT │
│ Ranked recommendations │
└─────────────────────────┘

🔬 Machine Learning Pipeline

1. Input

The application collects at least three user inputs:

InputExample
Target role / domaindata science
Project requirementsanalytics dashboard
Skills / interestsPython SQL cloud
Optional interestsmachine learning

2. Preprocessing

Text is normalized so that different surface forms can be compared consistently. The system removes irrelevant punctuation, normalizes case, and builds a single user-profile document.

Each catalog item is converted into a content document using:

  • Category
  • Frontend
  • Backend
  • Database
  • Deployment target
  • Technology tags
  • Description

3. TF-IDF Vectorization

Instead of treating every word as equally important, the system uses Term Frequency–Inverse Document Frequency.

TF(t,d) = count of term t in document d / total terms in d
IDF(t) = log(Total documents / documents containing t)
TF-IDF = TF × IDF

This gives more weight to descriptive terms and reduces the influence of generic words that appear throughout the catalog.

The same fitted vectorizer transforms both the catalog and user profile, ensuring a shared vocabulary space.

4. Similarity Scoring

The system uses cosine similarity:

 A · B
cosine(A,B) = ─────────────
||A|| ||B||

A score closer to 1.0 means stronger directional alignment between the user profile and the technology-stack content.

Cosine similarity is particularly appropriate here because recommendation quality should depend primarily on the orientation of preferences, rather than the absolute length of the text vectors.

5. Ranking

Every catalog item receives a similarity score. Candidates are then sorted in descending order:

Candidate A → 0.91
Candidate B → 0.84
Candidate C → 0.77
Candidate D → 0.45
Candidate E → 0.32

6. Top-N Filtering

Only the highest-scoring candidates are returned. The default is Top 3, directly reflecting the project's choice-overload objective.

0.91 ──┐
0.84 ──┤ ← Recommended
0.77 ──┘
0.45 ┐
0.32 ┘ ← Filtered out

🧊 Cold-Start Strategy

A recommendation system must still behave sensibly when little or no matching information exists.

User Cold Start

If a new user's terms contain no vocabulary known by the catalog, cosine similarity cannot provide meaningful personalized scores.

The system detects this condition and activates a global popularity fallback:

Unknown user profile
↓
No matching TF-IDF vocabulary
↓
Cold-start detected
↓
Popularity ranking
↓
Top-N recommendations

This implements the assignment's cold-start / popularity-fallback concept without introducing unnecessary collaborative-filtering infrastructure.

Item Cold Start

A new technology stack does not require historical user interactions. Once its metadata is added to the catalog, its content can be represented and compared against user preferences.

This is a key benefit of content-based recommendation.


🧩 Why Content-Based Filtering?

The assignment explicitly focuses on content-based filtering.

Collaborative Filtering

User A ── bought ── Item X
User B ── bought ── Item X
↓
infer similarity

This requires historical user behavior.

Content-Based Filtering

User preferences
↓
Feature representation
↓
Compare against item attributes
↓
Recommend similar items

This project uses the second approach because it directly matches the available information and remains effective for new items.


📁 Project Structure

Techstack-recommender/
│
├── app/
│ ├── __init__.py
│ ├── cli.py # Command-line application
│ ├── config.py # Paths and configuration
│ ├── data_loader.py # Dataset loading/validation
│ ├── preprocessing.py # Text normalization and documents
│ ├── recommender.py # TF-IDF + cosine recommendation engine
│ └── streamlit_app.py # Visual demonstration UI
│
├── data/
│ └── tech_stacks.csv # Technology-stack catalog
│
├── tests/
│ └── test_recommender.py # Core behavior tests
│
├── .env.example # Environment template
├── .gitignore # Git exclusions
├── README.md # Project documentation
├── requirements.txt # Python dependencies
└── run.py # Application entry point

🛠️ Technology Stack

TechnologyPurpose
PythonCore application language
pandasCatalog loading and tabular data handling
scikit-learnTF-IDF vectorization and cosine similarity
StreamlitOptional interactive demonstration UI
pytestAutomated testing
CSVLightweight, transparent catalog storage

Deliberately not used

The assignment does not require an LLM, RAG, vector database, authentication system, relational database, or external API. These technologies were intentionally excluded to keep the solution aligned with the specification and easy to demonstrate.


🚀 Getting Started

Prerequisites

  • Python 3.10+ recommended
  • pip
  • Git

No API key or external service account is required.

Windows PowerShell

python -m venv .venv
.\.venv\Scripts\Activate.ps1
python -m pip install --upgrade pip
pip install -r requirements.txt

macOS / Linux

python3 -m venv .venv
source .venv/bin/activate
python -m pip install --upgrade pip
pip install -r requirements.txt

▶️ Run the Application

CLI — Core Assignment Demonstration

python run.py

Example interaction:

=== CAPSTONE: TECH STACK RECOMMENDER ===
Content-based filtering | TF-IDF + cosine similarity
1) Target role/domain: data science
2) Project needs: analytics dashboard
3) Skills/interests: Python SQL cloud
4) Optional extra interests: machine learning

The system then returns the highest-scoring technology stacks.

Streamlit — Visual Demonstration

streamlit run app/streamlit_app.py

The Streamlit application is a presentation layer over the same recommendation engine. It does not contain a separate or simplified recommendation algorithm.


🧪 Testing

Run the automated test suite:

pytest -q

The suite covers the project's critical paths:

  • Minimum input validation
  • Content-based ranking
  • Cosine-score validity
  • Top-N filtering
  • Cold-start fallback

Expected result:

4 passed

📊 Example Recommendation Flow

For a user interested in:

Role: Data Science
Needs: Analytics Dashboard
Interests: Python, SQL, Cloud

the system might produce a result conceptually similar to:

RankRecommendationMatch
🥇 1Python Data Science StackHigh
🥈 2SQL Reporting StackHigh
🥉 3Data Engineering StackModerate

The exact scores are calculated dynamically from the TF-IDF representation of the catalog and user profile.


📚 Dataset

The included data/tech_stacks.csv catalog contains technology-stack candidates with attributes such as:

  • Frontend
  • Backend
  • Database
  • Deployment
  • Category
  • Tags
  • Description
  • Popularity

The catalog is intentionally human-readable so that the recommendation logic remains transparent and easy to explain during an internship presentation or supervisor review.

To add a new stack, add a row containing the required fields and restart the application.


🧱 Design Principles

Correctness first

The implementation follows the mathematical approach specified by the project rather than replacing it with a more complicated model.

Explainability

A recommendation can be traced through:

User input
↓
Normalized terms
↓
TF-IDF representation
↓
Cosine similarity
↓
Score
↓
Rank
↓
Top-N output

Simplicity

The system uses a local CSV catalog instead of adding a database solely for architectural appearance.

Extensibility

The core TechStackRecommender class is independent of the CLI and Streamlit interface, making it straightforward to integrate into another application later.


🔐 Security & Configuration

There are currently no secrets or API credentials in the project.

The repository includes .env.example as a safe configuration placeholder. The .gitignore also excludes .env and common local Python artifacts.


📋 Requirement Traceability

Assignment RequirementImplementationStatus
Tech Stack Recommenderapp/recommender.py
Input → Processing → OutputCLI + recommender pipeline
Minimum 3 user inputsapp/cli.py
Content-Based FilteringTechStackRecommender
Shared feature vocabularySingle fitted TF-IDF vectorizer
Vector mappingpreprocessing.py
TF-IDF weightingTfidfVectorizer
Avoid binary overlapWeighted TF-IDF features
Cosine similaritycosine_similarity()
Score available itemsrecommend()
Sort by relevanceDescending score sort
Top-N filtering.head(top_n)
Choice overload reductionTop-3 default
User cold startPopularity fallback
Item cold startMetadata-based scoring
Demonstration UIStreamlit
Automated teststests/test_recommender.py

📦 Deliverables

Core submission

  • ✅ Complete source code
  • ✅ Recommendation engine
  • ✅ Technology-stack dataset
  • ✅ Requirements file
  • ✅ README documentation
  • ✅ Automated tests
  • ✅ Working CLI demonstration

Recommended presentation material

  • Architecture diagram
  • Screenshot of the Streamlit interface
  • Screenshot of sample recommendations
  • Short explanation of TF-IDF
  • Short explanation of cosine similarity
  • Cold-start demonstration
  • Test output showing passing tests

🎓 Capstone Context

This repository implements the Tech Stack Recommender capstone following the supplied internship project specification and its progression from:

Passive Classification → Active Prediction

The final system converts structured and unstructured preference signals into an actionable ranked recommendation list while remaining transparent, deterministic, and easy to demonstrate.


👨‍💻 Author

Hadeed Jalani
AI / ML Internship Project — Tech Stack Recommender


⭐ If this project helped you, consider starring the repository.

Built with Python · TF-IDF · Cosine Similarity · Content-Based Recommendation

About

Content-based Tech Stack Recommendation Engine using TF-IDF and Cosine Similarity to rank personalized technology stacks from user preferences, with Top-N filtering and cold-start handling.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Highlight search terms from Google/DuckDuckGo/Bing referrer\n(function() {\n var ref = document.referrer;\n var terms = [];\n \n if (ref.includes('google.com') || ref.includes('duckduckgo.com') || ref.includes('bing.com')) {\n var url = new URL(ref);\n var q = url.searchParams.get('q') || url.searchParams.get('p');\n if (q) {\n terms = q.split(/\\s+/).filter(function(t) { return t.length > 2; });\n }\n }\n \n if (terms.length === 0) return;\n \n var style = document.createElement('style');\n style.textContent = '.userscript-highlight { background: #fbbf24; color: #1a1a2e; padding: 1px 3px; border-radius: 2px; }';\n document.head.appendChild(style);\n \n function highlight(node) {\n if (node.nodeType === 3) { // text node\n var text = node.textContent;\n var found = false;\n terms.forEach(function(term) {\n var regex = new RegExp('(' + term.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\') + ')', 'gi');\n if (regex.test(text)) {\n found = true;\n var frag = document.createDocumentFragment();\n var parts = text.split(regex);\n parts.forEach(function(part, i) {\n if (i % 2 === 0) {\n frag.appendChild(document.createTextNode(part));\n } else {\n var span = document.createElement('span');\n span.className = 'userscript-highlight';\n span.textContent = part;\n frag.appendChild(span);\n }\n });\n node.parentNode.replaceChild(frag, node);\n }\n });\n } else if (node.nodeType === 1 && node.childNodes) { // element\n var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT'];\n if (!skipTags.includes(node.tagName)) {\n Array.from(node.childNodes).forEach(highlight);\n }\n }\n }\n \n highlight(document.body);\n \n // Re-highlight on dynamic content\n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1 || node.nodeType === 3) highlight(node);\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Highlight Search Terms"); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

Latest commit

History

15 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

🧠 Tech Stack Recommender

Content-Based Recommendation Engine for Technology Stack Selection

TF-IDF · Cosine Similarity · Ranking · Top-N Filtering · Cold-Start Handling

Pythonscikit-learnStreamlitTests

Internship Capstone Project
A practical recommendation system that converts user preferences into ranked technology-stack recommendations using transparent, explainable machine-learning techniques.


✨ Project Overview

Tech Stack Recommender is a content-based recommendation system designed to answer a practical engineering question:

“Given what I want to build and the technologies I am interested in, which technology stack should I choose?”

The system compares a user's stated preferences against a catalog of technology stacks. It represents both sides in a shared TF-IDF feature space, calculates cosine similarity, ranks every candidate, and returns a concise Top-N recommendation list.

The implementation follows the capstone architecture shown in the project specification:

INPUT → PROCESSING → SCORING → SORTING → FILTERING → OUTPUT

It deliberately uses content-based filtering rather than collaborative filtering, because the assignment focuses on matching users directly to item attributes without requiring a historical user-interaction dataset.


🎯 Objectives

The project is built around the following objectives:

  • Capture explicit user preferences.
  • Require a minimum of three meaningful inputs.
  • Translate natural-language preferences into a numerical representation.
  • Represent users and technology stacks in the same feature space.
  • Use TF-IDF instead of simple binary 0/1 matching.
  • Measure relevance using cosine similarity.
  • Score the complete catalog.
  • Sort candidates by relevance.
  • Return a configurable Top-N list to reduce choice overload.
  • Handle the cold-start problem with a practical fallback.
  • Provide both a command-line implementation and a visual demonstration interface.

🏗️ System Architecture

 ┌─────────────────────────┐
│ USER │
│ │
│ Role / Domain │
│ Project Requirements │
│ Skills / Interests │
└────────────┬────────────┘
│
▼
┌─────────────────────────┐
│ INPUT │
│ Validate 3+ inputs │
└────────────┬────────────┘
│
▼
┌─────────────────────────┐
│ PREPROCESSING │
│ │
│ Normalize text │
│ Build user document │
└────────────┬────────────┘
│
┌───────────────────┴───────────────────┐
│ │
▼ ▼
┌──────────────────────┐ ┌──────────────────────┐
│ USER PROFILE │ │ ITEM CATALOG │
│ │ │ │
│ User document │ │ Tech-stack documents │
└──────────┬───────────┘ └──────────┬───────────┘
│ │
└───────────────────┬───────────────────┘
▼
┌─────────────────────────┐
│ TF-IDF │
│ │
│ Shared vocabulary │
│ Weighted feature space │
└────────────┬────────────┘
│
▼
┌─────────────────────────┐
│ COSINE SIMILARITY │
│ │
│ user vector ↔ item │
│ vector │
└────────────┬────────────┘
│
▼
┌─────────────────────────┐
│ SCORING │
│ Score every candidate │
└────────────┬────────────┘
│
▼
┌─────────────────────────┐
│ SORTING │
│ Score DESC │
└────────────┬────────────┘
│
▼
┌─────────────────────────┐
│ FILTERING │
│ Top-N │
└────────────┬────────────┘
│
▼
┌─────────────────────────┐
│ OUTPUT │
│ Ranked recommendations │
└─────────────────────────┘

🔬 Machine Learning Pipeline

1. Input

The application collects at least three user inputs:

InputExample
Target role / domaindata science
Project requirementsanalytics dashboard
Skills / interestsPython SQL cloud
Optional interestsmachine learning

2. Preprocessing

Text is normalized so that different surface forms can be compared consistently. The system removes irrelevant punctuation, normalizes case, and builds a single user-profile document.

Each catalog item is converted into a content document using:

  • Category
  • Frontend
  • Backend
  • Database
  • Deployment target
  • Technology tags
  • Description

3. TF-IDF Vectorization

Instead of treating every word as equally important, the system uses Term Frequency–Inverse Document Frequency.

TF(t,d) = count of term t in document d / total terms in d
IDF(t) = log(Total documents / documents containing t)
TF-IDF = TF × IDF

This gives more weight to descriptive terms and reduces the influence of generic words that appear throughout the catalog.

The same fitted vectorizer transforms both the catalog and user profile, ensuring a shared vocabulary space.

4. Similarity Scoring

The system uses cosine similarity:

 A · B
cosine(A,B) = ─────────────
||A|| ||B||

A score closer to 1.0 means stronger directional alignment between the user profile and the technology-stack content.

Cosine similarity is particularly appropriate here because recommendation quality should depend primarily on the orientation of preferences, rather than the absolute length of the text vectors.

5. Ranking

Every catalog item receives a similarity score. Candidates are then sorted in descending order:

Candidate A → 0.91
Candidate B → 0.84
Candidate C → 0.77
Candidate D → 0.45
Candidate E → 0.32

6. Top-N Filtering

Only the highest-scoring candidates are returned. The default is Top 3, directly reflecting the project's choice-overload objective.

0.91 ──┐
0.84 ──┤ ← Recommended
0.77 ──┘
0.45 ┐
0.32 ┘ ← Filtered out

🧊 Cold-Start Strategy

A recommendation system must still behave sensibly when little or no matching information exists.

User Cold Start

If a new user's terms contain no vocabulary known by the catalog, cosine similarity cannot provide meaningful personalized scores.

The system detects this condition and activates a global popularity fallback:

Unknown user profile
↓
No matching TF-IDF vocabulary
↓
Cold-start detected
↓
Popularity ranking
↓
Top-N recommendations

This implements the assignment's cold-start / popularity-fallback concept without introducing unnecessary collaborative-filtering infrastructure.

Item Cold Start

A new technology stack does not require historical user interactions. Once its metadata is added to the catalog, its content can be represented and compared against user preferences.

This is a key benefit of content-based recommendation.


🧩 Why Content-Based Filtering?

The assignment explicitly focuses on content-based filtering.

Collaborative Filtering

User A ── bought ── Item X
User B ── bought ── Item X
↓
infer similarity

This requires historical user behavior.

Content-Based Filtering

User preferences
↓
Feature representation
↓
Compare against item attributes
↓
Recommend similar items

This project uses the second approach because it directly matches the available information and remains effective for new items.


📁 Project Structure

Techstack-recommender/
│
├── app/
│ ├── __init__.py
│ ├── cli.py # Command-line application
│ ├── config.py # Paths and configuration
│ ├── data_loader.py # Dataset loading/validation
│ ├── preprocessing.py # Text normalization and documents
│ ├── recommender.py # TF-IDF + cosine recommendation engine
│ └── streamlit_app.py # Visual demonstration UI
│
├── data/
│ └── tech_stacks.csv # Technology-stack catalog
│
├── tests/
│ └── test_recommender.py # Core behavior tests
│
├── .env.example # Environment template
├── .gitignore # Git exclusions
├── README.md # Project documentation
├── requirements.txt # Python dependencies
└── run.py # Application entry point

🛠️ Technology Stack

TechnologyPurpose
PythonCore application language
pandasCatalog loading and tabular data handling
scikit-learnTF-IDF vectorization and cosine similarity
StreamlitOptional interactive demonstration UI
pytestAutomated testing
CSVLightweight, transparent catalog storage

Deliberately not used

The assignment does not require an LLM, RAG, vector database, authentication system, relational database, or external API. These technologies were intentionally excluded to keep the solution aligned with the specification and easy to demonstrate.


🚀 Getting Started

Prerequisites

  • Python 3.10+ recommended
  • pip
  • Git

No API key or external service account is required.

Windows PowerShell

python -m venv .venv
.\.venv\Scripts\Activate.ps1
python -m pip install --upgrade pip
pip install -r requirements.txt

macOS / Linux

python3 -m venv .venv
source .venv/bin/activate
python -m pip install --upgrade pip
pip install -r requirements.txt

▶️ Run the Application

CLI — Core Assignment Demonstration

python run.py

Example interaction:

=== CAPSTONE: TECH STACK RECOMMENDER ===
Content-based filtering | TF-IDF + cosine similarity
1) Target role/domain: data science
2) Project needs: analytics dashboard
3) Skills/interests: Python SQL cloud
4) Optional extra interests: machine learning

The system then returns the highest-scoring technology stacks.

Streamlit — Visual Demonstration

streamlit run app/streamlit_app.py

The Streamlit application is a presentation layer over the same recommendation engine. It does not contain a separate or simplified recommendation algorithm.


🧪 Testing

Run the automated test suite:

pytest -q

The suite covers the project's critical paths:

  • Minimum input validation
  • Content-based ranking
  • Cosine-score validity
  • Top-N filtering
  • Cold-start fallback

Expected result:

4 passed

📊 Example Recommendation Flow

For a user interested in:

Role: Data Science
Needs: Analytics Dashboard
Interests: Python, SQL, Cloud

the system might produce a result conceptually similar to:

RankRecommendationMatch
🥇 1Python Data Science StackHigh
🥈 2SQL Reporting StackHigh
🥉 3Data Engineering StackModerate

The exact scores are calculated dynamically from the TF-IDF representation of the catalog and user profile.


📚 Dataset

The included data/tech_stacks.csv catalog contains technology-stack candidates with attributes such as:

  • Frontend
  • Backend
  • Database
  • Deployment
  • Category
  • Tags
  • Description
  • Popularity

The catalog is intentionally human-readable so that the recommendation logic remains transparent and easy to explain during an internship presentation or supervisor review.

To add a new stack, add a row containing the required fields and restart the application.


🧱 Design Principles

Correctness first

The implementation follows the mathematical approach specified by the project rather than replacing it with a more complicated model.

Explainability

A recommendation can be traced through:

User input
↓
Normalized terms
↓
TF-IDF representation
↓
Cosine similarity
↓
Score
↓
Rank
↓
Top-N output

Simplicity

The system uses a local CSV catalog instead of adding a database solely for architectural appearance.

Extensibility

The core TechStackRecommender class is independent of the CLI and Streamlit interface, making it straightforward to integrate into another application later.


🔐 Security & Configuration

There are currently no secrets or API credentials in the project.

The repository includes .env.example as a safe configuration placeholder. The .gitignore also excludes .env and common local Python artifacts.


📋 Requirement Traceability

Assignment RequirementImplementationStatus
Tech Stack Recommenderapp/recommender.py
Input → Processing → OutputCLI + recommender pipeline
Minimum 3 user inputsapp/cli.py
Content-Based FilteringTechStackRecommender
Shared feature vocabularySingle fitted TF-IDF vectorizer
Vector mappingpreprocessing.py
TF-IDF weightingTfidfVectorizer
Avoid binary overlapWeighted TF-IDF features
Cosine similaritycosine_similarity()
Score available itemsrecommend()
Sort by relevanceDescending score sort
Top-N filtering.head(top_n)
Choice overload reductionTop-3 default
User cold startPopularity fallback
Item cold startMetadata-based scoring
Demonstration UIStreamlit
Automated teststests/test_recommender.py

📦 Deliverables

Core submission

  • ✅ Complete source code
  • ✅ Recommendation engine
  • ✅ Technology-stack dataset
  • ✅ Requirements file
  • ✅ README documentation
  • ✅ Automated tests
  • ✅ Working CLI demonstration

Recommended presentation material

  • Architecture diagram
  • Screenshot of the Streamlit interface
  • Screenshot of sample recommendations
  • Short explanation of TF-IDF
  • Short explanation of cosine similarity
  • Cold-start demonstration
  • Test output showing passing tests

🎓 Capstone Context

This repository implements the Tech Stack Recommender capstone following the supplied internship project specification and its progression from:

Passive Classification → Active Prediction

The final system converts structured and unstructured preference signals into an actionable ranked recommendation list while remaining transparent, deterministic, and easy to demonstrate.


👨‍💻 Author

Hadeed Jalani
AI / ML Internship Project — Tech Stack Recommender


⭐ If this project helped you, consider starring the repository.

Built with Python · TF-IDF · Cosine Similarity · Content-Based Recommendation

About

Content-based Tech Stack Recommendation Engine using TF-IDF and Cosine Similarity to rank personalized technology stacks from user preferences, with Top-N filtering and cold-start handling.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Strip utm_, fbclid, gclid, etc. from all links on page\n(function() {\n var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content',\n 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid',\n 'ref', 'ref_src', 'source', 'medium', 'campaign'];\n \n function cleanUrl(url) {\n try {\n var u = new URL(url, window.location.origin);\n var changed = false;\n trackingParams.forEach(function(p) {\n if (u.searchParams.has(p)) {\n u.searchParams.delete(p);\n changed = true;\n }\n });\n return changed ? u.toString() : url;\n } catch (e) {\n return url;\n }\n }\n \n function cleanLinks() {\n document.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n \n cleanLinks();\n \n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1) {\n if (node.tagName === 'A') cleanLinks();\n node.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Remove Tracking Parameters from Links"); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + '
Skip to content

Latest commit

History

15 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

🧠 Tech Stack Recommender

Content-Based Recommendation Engine for Technology Stack Selection

TF-IDF · Cosine Similarity · Ranking · Top-N Filtering · Cold-Start Handling

Pythonscikit-learnStreamlitTests

Internship Capstone Project
A practical recommendation system that converts user preferences into ranked technology-stack recommendations using transparent, explainable machine-learning techniques.


✨ Project Overview

Tech Stack Recommender is a content-based recommendation system designed to answer a practical engineering question:

“Given what I want to build and the technologies I am interested in, which technology stack should I choose?”

The system compares a user's stated preferences against a catalog of technology stacks. It represents both sides in a shared TF-IDF feature space, calculates cosine similarity, ranks every candidate, and returns a concise Top-N recommendation list.

The implementation follows the capstone architecture shown in the project specification:

INPUT → PROCESSING → SCORING → SORTING → FILTERING → OUTPUT

It deliberately uses content-based filtering rather than collaborative filtering, because the assignment focuses on matching users directly to item attributes without requiring a historical user-interaction dataset.


🎯 Objectives

The project is built around the following objectives:

  • Capture explicit user preferences.
  • Require a minimum of three meaningful inputs.
  • Translate natural-language preferences into a numerical representation.
  • Represent users and technology stacks in the same feature space.
  • Use TF-IDF instead of simple binary 0/1 matching.
  • Measure relevance using cosine similarity.
  • Score the complete catalog.
  • Sort candidates by relevance.
  • Return a configurable Top-N list to reduce choice overload.
  • Handle the cold-start problem with a practical fallback.
  • Provide both a command-line implementation and a visual demonstration interface.

🏗️ System Architecture

 ┌─────────────────────────┐
│ USER │
│ │
│ Role / Domain │
│ Project Requirements │
│ Skills / Interests │
└────────────┬────────────┘
│
▼
┌─────────────────────────┐
│ INPUT │
│ Validate 3+ inputs │
└────────────┬────────────┘
│
▼
┌─────────────────────────┐
│ PREPROCESSING │
│ │
│ Normalize text │
│ Build user document │
└────────────┬────────────┘
│
┌───────────────────┴───────────────────┐
│ │
▼ ▼
┌──────────────────────┐ ┌──────────────────────┐
│ USER PROFILE │ │ ITEM CATALOG │
│ │ │ │
│ User document │ │ Tech-stack documents │
└──────────┬───────────┘ └──────────┬───────────┘
│ │
└───────────────────┬───────────────────┘
▼
┌─────────────────────────┐
│ TF-IDF │
│ │
│ Shared vocabulary │
│ Weighted feature space │
└────────────┬────────────┘
│
▼
┌─────────────────────────┐
│ COSINE SIMILARITY │
│ │
│ user vector ↔ item │
│ vector │
└────────────┬────────────┘
│
▼
┌─────────────────────────┐
│ SCORING │
│ Score every candidate │
└────────────┬────────────┘
│
▼
┌─────────────────────────┐
│ SORTING │
│ Score DESC │
└────────────┬────────────┘
│
▼
┌─────────────────────────┐
│ FILTERING │
│ Top-N │
└────────────┬────────────┘
│
▼
┌─────────────────────────┐
│ OUTPUT │
│ Ranked recommendations │
└─────────────────────────┘

🔬 Machine Learning Pipeline

1. Input

The application collects at least three user inputs:

InputExample
Target role / domaindata science
Project requirementsanalytics dashboard
Skills / interestsPython SQL cloud
Optional interestsmachine learning

2. Preprocessing

Text is normalized so that different surface forms can be compared consistently. The system removes irrelevant punctuation, normalizes case, and builds a single user-profile document.

Each catalog item is converted into a content document using:

  • Category
  • Frontend
  • Backend
  • Database
  • Deployment target
  • Technology tags
  • Description

3. TF-IDF Vectorization

Instead of treating every word as equally important, the system uses Term Frequency–Inverse Document Frequency.

TF(t,d) = count of term t in document d / total terms in d
IDF(t) = log(Total documents / documents containing t)
TF-IDF = TF × IDF

This gives more weight to descriptive terms and reduces the influence of generic words that appear throughout the catalog.

The same fitted vectorizer transforms both the catalog and user profile, ensuring a shared vocabulary space.

4. Similarity Scoring

The system uses cosine similarity:

 A · B
cosine(A,B) = ─────────────
||A|| ||B||

A score closer to 1.0 means stronger directional alignment between the user profile and the technology-stack content.

Cosine similarity is particularly appropriate here because recommendation quality should depend primarily on the orientation of preferences, rather than the absolute length of the text vectors.

5. Ranking

Every catalog item receives a similarity score. Candidates are then sorted in descending order:

Candidate A → 0.91
Candidate B → 0.84
Candidate C → 0.77
Candidate D → 0.45
Candidate E → 0.32

6. Top-N Filtering

Only the highest-scoring candidates are returned. The default is Top 3, directly reflecting the project's choice-overload objective.

0.91 ──┐
0.84 ──┤ ← Recommended
0.77 ──┘
0.45 ┐
0.32 ┘ ← Filtered out

🧊 Cold-Start Strategy

A recommendation system must still behave sensibly when little or no matching information exists.

User Cold Start

If a new user's terms contain no vocabulary known by the catalog, cosine similarity cannot provide meaningful personalized scores.

The system detects this condition and activates a global popularity fallback:

Unknown user profile
↓
No matching TF-IDF vocabulary
↓
Cold-start detected
↓
Popularity ranking
↓
Top-N recommendations

This implements the assignment's cold-start / popularity-fallback concept without introducing unnecessary collaborative-filtering infrastructure.

Item Cold Start

A new technology stack does not require historical user interactions. Once its metadata is added to the catalog, its content can be represented and compared against user preferences.

This is a key benefit of content-based recommendation.


🧩 Why Content-Based Filtering?

The assignment explicitly focuses on content-based filtering.

Collaborative Filtering

User A ── bought ── Item X
User B ── bought ── Item X
↓
infer similarity

This requires historical user behavior.

Content-Based Filtering

User preferences
↓
Feature representation
↓
Compare against item attributes
↓
Recommend similar items

This project uses the second approach because it directly matches the available information and remains effective for new items.


📁 Project Structure

Techstack-recommender/
│
├── app/
│ ├── __init__.py
│ ├── cli.py # Command-line application
│ ├── config.py # Paths and configuration
│ ├── data_loader.py # Dataset loading/validation
│ ├── preprocessing.py # Text normalization and documents
│ ├── recommender.py # TF-IDF + cosine recommendation engine
│ └── streamlit_app.py # Visual demonstration UI
│
├── data/
│ └── tech_stacks.csv # Technology-stack catalog
│
├── tests/
│ └── test_recommender.py # Core behavior tests
│
├── .env.example # Environment template
├── .gitignore # Git exclusions
├── README.md # Project documentation
├── requirements.txt # Python dependencies
└── run.py # Application entry point

🛠️ Technology Stack

TechnologyPurpose
PythonCore application language
pandasCatalog loading and tabular data handling
scikit-learnTF-IDF vectorization and cosine similarity
StreamlitOptional interactive demonstration UI
pytestAutomated testing
CSVLightweight, transparent catalog storage

Deliberately not used

The assignment does not require an LLM, RAG, vector database, authentication system, relational database, or external API. These technologies were intentionally excluded to keep the solution aligned with the specification and easy to demonstrate.


🚀 Getting Started

Prerequisites

  • Python 3.10+ recommended
  • pip
  • Git

No API key or external service account is required.

Windows PowerShell

python -m venv .venv
.\.venv\Scripts\Activate.ps1
python -m pip install --upgrade pip
pip install -r requirements.txt

macOS / Linux

python3 -m venv .venv
source .venv/bin/activate
python -m pip install --upgrade pip
pip install -r requirements.txt

▶️ Run the Application

CLI — Core Assignment Demonstration

python run.py

Example interaction:

=== CAPSTONE: TECH STACK RECOMMENDER ===
Content-based filtering | TF-IDF + cosine similarity
1) Target role/domain: data science
2) Project needs: analytics dashboard
3) Skills/interests: Python SQL cloud
4) Optional extra interests: machine learning

The system then returns the highest-scoring technology stacks.

Streamlit — Visual Demonstration

streamlit run app/streamlit_app.py

The Streamlit application is a presentation layer over the same recommendation engine. It does not contain a separate or simplified recommendation algorithm.


🧪 Testing

Run the automated test suite:

pytest -q

The suite covers the project's critical paths:

  • Minimum input validation
  • Content-based ranking
  • Cosine-score validity
  • Top-N filtering
  • Cold-start fallback

Expected result:

4 passed

📊 Example Recommendation Flow

For a user interested in:

Role: Data Science
Needs: Analytics Dashboard
Interests: Python, SQL, Cloud

the system might produce a result conceptually similar to:

RankRecommendationMatch
🥇 1Python Data Science StackHigh
🥈 2SQL Reporting StackHigh
🥉 3Data Engineering StackModerate

The exact scores are calculated dynamically from the TF-IDF representation of the catalog and user profile.


📚 Dataset

The included data/tech_stacks.csv catalog contains technology-stack candidates with attributes such as:

  • Frontend
  • Backend
  • Database
  • Deployment
  • Category
  • Tags
  • Description
  • Popularity

The catalog is intentionally human-readable so that the recommendation logic remains transparent and easy to explain during an internship presentation or supervisor review.

To add a new stack, add a row containing the required fields and restart the application.


🧱 Design Principles

Correctness first

The implementation follows the mathematical approach specified by the project rather than replacing it with a more complicated model.

Explainability

A recommendation can be traced through:

User input
↓
Normalized terms
↓
TF-IDF representation
↓
Cosine similarity
↓
Score
↓
Rank
↓
Top-N output

Simplicity

The system uses a local CSV catalog instead of adding a database solely for architectural appearance.

Extensibility

The core TechStackRecommender class is independent of the CLI and Streamlit interface, making it straightforward to integrate into another application later.


🔐 Security & Configuration

There are currently no secrets or API credentials in the project.

The repository includes .env.example as a safe configuration placeholder. The .gitignore also excludes .env and common local Python artifacts.


📋 Requirement Traceability

Assignment RequirementImplementationStatus
Tech Stack Recommenderapp/recommender.py
Input → Processing → OutputCLI + recommender pipeline
Minimum 3 user inputsapp/cli.py
Content-Based FilteringTechStackRecommender
Shared feature vocabularySingle fitted TF-IDF vectorizer
Vector mappingpreprocessing.py
TF-IDF weightingTfidfVectorizer
Avoid binary overlapWeighted TF-IDF features
Cosine similaritycosine_similarity()
Score available itemsrecommend()
Sort by relevanceDescending score sort
Top-N filtering.head(top_n)
Choice overload reductionTop-3 default
User cold startPopularity fallback
Item cold startMetadata-based scoring
Demonstration UIStreamlit
Automated teststests/test_recommender.py

📦 Deliverables

Core submission

  • ✅ Complete source code
  • ✅ Recommendation engine
  • ✅ Technology-stack dataset
  • ✅ Requirements file
  • ✅ README documentation
  • ✅ Automated tests
  • ✅ Working CLI demonstration

Recommended presentation material

  • Architecture diagram
  • Screenshot of the Streamlit interface
  • Screenshot of sample recommendations
  • Short explanation of TF-IDF
  • Short explanation of cosine similarity
  • Cold-start demonstration
  • Test output showing passing tests

🎓 Capstone Context

This repository implements the Tech Stack Recommender capstone following the supplied internship project specification and its progression from:

Passive Classification → Active Prediction

The final system converts structured and unstructured preference signals into an actionable ranked recommendation list while remaining transparent, deterministic, and easy to demonstrate.


👨‍💻 Author

Hadeed Jalani
AI / ML Internship Project — Tech Stack Recommender


⭐ If this project helped you, consider starring the repository.

Built with Python · TF-IDF · Cosine Similarity · Content-Based Recommendation

About

Content-based Tech Stack Recommendation Engine using TF-IDF and Cosine Similarity to rank personalized technology stacks from user preferences, with Top-N filtering and cold-start handling.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Auto-enable theater mode on YouTube\n(function() {\n function tryTheater() {\n var btn = document.querySelector('button[aria-label=\"Theater mode\"], ytd-player #player button[title=\"Theater mode\"]');\n if (btn && !btn.classList.contains('activated')) {\n btn.click();\n }\n }\n \n // Try immediately\n tryTheater();\n \n // Try after navigation (SPA)\n var lastUrl = location.href;\n setInterval(function() {\n if (location.href !== lastUrl) {\n lastUrl = location.href;\n setTimeout(tryTheater, 500);\n }\n }, 1000);\n \n // Also try on player load\n var observer = new MutationObserver(tryTheater);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "YouTube Theater Mode Default"); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

Latest commit

History

15 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

🧠 Tech Stack Recommender

Content-Based Recommendation Engine for Technology Stack Selection

TF-IDF · Cosine Similarity · Ranking · Top-N Filtering · Cold-Start Handling

Pythonscikit-learnStreamlitTests

Internship Capstone Project
A practical recommendation system that converts user preferences into ranked technology-stack recommendations using transparent, explainable machine-learning techniques.


✨ Project Overview

Tech Stack Recommender is a content-based recommendation system designed to answer a practical engineering question:

“Given what I want to build and the technologies I am interested in, which technology stack should I choose?”

The system compares a user's stated preferences against a catalog of technology stacks. It represents both sides in a shared TF-IDF feature space, calculates cosine similarity, ranks every candidate, and returns a concise Top-N recommendation list.

The implementation follows the capstone architecture shown in the project specification:

INPUT → PROCESSING → SCORING → SORTING → FILTERING → OUTPUT

It deliberately uses content-based filtering rather than collaborative filtering, because the assignment focuses on matching users directly to item attributes without requiring a historical user-interaction dataset.


🎯 Objectives

The project is built around the following objectives:

  • Capture explicit user preferences.
  • Require a minimum of three meaningful inputs.
  • Translate natural-language preferences into a numerical representation.
  • Represent users and technology stacks in the same feature space.
  • Use TF-IDF instead of simple binary 0/1 matching.
  • Measure relevance using cosine similarity.
  • Score the complete catalog.
  • Sort candidates by relevance.
  • Return a configurable Top-N list to reduce choice overload.
  • Handle the cold-start problem with a practical fallback.
  • Provide both a command-line implementation and a visual demonstration interface.

🏗️ System Architecture

 ┌─────────────────────────┐
│ USER │
│ │
│ Role / Domain │
│ Project Requirements │
│ Skills / Interests │
└────────────┬────────────┘
│
▼
┌─────────────────────────┐
│ INPUT │
│ Validate 3+ inputs │
└────────────┬────────────┘
│
▼
┌─────────────────────────┐
│ PREPROCESSING │
│ │
│ Normalize text │
│ Build user document │
└────────────┬────────────┘
│
┌───────────────────┴───────────────────┐
│ │
▼ ▼
┌──────────────────────┐ ┌──────────────────────┐
│ USER PROFILE │ │ ITEM CATALOG │
│ │ │ │
│ User document │ │ Tech-stack documents │
└──────────┬───────────┘ └──────────┬───────────┘
│ │
└───────────────────┬───────────────────┘
▼
┌─────────────────────────┐
│ TF-IDF │
│ │
│ Shared vocabulary │
│ Weighted feature space │
└────────────┬────────────┘
│
▼
┌─────────────────────────┐
│ COSINE SIMILARITY │
│ │
│ user vector ↔ item │
│ vector │
└────────────┬────────────┘
│
▼
┌─────────────────────────┐
│ SCORING │
│ Score every candidate │
└────────────┬────────────┘
│
▼
┌─────────────────────────┐
│ SORTING │
│ Score DESC │
└────────────┬────────────┘
│
▼
┌─────────────────────────┐
│ FILTERING │
│ Top-N │
└────────────┬────────────┘
│
▼
┌─────────────────────────┐
│ OUTPUT │
│ Ranked recommendations │
└─────────────────────────┘

🔬 Machine Learning Pipeline

1. Input

The application collects at least three user inputs:

InputExample
Target role / domaindata science
Project requirementsanalytics dashboard
Skills / interestsPython SQL cloud
Optional interestsmachine learning

2. Preprocessing

Text is normalized so that different surface forms can be compared consistently. The system removes irrelevant punctuation, normalizes case, and builds a single user-profile document.

Each catalog item is converted into a content document using:

  • Category
  • Frontend
  • Backend
  • Database
  • Deployment target
  • Technology tags
  • Description

3. TF-IDF Vectorization

Instead of treating every word as equally important, the system uses Term Frequency–Inverse Document Frequency.

TF(t,d) = count of term t in document d / total terms in d
IDF(t) = log(Total documents / documents containing t)
TF-IDF = TF × IDF

This gives more weight to descriptive terms and reduces the influence of generic words that appear throughout the catalog.

The same fitted vectorizer transforms both the catalog and user profile, ensuring a shared vocabulary space.

4. Similarity Scoring

The system uses cosine similarity:

 A · B
cosine(A,B) = ─────────────
||A|| ||B||

A score closer to 1.0 means stronger directional alignment between the user profile and the technology-stack content.

Cosine similarity is particularly appropriate here because recommendation quality should depend primarily on the orientation of preferences, rather than the absolute length of the text vectors.

5. Ranking

Every catalog item receives a similarity score. Candidates are then sorted in descending order:

Candidate A → 0.91
Candidate B → 0.84
Candidate C → 0.77
Candidate D → 0.45
Candidate E → 0.32

6. Top-N Filtering

Only the highest-scoring candidates are returned. The default is Top 3, directly reflecting the project's choice-overload objective.

0.91 ──┐
0.84 ──┤ ← Recommended
0.77 ──┘
0.45 ┐
0.32 ┘ ← Filtered out

🧊 Cold-Start Strategy

A recommendation system must still behave sensibly when little or no matching information exists.

User Cold Start

If a new user's terms contain no vocabulary known by the catalog, cosine similarity cannot provide meaningful personalized scores.

The system detects this condition and activates a global popularity fallback:

Unknown user profile
↓
No matching TF-IDF vocabulary
↓
Cold-start detected
↓
Popularity ranking
↓
Top-N recommendations

This implements the assignment's cold-start / popularity-fallback concept without introducing unnecessary collaborative-filtering infrastructure.

Item Cold Start

A new technology stack does not require historical user interactions. Once its metadata is added to the catalog, its content can be represented and compared against user preferences.

This is a key benefit of content-based recommendation.


🧩 Why Content-Based Filtering?

The assignment explicitly focuses on content-based filtering.

Collaborative Filtering

User A ── bought ── Item X
User B ── bought ── Item X
↓
infer similarity

This requires historical user behavior.

Content-Based Filtering

User preferences
↓
Feature representation
↓
Compare against item attributes
↓
Recommend similar items

This project uses the second approach because it directly matches the available information and remains effective for new items.


📁 Project Structure

Techstack-recommender/
│
├── app/
│ ├── __init__.py
│ ├── cli.py # Command-line application
│ ├── config.py # Paths and configuration
│ ├── data_loader.py # Dataset loading/validation
│ ├── preprocessing.py # Text normalization and documents
│ ├── recommender.py # TF-IDF + cosine recommendation engine
│ └── streamlit_app.py # Visual demonstration UI
│
├── data/
│ └── tech_stacks.csv # Technology-stack catalog
│
├── tests/
│ └── test_recommender.py # Core behavior tests
│
├── .env.example # Environment template
├── .gitignore # Git exclusions
├── README.md # Project documentation
├── requirements.txt # Python dependencies
└── run.py # Application entry point

🛠️ Technology Stack

TechnologyPurpose
PythonCore application language
pandasCatalog loading and tabular data handling
scikit-learnTF-IDF vectorization and cosine similarity
StreamlitOptional interactive demonstration UI
pytestAutomated testing
CSVLightweight, transparent catalog storage

Deliberately not used

The assignment does not require an LLM, RAG, vector database, authentication system, relational database, or external API. These technologies were intentionally excluded to keep the solution aligned with the specification and easy to demonstrate.


🚀 Getting Started

Prerequisites

  • Python 3.10+ recommended
  • pip
  • Git

No API key or external service account is required.

Windows PowerShell

python -m venv .venv
.\.venv\Scripts\Activate.ps1
python -m pip install --upgrade pip
pip install -r requirements.txt

macOS / Linux

python3 -m venv .venv
source .venv/bin/activate
python -m pip install --upgrade pip
pip install -r requirements.txt

▶️ Run the Application

CLI — Core Assignment Demonstration

python run.py

Example interaction:

=== CAPSTONE: TECH STACK RECOMMENDER ===
Content-based filtering | TF-IDF + cosine similarity
1) Target role/domain: data science
2) Project needs: analytics dashboard
3) Skills/interests: Python SQL cloud
4) Optional extra interests: machine learning

The system then returns the highest-scoring technology stacks.

Streamlit — Visual Demonstration

streamlit run app/streamlit_app.py

The Streamlit application is a presentation layer over the same recommendation engine. It does not contain a separate or simplified recommendation algorithm.


🧪 Testing

Run the automated test suite:

pytest -q

The suite covers the project's critical paths:

  • Minimum input validation
  • Content-based ranking
  • Cosine-score validity
  • Top-N filtering
  • Cold-start fallback

Expected result:

4 passed

📊 Example Recommendation Flow

For a user interested in:

Role: Data Science
Needs: Analytics Dashboard
Interests: Python, SQL, Cloud

the system might produce a result conceptually similar to:

RankRecommendationMatch
🥇 1Python Data Science StackHigh
🥈 2SQL Reporting StackHigh
🥉 3Data Engineering StackModerate

The exact scores are calculated dynamically from the TF-IDF representation of the catalog and user profile.


📚 Dataset

The included data/tech_stacks.csv catalog contains technology-stack candidates with attributes such as:

  • Frontend
  • Backend
  • Database
  • Deployment
  • Category
  • Tags
  • Description
  • Popularity

The catalog is intentionally human-readable so that the recommendation logic remains transparent and easy to explain during an internship presentation or supervisor review.

To add a new stack, add a row containing the required fields and restart the application.


🧱 Design Principles

Correctness first

The implementation follows the mathematical approach specified by the project rather than replacing it with a more complicated model.

Explainability

A recommendation can be traced through:

User input
↓
Normalized terms
↓
TF-IDF representation
↓
Cosine similarity
↓
Score
↓
Rank
↓
Top-N output

Simplicity

The system uses a local CSV catalog instead of adding a database solely for architectural appearance.

Extensibility

The core TechStackRecommender class is independent of the CLI and Streamlit interface, making it straightforward to integrate into another application later.


🔐 Security & Configuration

There are currently no secrets or API credentials in the project.

The repository includes .env.example as a safe configuration placeholder. The .gitignore also excludes .env and common local Python artifacts.


📋 Requirement Traceability

Assignment RequirementImplementationStatus
Tech Stack Recommenderapp/recommender.py
Input → Processing → OutputCLI + recommender pipeline
Minimum 3 user inputsapp/cli.py
Content-Based FilteringTechStackRecommender
Shared feature vocabularySingle fitted TF-IDF vectorizer
Vector mappingpreprocessing.py
TF-IDF weightingTfidfVectorizer
Avoid binary overlapWeighted TF-IDF features
Cosine similaritycosine_similarity()
Score available itemsrecommend()
Sort by relevanceDescending score sort
Top-N filtering.head(top_n)
Choice overload reductionTop-3 default
User cold startPopularity fallback
Item cold startMetadata-based scoring
Demonstration UIStreamlit
Automated teststests/test_recommender.py

📦 Deliverables

Core submission

  • ✅ Complete source code
  • ✅ Recommendation engine
  • ✅ Technology-stack dataset
  • ✅ Requirements file
  • ✅ README documentation
  • ✅ Automated tests
  • ✅ Working CLI demonstration

Recommended presentation material

  • Architecture diagram
  • Screenshot of the Streamlit interface
  • Screenshot of sample recommendations
  • Short explanation of TF-IDF
  • Short explanation of cosine similarity
  • Cold-start demonstration
  • Test output showing passing tests

🎓 Capstone Context

This repository implements the Tech Stack Recommender capstone following the supplied internship project specification and its progression from:

Passive Classification → Active Prediction

The final system converts structured and unstructured preference signals into an actionable ranked recommendation list while remaining transparent, deterministic, and easy to demonstrate.


👨‍💻 Author

Hadeed Jalani
AI / ML Internship Project — Tech Stack Recommender


⭐ If this project helped you, consider starring the repository.

Built with Python · TF-IDF · Cosine Similarity · Content-Based Recommendation

About

Content-based Tech Stack Recommendation Engine using TF-IDF and Cosine Similarity to rank personalized technology stacks from user preferences, with Top-N filtering and cold-start handling.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Remove or un-stick sticky/fixed headers that block content\n(function() {\n function unstick() {\n document.querySelectorAll('header, nav, [role=\"banner\"], .header, .navbar, .sticky, .fixed-top, [style*=\"position: fixed\"], [style*=\"position:sticky\"]').forEach(function(el) {\n if (el.style.position === 'fixed' || el.style.position === 'sticky' || \n getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') {\n el.style.position = 'static';\n el.style.top = 'auto';\n el.style.zIndex = 'auto';\n }\n });\n }\n \n unstick();\n \n var observer = new MutationObserver(unstick);\n observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] });\n})();", "Kill Sticky Headers"); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

Latest commit

History

15 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

🧠 Tech Stack Recommender

Content-Based Recommendation Engine for Technology Stack Selection

TF-IDF · Cosine Similarity · Ranking · Top-N Filtering · Cold-Start Handling

Pythonscikit-learnStreamlitTests

Internship Capstone Project
A practical recommendation system that converts user preferences into ranked technology-stack recommendations using transparent, explainable machine-learning techniques.


✨ Project Overview

Tech Stack Recommender is a content-based recommendation system designed to answer a practical engineering question:

“Given what I want to build and the technologies I am interested in, which technology stack should I choose?”

The system compares a user's stated preferences against a catalog of technology stacks. It represents both sides in a shared TF-IDF feature space, calculates cosine similarity, ranks every candidate, and returns a concise Top-N recommendation list.

The implementation follows the capstone architecture shown in the project specification:

INPUT → PROCESSING → SCORING → SORTING → FILTERING → OUTPUT

It deliberately uses content-based filtering rather than collaborative filtering, because the assignment focuses on matching users directly to item attributes without requiring a historical user-interaction dataset.


🎯 Objectives

The project is built around the following objectives:

  • Capture explicit user preferences.
  • Require a minimum of three meaningful inputs.
  • Translate natural-language preferences into a numerical representation.
  • Represent users and technology stacks in the same feature space.
  • Use TF-IDF instead of simple binary 0/1 matching.
  • Measure relevance using cosine similarity.
  • Score the complete catalog.
  • Sort candidates by relevance.
  • Return a configurable Top-N list to reduce choice overload.
  • Handle the cold-start problem with a practical fallback.
  • Provide both a command-line implementation and a visual demonstration interface.

🏗️ System Architecture

 ┌─────────────────────────┐
│ USER │
│ │
│ Role / Domain │
│ Project Requirements │
│ Skills / Interests │
└────────────┬────────────┘
│
▼
┌─────────────────────────┐
│ INPUT │
│ Validate 3+ inputs │
└────────────┬────────────┘
│
▼
┌─────────────────────────┐
│ PREPROCESSING │
│ │
│ Normalize text │
│ Build user document │
└────────────┬────────────┘
│
┌───────────────────┴───────────────────┐
│ │
▼ ▼
┌──────────────────────┐ ┌──────────────────────┐
│ USER PROFILE │ │ ITEM CATALOG │
│ │ │ │
│ User document │ │ Tech-stack documents │
└──────────┬───────────┘ └──────────┬───────────┘
│ │
└───────────────────┬───────────────────┘
▼
┌─────────────────────────┐
│ TF-IDF │
│ │
│ Shared vocabulary │
│ Weighted feature space │
└────────────┬────────────┘
│
▼
┌─────────────────────────┐
│ COSINE SIMILARITY │
│ │
│ user vector ↔ item │
│ vector │
└────────────┬────────────┘
│
▼
┌─────────────────────────┐
│ SCORING │
│ Score every candidate │
└────────────┬────────────┘
│
▼
┌─────────────────────────┐
│ SORTING │
│ Score DESC │
└────────────┬────────────┘
│
▼
┌─────────────────────────┐
│ FILTERING │
│ Top-N │
└────────────┬────────────┘
│
▼
┌─────────────────────────┐
│ OUTPUT │
│ Ranked recommendations │
└─────────────────────────┘

🔬 Machine Learning Pipeline

1. Input

The application collects at least three user inputs:

InputExample
Target role / domaindata science
Project requirementsanalytics dashboard
Skills / interestsPython SQL cloud
Optional interestsmachine learning

2. Preprocessing

Text is normalized so that different surface forms can be compared consistently. The system removes irrelevant punctuation, normalizes case, and builds a single user-profile document.

Each catalog item is converted into a content document using:

  • Category
  • Frontend
  • Backend
  • Database
  • Deployment target
  • Technology tags
  • Description

3. TF-IDF Vectorization

Instead of treating every word as equally important, the system uses Term Frequency–Inverse Document Frequency.

TF(t,d) = count of term t in document d / total terms in d
IDF(t) = log(Total documents / documents containing t)
TF-IDF = TF × IDF

This gives more weight to descriptive terms and reduces the influence of generic words that appear throughout the catalog.

The same fitted vectorizer transforms both the catalog and user profile, ensuring a shared vocabulary space.

4. Similarity Scoring

The system uses cosine similarity:

 A · B
cosine(A,B) = ─────────────
||A|| ||B||

A score closer to 1.0 means stronger directional alignment between the user profile and the technology-stack content.

Cosine similarity is particularly appropriate here because recommendation quality should depend primarily on the orientation of preferences, rather than the absolute length of the text vectors.

5. Ranking

Every catalog item receives a similarity score. Candidates are then sorted in descending order:

Candidate A → 0.91
Candidate B → 0.84
Candidate C → 0.77
Candidate D → 0.45
Candidate E → 0.32

6. Top-N Filtering

Only the highest-scoring candidates are returned. The default is Top 3, directly reflecting the project's choice-overload objective.

0.91 ──┐
0.84 ──┤ ← Recommended
0.77 ──┘
0.45 ┐
0.32 ┘ ← Filtered out

🧊 Cold-Start Strategy

A recommendation system must still behave sensibly when little or no matching information exists.

User Cold Start

If a new user's terms contain no vocabulary known by the catalog, cosine similarity cannot provide meaningful personalized scores.

The system detects this condition and activates a global popularity fallback:

Unknown user profile
↓
No matching TF-IDF vocabulary
↓
Cold-start detected
↓
Popularity ranking
↓
Top-N recommendations

This implements the assignment's cold-start / popularity-fallback concept without introducing unnecessary collaborative-filtering infrastructure.

Item Cold Start

A new technology stack does not require historical user interactions. Once its metadata is added to the catalog, its content can be represented and compared against user preferences.

This is a key benefit of content-based recommendation.


🧩 Why Content-Based Filtering?

The assignment explicitly focuses on content-based filtering.

Collaborative Filtering

User A ── bought ── Item X
User B ── bought ── Item X
↓
infer similarity

This requires historical user behavior.

Content-Based Filtering

User preferences
↓
Feature representation
↓
Compare against item attributes
↓
Recommend similar items

This project uses the second approach because it directly matches the available information and remains effective for new items.


📁 Project Structure

Techstack-recommender/
│
├── app/
│ ├── __init__.py
│ ├── cli.py # Command-line application
│ ├── config.py # Paths and configuration
│ ├── data_loader.py # Dataset loading/validation
│ ├── preprocessing.py # Text normalization and documents
│ ├── recommender.py # TF-IDF + cosine recommendation engine
│ └── streamlit_app.py # Visual demonstration UI
│
├── data/
│ └── tech_stacks.csv # Technology-stack catalog
│
├── tests/
│ └── test_recommender.py # Core behavior tests
│
├── .env.example # Environment template
├── .gitignore # Git exclusions
├── README.md # Project documentation
├── requirements.txt # Python dependencies
└── run.py # Application entry point

🛠️ Technology Stack

TechnologyPurpose
PythonCore application language
pandasCatalog loading and tabular data handling
scikit-learnTF-IDF vectorization and cosine similarity
StreamlitOptional interactive demonstration UI
pytestAutomated testing
CSVLightweight, transparent catalog storage

Deliberately not used

The assignment does not require an LLM, RAG, vector database, authentication system, relational database, or external API. These technologies were intentionally excluded to keep the solution aligned with the specification and easy to demonstrate.


🚀 Getting Started

Prerequisites

  • Python 3.10+ recommended
  • pip
  • Git

No API key or external service account is required.

Windows PowerShell

python -m venv .venv
.\.venv\Scripts\Activate.ps1
python -m pip install --upgrade pip
pip install -r requirements.txt

macOS / Linux

python3 -m venv .venv
source .venv/bin/activate
python -m pip install --upgrade pip
pip install -r requirements.txt

▶️ Run the Application

CLI — Core Assignment Demonstration

python run.py

Example interaction:

=== CAPSTONE: TECH STACK RECOMMENDER ===
Content-based filtering | TF-IDF + cosine similarity
1) Target role/domain: data science
2) Project needs: analytics dashboard
3) Skills/interests: Python SQL cloud
4) Optional extra interests: machine learning

The system then returns the highest-scoring technology stacks.

Streamlit — Visual Demonstration

streamlit run app/streamlit_app.py

The Streamlit application is a presentation layer over the same recommendation engine. It does not contain a separate or simplified recommendation algorithm.


🧪 Testing

Run the automated test suite:

pytest -q

The suite covers the project's critical paths:

  • Minimum input validation
  • Content-based ranking
  • Cosine-score validity
  • Top-N filtering
  • Cold-start fallback

Expected result:

4 passed

📊 Example Recommendation Flow

For a user interested in:

Role: Data Science
Needs: Analytics Dashboard
Interests: Python, SQL, Cloud

the system might produce a result conceptually similar to:

RankRecommendationMatch
🥇 1Python Data Science StackHigh
🥈 2SQL Reporting StackHigh
🥉 3Data Engineering StackModerate

The exact scores are calculated dynamically from the TF-IDF representation of the catalog and user profile.


📚 Dataset

The included data/tech_stacks.csv catalog contains technology-stack candidates with attributes such as:

  • Frontend
  • Backend
  • Database
  • Deployment
  • Category
  • Tags
  • Description
  • Popularity

The catalog is intentionally human-readable so that the recommendation logic remains transparent and easy to explain during an internship presentation or supervisor review.

To add a new stack, add a row containing the required fields and restart the application.


🧱 Design Principles

Correctness first

The implementation follows the mathematical approach specified by the project rather than replacing it with a more complicated model.

Explainability

A recommendation can be traced through:

User input
↓
Normalized terms
↓
TF-IDF representation
↓
Cosine similarity
↓
Score
↓
Rank
↓
Top-N output

Simplicity

The system uses a local CSV catalog instead of adding a database solely for architectural appearance.

Extensibility

The core TechStackRecommender class is independent of the CLI and Streamlit interface, making it straightforward to integrate into another application later.


🔐 Security & Configuration

There are currently no secrets or API credentials in the project.

The repository includes .env.example as a safe configuration placeholder. The .gitignore also excludes .env and common local Python artifacts.


📋 Requirement Traceability

Assignment RequirementImplementationStatus
Tech Stack Recommenderapp/recommender.py
Input → Processing → OutputCLI + recommender pipeline
Minimum 3 user inputsapp/cli.py
Content-Based FilteringTechStackRecommender
Shared feature vocabularySingle fitted TF-IDF vectorizer
Vector mappingpreprocessing.py
TF-IDF weightingTfidfVectorizer
Avoid binary overlapWeighted TF-IDF features
Cosine similaritycosine_similarity()
Score available itemsrecommend()
Sort by relevanceDescending score sort
Top-N filtering.head(top_n)
Choice overload reductionTop-3 default
User cold startPopularity fallback
Item cold startMetadata-based scoring
Demonstration UIStreamlit
Automated teststests/test_recommender.py

📦 Deliverables

Core submission

  • ✅ Complete source code
  • ✅ Recommendation engine
  • ✅ Technology-stack dataset
  • ✅ Requirements file
  • ✅ README documentation
  • ✅ Automated tests
  • ✅ Working CLI demonstration

Recommended presentation material

  • Architecture diagram
  • Screenshot of the Streamlit interface
  • Screenshot of sample recommendations
  • Short explanation of TF-IDF
  • Short explanation of cosine similarity
  • Cold-start demonstration
  • Test output showing passing tests

🎓 Capstone Context

This repository implements the Tech Stack Recommender capstone following the supplied internship project specification and its progression from:

Passive Classification → Active Prediction

The final system converts structured and unstructured preference signals into an actionable ranked recommendation list while remaining transparent, deterministic, and easy to demonstrate.


👨‍💻 Author

Hadeed Jalani
AI / ML Internship Project — Tech Stack Recommender


⭐ If this project helped you, consider starring the repository.

Built with Python · TF-IDF · Cosine Similarity · Content-Based Recommendation

About

Content-based Tech Stack Recommendation Engine using TF-IDF and Cosine Similarity to rank personalized technology stacks from user preferences, with Top-N filtering and cold-start handling.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Universal Dark Mode - works on any site\n(function() {\n var enabled = true;\n \n function applyDarkMode() {\n if (!enabled) return;\n \n // Create style element if it doesn't exist\n var style = document.getElementById('universal-dark-mode-style');\n if (!style) {\n style = document.createElement('style');\n style.id = 'universal-dark-mode-style';\n document.head.appendChild(style);\n }\n \n // Dark mode CSS - inverts colors but preserves images/video\n style.textContent = '\n /* Invert everything except media */\n html {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #1a1a2e !important;\n }\n \n /* Restore images, videos, iframes, canvas */\n img, video, iframe, canvas, svg, picture, [style*=\"background-image\"] {\n filter: invert(1) hue-rotate(180deg) !important;\n }\n \n /* Preserve specific elements that should not be inverted */\n .no-dark-mode, .no-dark-mode *,\n [data-theme=\"light\"], [data-theme=\"light\"],\n .ace_editor, .ace_editor *,\n .CodeMirror, .CodeMirror *,\n .monaco-editor, .monaco-editor *,\n .markdown-body pre, .markdown-body pre *,\n .highlight, .highlight *,\n pre code, pre code * {\n filter: none !important;\n }\n \n /* Fix common UI elements */\n .modal, .popup, .dropdown-menu, .tooltip, .popover {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #2d2d44 !important;\n border-color: #444 !important;\n }\n \n /* Scrollbars */\n ::-webkit-scrollbar { background: #1a1a2e !important; }\n ::-webkit-scrollbar-thumb { background: #444 !important; }\n ::-webkit-scrollbar-thumb:hover { background: #555 !important; }\n \n /* Selection */\n ::selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ::-moz-selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ';\n }\n \n function removeDarkMode() {\n var style = document.getElementById('universal-dark-mode-style');\n if (style) style.remove();\n }\n \n // Toggle with Alt+Shift+D\n document.addEventListener('keydown', function(e) {\n if (e.altKey && e.shiftKey && e.key === 'D') {\n e.preventDefault();\n enabled = !enabled;\n if (enabled) {\n applyDarkMode();\n console.log('[Universal Dark Mode] Enabled');\n } else {\n removeDarkMode();\n console.log('[Universal Dark Mode] Disabled');\n }\n }\n });\n \n // Apply on load\n applyDarkMode();\n \n // Re-apply on dynamic content\n var observer = new MutationObserver(function(mutations) {\n if (enabled && !document.getElementById('universal-dark-mode-style')) {\n applyDarkMode();\n }\n });\n observer.observe(document.head, { childList: true });\n \n console.log('[Universal Dark Mode] Loaded - Press Alt+Shift+D to toggle');\n})();", "Universal Dark Mode"); } } catch(__e) { console.warn('[Userscript:Universal Dark Mode]', __e); } })(); })();
Skip to content

Latest commit

History

15 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

🧠 Tech Stack Recommender

Content-Based Recommendation Engine for Technology Stack Selection

TF-IDF · Cosine Similarity · Ranking · Top-N Filtering · Cold-Start Handling

Pythonscikit-learnStreamlitTests

Internship Capstone Project
A practical recommendation system that converts user preferences into ranked technology-stack recommendations using transparent, explainable machine-learning techniques.


✨ Project Overview

Tech Stack Recommender is a content-based recommendation system designed to answer a practical engineering question:

“Given what I want to build and the technologies I am interested in, which technology stack should I choose?”

The system compares a user's stated preferences against a catalog of technology stacks. It represents both sides in a shared TF-IDF feature space, calculates cosine similarity, ranks every candidate, and returns a concise Top-N recommendation list.

The implementation follows the capstone architecture shown in the project specification:

INPUT → PROCESSING → SCORING → SORTING → FILTERING → OUTPUT

It deliberately uses content-based filtering rather than collaborative filtering, because the assignment focuses on matching users directly to item attributes without requiring a historical user-interaction dataset.


🎯 Objectives

The project is built around the following objectives:

  • Capture explicit user preferences.
  • Require a minimum of three meaningful inputs.
  • Translate natural-language preferences into a numerical representation.
  • Represent users and technology stacks in the same feature space.
  • Use TF-IDF instead of simple binary 0/1 matching.
  • Measure relevance using cosine similarity.
  • Score the complete catalog.
  • Sort candidates by relevance.
  • Return a configurable Top-N list to reduce choice overload.
  • Handle the cold-start problem with a practical fallback.
  • Provide both a command-line implementation and a visual demonstration interface.

🏗️ System Architecture

 ┌─────────────────────────┐
│ USER │
│ │
│ Role / Domain │
│ Project Requirements │
│ Skills / Interests │
└────────────┬────────────┘
│
▼
┌─────────────────────────┐
│ INPUT │
│ Validate 3+ inputs │
└────────────┬────────────┘
│
▼
┌─────────────────────────┐
│ PREPROCESSING │
│ │
│ Normalize text │
│ Build user document │
└────────────┬────────────┘
│
┌───────────────────┴───────────────────┐
│ │
▼ ▼
┌──────────────────────┐ ┌──────────────────────┐
│ USER PROFILE │ │ ITEM CATALOG │
│ │ │ │
│ User document │ │ Tech-stack documents │
└──────────┬───────────┘ └──────────┬───────────┘
│ │
└───────────────────┬───────────────────┘
▼
┌─────────────────────────┐
│ TF-IDF │
│ │
│ Shared vocabulary │
│ Weighted feature space │
└────────────┬────────────┘
│
▼
┌─────────────────────────┐
│ COSINE SIMILARITY │
│ │
│ user vector ↔ item │
│ vector │
└────────────┬────────────┘
│
▼
┌─────────────────────────┐
│ SCORING │
│ Score every candidate │
└────────────┬────────────┘
│
▼
┌─────────────────────────┐
│ SORTING │
│ Score DESC │
└────────────┬────────────┘
│
▼
┌─────────────────────────┐
│ FILTERING │
│ Top-N │
└────────────┬────────────┘
│
▼
┌─────────────────────────┐
│ OUTPUT │
│ Ranked recommendations │
└─────────────────────────┘

🔬 Machine Learning Pipeline

1. Input

The application collects at least three user inputs:

InputExample
Target role / domaindata science
Project requirementsanalytics dashboard
Skills / interestsPython SQL cloud
Optional interestsmachine learning

2. Preprocessing

Text is normalized so that different surface forms can be compared consistently. The system removes irrelevant punctuation, normalizes case, and builds a single user-profile document.

Each catalog item is converted into a content document using:

  • Category
  • Frontend
  • Backend
  • Database
  • Deployment target
  • Technology tags
  • Description

3. TF-IDF Vectorization

Instead of treating every word as equally important, the system uses Term Frequency–Inverse Document Frequency.

TF(t,d) = count of term t in document d / total terms in d
IDF(t) = log(Total documents / documents containing t)
TF-IDF = TF × IDF

This gives more weight to descriptive terms and reduces the influence of generic words that appear throughout the catalog.

The same fitted vectorizer transforms both the catalog and user profile, ensuring a shared vocabulary space.

4. Similarity Scoring

The system uses cosine similarity:

 A · B
cosine(A,B) = ─────────────
||A|| ||B||

A score closer to 1.0 means stronger directional alignment between the user profile and the technology-stack content.

Cosine similarity is particularly appropriate here because recommendation quality should depend primarily on the orientation of preferences, rather than the absolute length of the text vectors.

5. Ranking

Every catalog item receives a similarity score. Candidates are then sorted in descending order:

Candidate A → 0.91
Candidate B → 0.84
Candidate C → 0.77
Candidate D → 0.45
Candidate E → 0.32

6. Top-N Filtering

Only the highest-scoring candidates are returned. The default is Top 3, directly reflecting the project's choice-overload objective.

0.91 ──┐
0.84 ──┤ ← Recommended
0.77 ──┘
0.45 ┐
0.32 ┘ ← Filtered out

🧊 Cold-Start Strategy

A recommendation system must still behave sensibly when little or no matching information exists.

User Cold Start

If a new user's terms contain no vocabulary known by the catalog, cosine similarity cannot provide meaningful personalized scores.

The system detects this condition and activates a global popularity fallback:

Unknown user profile
↓
No matching TF-IDF vocabulary
↓
Cold-start detected
↓
Popularity ranking
↓
Top-N recommendations

This implements the assignment's cold-start / popularity-fallback concept without introducing unnecessary collaborative-filtering infrastructure.

Item Cold Start

A new technology stack does not require historical user interactions. Once its metadata is added to the catalog, its content can be represented and compared against user preferences.

This is a key benefit of content-based recommendation.


🧩 Why Content-Based Filtering?

The assignment explicitly focuses on content-based filtering.

Collaborative Filtering

User A ── bought ── Item X
User B ── bought ── Item X
↓
infer similarity

This requires historical user behavior.

Content-Based Filtering

User preferences
↓
Feature representation
↓
Compare against item attributes
↓
Recommend similar items

This project uses the second approach because it directly matches the available information and remains effective for new items.


📁 Project Structure

Techstack-recommender/
│
├── app/
│ ├── __init__.py
│ ├── cli.py # Command-line application
│ ├── config.py # Paths and configuration
│ ├── data_loader.py # Dataset loading/validation
│ ├── preprocessing.py # Text normalization and documents
│ ├── recommender.py # TF-IDF + cosine recommendation engine
│ └── streamlit_app.py # Visual demonstration UI
│
├── data/
│ └── tech_stacks.csv # Technology-stack catalog
│
├── tests/
│ └── test_recommender.py # Core behavior tests
│
├── .env.example # Environment template
├── .gitignore # Git exclusions
├── README.md # Project documentation
├── requirements.txt # Python dependencies
└── run.py # Application entry point

🛠️ Technology Stack

TechnologyPurpose
PythonCore application language
pandasCatalog loading and tabular data handling
scikit-learnTF-IDF vectorization and cosine similarity
StreamlitOptional interactive demonstration UI
pytestAutomated testing
CSVLightweight, transparent catalog storage

Deliberately not used

The assignment does not require an LLM, RAG, vector database, authentication system, relational database, or external API. These technologies were intentionally excluded to keep the solution aligned with the specification and easy to demonstrate.


🚀 Getting Started

Prerequisites

  • Python 3.10+ recommended
  • pip
  • Git

No API key or external service account is required.

Windows PowerShell

python -m venv .venv
.\.venv\Scripts\Activate.ps1
python -m pip install --upgrade pip
pip install -r requirements.txt

macOS / Linux

python3 -m venv .venv
source .venv/bin/activate
python -m pip install --upgrade pip
pip install -r requirements.txt

▶️ Run the Application

CLI — Core Assignment Demonstration

python run.py

Example interaction:

=== CAPSTONE: TECH STACK RECOMMENDER ===
Content-based filtering | TF-IDF + cosine similarity
1) Target role/domain: data science
2) Project needs: analytics dashboard
3) Skills/interests: Python SQL cloud
4) Optional extra interests: machine learning

The system then returns the highest-scoring technology stacks.

Streamlit — Visual Demonstration

streamlit run app/streamlit_app.py

The Streamlit application is a presentation layer over the same recommendation engine. It does not contain a separate or simplified recommendation algorithm.


🧪 Testing

Run the automated test suite:

pytest -q

The suite covers the project's critical paths:

  • Minimum input validation
  • Content-based ranking
  • Cosine-score validity
  • Top-N filtering
  • Cold-start fallback

Expected result:

4 passed

📊 Example Recommendation Flow

For a user interested in:

Role: Data Science
Needs: Analytics Dashboard
Interests: Python, SQL, Cloud

the system might produce a result conceptually similar to:

RankRecommendationMatch
🥇 1Python Data Science StackHigh
🥈 2SQL Reporting StackHigh
🥉 3Data Engineering StackModerate

The exact scores are calculated dynamically from the TF-IDF representation of the catalog and user profile.


📚 Dataset

The included data/tech_stacks.csv catalog contains technology-stack candidates with attributes such as:

  • Frontend
  • Backend
  • Database
  • Deployment
  • Category
  • Tags
  • Description
  • Popularity

The catalog is intentionally human-readable so that the recommendation logic remains transparent and easy to explain during an internship presentation or supervisor review.

To add a new stack, add a row containing the required fields and restart the application.


🧱 Design Principles

Correctness first

The implementation follows the mathematical approach specified by the project rather than replacing it with a more complicated model.

Explainability

A recommendation can be traced through:

User input
↓
Normalized terms
↓
TF-IDF representation
↓
Cosine similarity
↓
Score
↓
Rank
↓
Top-N output

Simplicity

The system uses a local CSV catalog instead of adding a database solely for architectural appearance.

Extensibility

The core TechStackRecommender class is independent of the CLI and Streamlit interface, making it straightforward to integrate into another application later.


🔐 Security & Configuration

There are currently no secrets or API credentials in the project.

The repository includes .env.example as a safe configuration placeholder. The .gitignore also excludes .env and common local Python artifacts.


📋 Requirement Traceability

Assignment RequirementImplementationStatus
Tech Stack Recommenderapp/recommender.py
Input → Processing → OutputCLI + recommender pipeline
Minimum 3 user inputsapp/cli.py
Content-Based FilteringTechStackRecommender
Shared feature vocabularySingle fitted TF-IDF vectorizer
Vector mappingpreprocessing.py
TF-IDF weightingTfidfVectorizer
Avoid binary overlapWeighted TF-IDF features
Cosine similaritycosine_similarity()
Score available itemsrecommend()
Sort by relevanceDescending score sort
Top-N filtering.head(top_n)
Choice overload reductionTop-3 default
User cold startPopularity fallback
Item cold startMetadata-based scoring
Demonstration UIStreamlit
Automated teststests/test_recommender.py

📦 Deliverables

Core submission

  • ✅ Complete source code
  • ✅ Recommendation engine
  • ✅ Technology-stack dataset
  • ✅ Requirements file
  • ✅ README documentation
  • ✅ Automated tests
  • ✅ Working CLI demonstration

Recommended presentation material

  • Architecture diagram
  • Screenshot of the Streamlit interface
  • Screenshot of sample recommendations
  • Short explanation of TF-IDF
  • Short explanation of cosine similarity
  • Cold-start demonstration
  • Test output showing passing tests

🎓 Capstone Context

This repository implements the Tech Stack Recommender capstone following the supplied internship project specification and its progression from:

Passive Classification → Active Prediction

The final system converts structured and unstructured preference signals into an actionable ranked recommendation list while remaining transparent, deterministic, and easy to demonstrate.


👨‍💻 Author

Hadeed Jalani
AI / ML Internship Project — Tech Stack Recommender


⭐ If this project helped you, consider starring the repository.

Built with Python · TF-IDF · Cosine Similarity · Content-Based Recommendation

About

Content-based Tech Stack Recommendation Engine using TF-IDF and Cosine Similarity to rank personalized technology stacks from user preferences, with Top-N filtering and cold-start handling.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages