{"id":25819025,"url":"https://github.com/pngo1997/learning-to-rank-algorithm","last_synced_at":"2026-05-18T15:31:17.110Z","repository":{"id":229218918,"uuid":"776154739","full_name":"pngo1997/Learning-to-Rank-Algorithm","owner":"pngo1997","description":"Builds a ranking model to predict the relevance score for query-product pairs in HomeDepot’s product search.","archived":false,"fork":false,"pushed_at":"2025-01-31T19:36:48.000Z","size":20662,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-02T10:13:19.964Z","etag":null,"topics":["feature-engineering","information-retrieval","inverted-index","learning-to-rank","linear-regression","mse","neural-network","point-wise","python","r-squared","ranking-algorithm","support-vector-regression","text-processing","tf-idf","xgboost"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pngo1997.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-03-22T19:43:41.000Z","updated_at":"2025-03-13T14:36:23.000Z","dependencies_parsed_at":"2025-01-31T20:34:58.883Z","dependency_job_id":null,"html_url":"https://github.com/pngo1997/Learning-to-Rank-Algorithm","commit_stats":null,"previous_names":["pngo1997/letor","pngo1997/learning-to-rank-algorithm"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/pngo1997/Learning-to-Rank-Algorithm","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pngo1997%2FLearning-to-Rank-Algorithm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pngo1997%2FLearning-to-Rank-Algorithm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pngo1997%2FLearning-to-Rank-Algorithm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pngo1997%2FLearning-to-Rank-Algorithm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pngo1997","download_url":"https://codeload.github.com/pngo1997/Learning-to-Rank-Algorithm/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pngo1997%2FLearning-to-Rank-Algorithm/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33182690,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-18T09:27:30.708Z","status":"ssl_error","status_checked_at":"2026-05-18T09:27:28.300Z","response_time":71,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["feature-engineering","information-retrieval","inverted-index","learning-to-rank","linear-regression","mse","neural-network","point-wise","python","r-squared","ranking-algorithm","support-vector-regression","text-processing","tf-idf","xgboost"],"created_at":"2025-02-28T08:14:24.895Z","updated_at":"2026-05-18T15:31:17.092Z","avatar_url":"https://github.com/pngo1997.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🛍️ HomeDepot Product Search Relevance Prediction  \n\n## 📜 Overview  \nThis project builds a **ranking model** to predict the **relevance score** for **query-product pairs** in HomeDepot’s product search. Using **Learning to Rank (LTR)**, we apply a **Pointwise Approach** to train a regression model based on **text similarity features** between the user query and product information.  \n\n📌 **Note**: \nProduct description dataset is very large. Please contact me if you want to use it. \n\n📌 **Dataset**:  \n- **Train Set (`train_new.csv`)** – Query-product pairs with **ground-truth relevance scores**.  \n- **Test Set (`test_new.csv`)** – Query-product pairs for **prediction**.  \n- **Product Descriptions (`product_descriptions_new.csv`)** – Additional product details.  \n- **Product Attributes (`attributes_new.csv`)** – Additional structured product attributes.  \n\n📌 **Goal**:  \n1. Compute **text similarity** between `search_term` and:  \n   - `product_title`  \n   - `product_description`  \n   - `product_attributes`  \n2. Generate **feature vectors** for training and testing.  \n3. Train a **machine learning model** to predict **relevance scores**.  \n4. Evaluate performance using **Mean Squared Error (MSE) \u0026 R² score**.  \n\n📌 **Programming Language**: `Python 3`  \n📌 **Libraries Used**: `pandas`, `scikit-learn`, `nltk`, `numpy`, `scipy`, `XGBoost`  \n\n## 🚀 Approach  \n\n### **1️⃣ Data Preprocessing**  \n- **Text Cleaning** (e.g., spelling correction, numerical normalization).  \n- **Tokenization \u0026 Stopword Removal** using `NLTK`.  \n- **TF-IDF Vectorization** for product details.  \n\n### **2️⃣ Feature Engineering**  \n- Compute **Cosine Similarity** between `search_term` and:  \n  - `product_title`  \n  - `product_description`  \n  - `product_attributes`  \n- Compute **additional similarity measures** (e.g., **Jaccard, Dice Coefficient, Overlap**).  \n- Minimum **6 similarity features** for each query-product pair.  \n\n### **3️⃣ Model Training \u0026 Evaluation**  \n- Train models using **Supervised Learning Algorithms**:  \n  - **Linear Regression**  \n  - **Support Vector Regressor (SVR)**  \n  - **XGBoost Regressor**  \n  - **Neural Networks**  \n- Evaluate model performance using:  \n  - **Mean Squared Error (MSE)**  \n  - **R² Score**  \n\n### **4️⃣ Predictions on Test Data**  \n- Generate **predicted relevance scores** for `test_new.csv`.  \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpngo1997%2Flearning-to-rank-algorithm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpngo1997%2Flearning-to-rank-algorithm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpngo1997%2Flearning-to-rank-algorithm/lists"}