{"id":25819011,"url":"https://github.com/pngo1997/hyperlink-analysis-content-based-recommendation-system","last_synced_at":"2026-05-18T14:38:02.925Z","repository":{"id":275200769,"uuid":"925391658","full_name":"pngo1997/Hyperlink-Analysis-Content-Based-Recommendation-System","owner":"pngo1997","description":"Hyperlink Analysis using PageRank and HITS algorithms and simple Content-Based Recommendation System.","archived":false,"fork":false,"pushed_at":"2025-01-31T19:45:38.000Z","size":236,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-02T06:36:53.998Z","etag":null,"topics":["content-based-recommendation","hits-algorithm","knn","link-analysis","pagerank","python"],"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":"2025-01-31T19:40:47.000Z","updated_at":"2025-01-31T19:45:40.000Z","dependencies_parsed_at":"2025-01-31T20:41:48.942Z","dependency_job_id":null,"html_url":"https://github.com/pngo1997/Hyperlink-Analysis-Content-Based-Recommendation-System","commit_stats":null,"previous_names":["pngo1997/hyperlink-analysis-content-based-recommendation-system"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/pngo1997/Hyperlink-Analysis-Content-Based-Recommendation-System","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pngo1997%2FHyperlink-Analysis-Content-Based-Recommendation-System","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pngo1997%2FHyperlink-Analysis-Content-Based-Recommendation-System/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pngo1997%2FHyperlink-Analysis-Content-Based-Recommendation-System/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pngo1997%2FHyperlink-Analysis-Content-Based-Recommendation-System/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pngo1997","download_url":"https://codeload.github.com/pngo1997/Hyperlink-Analysis-Content-Based-Recommendation-System/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pngo1997%2FHyperlink-Analysis-Content-Based-Recommendation-System/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":281425557,"owners_count":26499031,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-28T02:00:06.022Z","response_time":60,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["content-based-recommendation","hits-algorithm","knn","link-analysis","pagerank","python"],"created_at":"2025-02-28T08:14:23.109Z","updated_at":"2025-10-28T10:40:42.746Z","avatar_url":"https://github.com/pngo1997.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🔗 Hyperlink Analysis \u0026 Content-Based Recommendation System  \r\n\r\n## 📜 Overview  \r\nThis project is divided into two main components:  \r\n1. **Hyperlink Analysis** using **PageRank and HITS algorithms**.  \r\n2. **Content-Based Recommendation System** using **K-Nearest Neighbors (KNN)** for song recommendations based on Spotify metadata.  \r\n\r\n📌 **Datasets Used**:  \r\n- **Hyperlink Analysis**: Simulated Web graph structure.  \r\n- **Content-Based Recommendation**:  \r\n  - `Spotify_Metadata.csv` – Song metadata.  \r\n  - `Spotify_Numeric.csv` – Song features (numeric vectors).  \r\n  - `Spotify_Users.txt` – User playlists.  \r\n\r\n📌 **Programming Language**: `Python 3`  \r\n📌 **Libraries Used**: `NumPy`, `pandas`, `networkx`, `scikit-learn`, `math`, `csv`  \r\n\r\n## 🔗 1️⃣ Hyperlink Analysis  \r\n### **1.1 PageRank Algorithm**  \r\n- **Input**: Web graph structure: A → {B, C} B → {C} C → {A}\r\n- **Computation**:  \r\n- **Damping Factor (α) = 0.15**  \r\n- **Three Iterations**  \r\n- PageRank scores computed **before \u0026 after normalization** at each step.  \r\n\r\n### **1.2 HITS Algorithm (Hubs \u0026 Authorities)**  \r\n- **Input**: Web graph structure (including Page D).  \r\n- **Computation**\r\n- **Three Iterations**  \r\n- Hub \u0026 Authority scores computed **before \u0026 after normalization** at each step.  \r\n\r\n📌 **Output**:  \r\n- PageRank \u0026 HITS scores printed at each iteration.  \r\n\r\n## 🎵 2️⃣ Content-Based Recommendation System  \r\n### **2.1 K-Nearest Neighbors (KNN) for Song Similarity**  \r\n- Function: `knn(item, Data, K)`  \r\n- **Input**:  \r\n  - `item` – Feature vector of a song.  \r\n  - `Data` – Song feature matrix (`Spotify_Numeric.csv`).  \r\n  - `K` – Number of nearest neighbors.  \r\n- **Computation**:  \r\n  - Compute **Cosine Similarity** between `item` and all songs in `Data`.  \r\n  - Return **K most similar songs** with metadata (`Spotify_Metadata.csv`).  \r\n\r\n📌 **Demonstration**:  \r\n- Run `knn()` for the given song vector: item = [0.8, 0.1, 0.7, 0.0, 0.5, 0.1, 0.5, 0.2, 0.0, 1.0, 0.1, 0.2, 0.7]\r\n- Print **top 10 similar songs**.  \r\n\r\n### **2.2 User-Based Song Recommendations**  \r\n- Function: `recommend(userID, Data, K)`  \r\n- **Input**:  \r\n  - `userID` – User index (0-based).  \r\n  - `Data` – Song feature matrix.  \r\n  - `K` – Number of recommendations.  \r\n- **Computation**:  \r\n  - Compute **user profile** as the **centroid vector** of liked songs.  \r\n  - Call `knn()` to get **top K song recommendations**.  \r\n  - **Exclude previously listened songs** from final recommendations.  \r\n\r\n📌 **Demonstration**:  \r\n- Run `recommend()` for:  \r\n- **User 3** (4th row in `Spotify_Users.txt`)  \r\n- **User 19** (20th row in `Spotify_Users.txt`)  \r\n- Print **top 20 recommendations** for each user.  \r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpngo1997%2Fhyperlink-analysis-content-based-recommendation-system","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpngo1997%2Fhyperlink-analysis-content-based-recommendation-system","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpngo1997%2Fhyperlink-analysis-content-based-recommendation-system/lists"}