Giter Club home page Giter Club logo

social-network-links-prediction's Introduction

Social-Network-Links-Prediction

Tongji Data Structure Project - Social Network Links Prediction

video

Disclaimer

Languages & Packages & Frameworks

  • javascript, python(+ jupyter notebook)
  • echarts, bootstrap, ajax, networkx
  • Django

Environment Setup

create virtual environment in conda (env name: social_network)

cd network_demo
conda env create -f environment.yaml
conda activate social_network

Quick Start

An overview Overview

enter the folder with manage.py then start service

cd network_demo
python manage.py runserver

Initial view

scale background graph by scrolling click on categories at the top of the page Scaling & category shifting

features implemented in echarts

click on cards in the left sidebar, profile displayed on the right sidebar detailed info

select Algorithms (default to Intersection) and Mode (default to All Users) at the bottom of Detailed infomation select

All user mode All User mode

target user mode target mode

wrong input get warnings warnings

manage your page with control island (UDCP Buttons) manage your page

upload your JSON file at Custom Upload your file

new graph loaded new graph

return to Defalut graph at Default default

Generate Dataset

data generator in folder data\eupho_dataset\dataset_generator.ipynb

As for the name eupho, I initially wanted to build up a network with the purpose of displaying sophisticated interpersonal relationships in Animation Series Sound! Euphonium. And that's exactly the reason why I tested Japanese names in my demo dataset. The organizations in this network could be schools, clubs, companies or even social groups and person nodes are individuals (characters in the anime :) )

Documenting the profiles of characters in Sound! Euphonium is really time-consuming which is not feasible, and actually unnecessary, for a 2-week project. Therefore, I got some random names from name generators on Google. (But I got names of Kituji High School Concert Band which are listed in the file data\eupho_dataset\dataset_generator.ipynb from Season 1 to Season 2.5)

Prediction Algorithms

$C(u, v)$ denotes the prediction score between individual $u$ and $v$.

(Weighted) Intersection

$C(u, v) = \sum_{k \in \text{categories}} w_{u, k} \cdot N_{u, v, k}$

Intersection over Union

$C(u, v) = \frac{|\Gamma(u) \cap \Gamma(v)|}{|\Gamma(u) \cup \Gamma(v)|}$

where $\Gamma(u)$ denotes the set of neighbors of $u$, $\Gamma(v)$ denotes the set of neighbors of $v$

Bonus: individual social habits considered. A wide range of friends means less strengthed friendship while deeper friendship expected for individuals who have fewer connections with others. The node would earn higher score if it had a few connections but still shared many nodes with the target.

Adamic-Adar Index

Official Networkx Implementation

$C(u, v) = \sum_{w \in \Gamma(u) \cap \Gamma(v)} \frac{1}{\log |\Gamma(w)|}$

where $\Gamma(u)$ denotes the set of neighbors of $u$. This index leads to zero-division for nodes only connected via self-loops. It is intended to be used when no self-loops are present. .

Common Neighbor Centrality (CCPA Score)

Official Networkx Implementation

$C(u, v) = \alpha \cdot (|\Gamma (u){\cap }^{}\Gamma (v)|)+(1-\alpha )\cdot \frac{N}{{d}_{uv}}, \quad \alpha \in [0, 1]$

where $\Gamma(u)$ denotes the set of neighbors of $u$, $\Gamma(v)$ denotes the set of neighbors of $v$, $\alpha$ is parameter varies between $[0, 1]$ and default to 0.8, $N$ denotes total number of nodes in the Graph and $d_{u, v}$ denotes shortest distance between $u$ and $v$ .

social-network-links-prediction's People

Contributors

nozom1466 avatar

Stargazers

JK Flip-Flop avatar  avatar  avatar  avatar Coinisi avatar  avatar  avatar

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.