Coder Social home page Coder Social logo

link_prediction_social_network's Introduction

Project: Link Prediction In Social Networks - People you may know! Team no. 24 Goal of the project: Given a snapshot of a social network, we want to infer which new interactions among its members are likely to occur in the near future based on network topology. Our goal is to understand which measures of “proximity” in a network lead to the most accurate link predictions.

The program to execute is link_prediction.py and the dataset is Facebook data which is an edge list which is present in the data folder.

Dependencies: igraph package Installing igraph for Python Assuming you are using Ubuntu and Anaconda distribution, if pip is not installed: conda install pip then: pip install python-igraph


Running instructions: python link_prediction.py <common_neighbors/jaccard/adamic_adar/preferential_attachment/katz/friendtns> data_file_path

Examples: python link_prediction.py common_neighbors data/facebook_combined.txt python link_prediction.py jaccard data/facebook_combined.txt python link_prediction.py adamic_adar data/facebook_combined.txt python link_prediction.py preferential_attachment data/facebook_combined.txt python link_prediction.py katz data/facebook_combined.txt python link_prediction.py friendtns data/facebook_combined.txt

(note: katz algorithm takes about 1 hr to run as it is a path based global method. Other methods take about 3-5 mins.)


Brief explanation of the program: We have implemented 6 methods for link prediction in social network. Common Neighbors, Jaccard’s Coefficient, Adamic/Adar, and Preferential Attachment are local based similiarity(proximity) measures. Katz is a global based (path based) similiarity measure. FriendTNS is a combination of local and global based similarity measures. Details about each method is explained in the ppt/slides.

The basic approach of the program is as follows:

  1. Read the data set which is an edge list (graph).
  2. Divide the edge list into train and test data (50 % each)
  3. Build an igraph on the training data and apply each algorithm based on the argument based to the script.
  4. A similarity matrix is calculated for every pair of nodes x,y in the graph.
  5. Use this similarity matrix to recommend top k nodes as "people you may know" for a target user present in the test set.

link_prediction_social_network's People

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.