{"id":20556499,"url":"https://github.com/somjit101/facebook-friend-recommendation","last_synced_at":"2025-04-14T13:07:58.677Z","repository":{"id":179926690,"uuid":"389749996","full_name":"somjit101/Facebook-Friend-Recommendation","owner":"somjit101","description":"This is a friend recommendation systems which are used on social media platforms (e.g. Facebook, Instagram, Twitter) to suggest friends/new connections based on common interests, workplace, common friends etc. using Graph Mining techniques. Here, we are given a social graph, i.e. a graph structure where nodes are individuals on social media platforms and a directed edges (or 'links') indicates that one person 'follows' the other, or are 'friends' on social media. Now, the task is to predict newer edges to be offered as 'friend suggestions'. ","archived":false,"fork":false,"pushed_at":"2024-02-15T10:03:41.000Z","size":788,"stargazers_count":11,"open_issues_count":0,"forks_count":3,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-28T02:12:18.123Z","etag":null,"topics":["bagging-ensemble","boosting-ensemble","cross-validation","decision-tree-classifier","decision-trees","facebook-friend-recommendation","gradient-boosting","graph","graph-algorithms","graph-similarity","graph-theory","machine-learning","randomizedsearchcv","social-network","social-network-analysis","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/somjit101.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":"2021-07-26T19:44:34.000Z","updated_at":"2025-03-21T18:36:04.000Z","dependencies_parsed_at":"2024-02-15T11:25:21.559Z","dependency_job_id":null,"html_url":"https://github.com/somjit101/Facebook-Friend-Recommendation","commit_stats":null,"previous_names":["somjit101/facebook-friend-recommendation"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/somjit101%2FFacebook-Friend-Recommendation","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/somjit101%2FFacebook-Friend-Recommendation/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/somjit101%2FFacebook-Friend-Recommendation/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/somjit101%2FFacebook-Friend-Recommendation/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/somjit101","download_url":"https://codeload.github.com/somjit101/Facebook-Friend-Recommendation/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248886316,"owners_count":21177643,"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","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":["bagging-ensemble","boosting-ensemble","cross-validation","decision-tree-classifier","decision-trees","facebook-friend-recommendation","gradient-boosting","graph","graph-algorithms","graph-similarity","graph-theory","machine-learning","randomizedsearchcv","social-network","social-network-analysis","xgboost"],"created_at":"2024-11-16T03:28:30.487Z","updated_at":"2025-04-14T13:07:58.159Z","avatar_url":"https://github.com/somjit101.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Facebook-Friend-Recommendation\nThis is a friend recommendation system used on social media platforms (e.g. Facebook, Instagram, Twitter) to suggest friends/new connections based on common interests, workplace, common friends etc. using Graph Mining techniques. Here, we are given a social graph, i.e. a graph structure where nodes are individuals on social media platforms and a directed edges (or 'links') indicates that one person 'follows' the other, or are 'friends' on social media. Now, the task is to predict newer edges to be offered as 'friend suggestions'. \n\n\n## Problem Statement\n**Given a directed social graph, have to predict missing links to recommend users.** (Link Prediction in Graph)\n\n### Data Overview\n[Dataset Link](https://www.kaggle.com/c/FacebookRecruiting/data)\n\nTaken data from facebook's recruting challenge on [Kaggle](https://www.kaggle.com/c/FacebookRecruiting)\nData contains two columns source and destination eac edge in graph.\n* Data columns (total 2 columns):  \n    - source_node         int64  \n    - destination_node    int64  \n\n### Mapping the problem into supervised learning problem:\n* Generated training samples of good and bad links from given directed graph and for each link got some features like no of followers, is he followed back, page rank, katz score, adar index, some svd fetures of adj matrix, some weight features etc. and trained ml model based on these features to predict link. \n\n* Some reference papers and videos :  \n    - [The Link Prediction Problem for Social Networks](https://www.cs.cornell.edu/home/kleinber/link-pred.pdf)\n    - [New Perspectives and Methods in Link Prediction](https://www3.nd.edu/~dial/publications/lichtenwalter2010new.pdf)\n    - [Network Analysis Lecture](https://www.youtube.com/watch?v=2M77Hgy17cg)\n\n\n### Real-world Objectives and Constraints\n* No low-latency requirement.\n* Probability of prediction is useful to recommend ighest probability links\n\n### Performance metric for supervised learning:  \n* Both precision and recall is important so F1 score is good choice\n* Confusion matrix\n\n## Solution Approach\n\nDecision Tree based approached proved to be quite effective for this problem statement and since the number of features constructed is not too large, bagging and boosting approaches could be easily employed for high precision and easy training. \n\nHere are the details and performance metrics of the classifiers used : \n\n| **Model** | **No. of Base Learners** | **Max Depth of Base Learners** | **Training F1-score** | **Testing F1-score** |\n| --------- | ------------------------ | ------------------------------ | --------------------- | --------------------- |\n| Random Forest | 121                  | 14                             | 0.964                 | 0.921                |\n|    XGBoost    | 109                  | 10                             | 0.992                 | 0.926                 |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsomjit101%2Ffacebook-friend-recommendation","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsomjit101%2Ffacebook-friend-recommendation","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsomjit101%2Ffacebook-friend-recommendation/lists"}