Coder Social home page Coder Social logo

typing-monkeys / complex-network-link-prediction Goto Github PK

View Code? Open in Web Editor NEW
33.0 3.0 0.0 876 KB

A python library for link prediction in social networks

Home Page: https://pypi.org/project/complex-network-link-prediction/

License: MIT License

Python 93.35% Makefile 6.65%
complex-networks link-prediction social-network-analysis

complex-network-link-prediction's Introduction

Complex Network Link Prediction

License: MIT PyPi Documentation Downloads Wiki GitHubIssues GitTutorial

Complex Network Link Prediction is a python library that implements some of the main techniques and algorithms to perform link predictions.

logo

This library, implemented in python, allows you to use some of the main algorithms and methods to perform link predictions. It was designed to carry out these tasks in Complex Networks and, specifically, in Social Networks. Each method has its own specific documentation available on the official documentation page, where it is possible to see the required parameters and the output of the method itself.
The methods are distinguished by belonging to categories and subcategories, below is an example image with all the categories.

methods list

The speed of computation differs both from the type of method and from the input graph. However, for convention and efficiency, we have chosen to use the csr_matrix sparse matrix structure from the scipy library in each algorithm.

Install

pip install complex-network-link-prediction

How to use

import networkx as nx
import matplotlib.pyplot as plt
from cnlp.similarity_methods.local_similarity import common_neighbors
from cnlp.utils import nodes_to_indexes, get_top_predicted_link

G = nx.karate_club_graph()

name_index_map = list(nodes_to_indexes(G).items())

predicted_adj_matrix_common_neighbors = common_neighbors(G)

new_links = get_top_predicted_link(predicted_adj_matrix_common_neighbors, G.number_of_nodes(), pct_new_link=5, name_index_map=name_index_map, verbose=True)

You can also check this project to see a real case study for Social Network Analysis and link prediction, with the use of our Python Library.


Contribute 💥

As there are still many methods to implement and, at the same time, maintaining a library takes up a lot of time, we are always happy to accept new willing and able people to contribute and support our project.

If you want to contribute or you've found a bug, you can open a Pull Request.

Check this tutorial if you want to use our preferred Workflow 🦍 for developing.

Otherwise you can open a normal Pull Request using git and help us to make this project even better!

Help ❓

If you encounter any bug or you have some problem with this package you can open an issue to report it, we will resolve that asap.


Building From Source

Download the repository and run:

pip install -e .

Dependencies

If your system does not have some or all of this requirements they will be installed during the istallation of the library

  • networkx
  • scipy
  • numpy

References


Authors

cosci vescera fagiolo romani posta
Cristian Cosci 🐔 Nicolò Vescera 🦧 Fabrizio Fagiolo 🐛 Tommaso Romani 🦍 Nicolò Posta 🐒

complex-network-link-prediction's People

Contributors

cristiancosci avatar f-a-b-r-i-z-i-o avatar ncvescera avatar nicoloposta avatar tommasoromani avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

complex-network-link-prediction's Issues

Rivedere sistema di import

Probabilmente c'è un problema con gli import all'interno della libreria:

  • la cartella utils dovrebbe trovarsi all'interno di social_network_link_prediction
  • la cartella utils andrebbe rinominata in __utils o qualcosa di simile per sottolineare l'utilizzo solo all'interno della libreria
  • andrebbero utilizzati solo import relativi

Code Docs

  • Aggiungere docstrings al codice
    • Dim Reduction
    • Other Methods
    • Sim Methods
      • Global
      • Local
      • Quasi local
    • Utils
  • Generare la documentazione

Testing Scikit-network problem

C'è un problema con la libreria che implementa molti metodi, scikit-network: hanno rimosso la maggior parte delle implementazioni dei metodi di similarità (similarity methods/local similarity) 🙃.

Una possibile soluzione sarebbe quella di forzare come requirement (per i tests) la versione v0.28.3.

Setup monkeflow Workflow

  • Inizializzare la repo per introdurre il monkeflow Workflow
  • Pensare a possibili restrizioni di sicurezza per i branch
  • Test automatici prima del merge di una PR (Actions) ?

LP3

Modificare l'indice con la radice del grado del nodo con la radice del grado xy.
Grado -> k
Sqrt (kx, ky), ku kv

SRC ?

Osservando altre librerie, molte non hanno la cartella src/ ma hanno direttamente una cartella con il nome della libreria.

Potremmo pensare di utilizzare anche noi questa organizzazione che potrebbe permetterci di effettuare test ed altre operazioni in maniera più semplice.
Per quanto riguarda Pypi potrebbe recare alcuni problemi ?
A livello logico è corretto ?

Makefile

Implementare i seguenti comandi all'interno del Makefile:

  • Check requirements
  • Installing commands:
    • install (libreria nel sistema)
    • install-dev
    • install-test
    • install-doc
  • Clean commands:
    • clean-build
    • clean-docs
    • clean-env
    • clean (all)
  • Running commands:
    • build
    • test
    • docs
  • Publish commands:
    • release test
    • release production

Sim Rank

Correggere parametro alpha nelle formule matematiche e rinominarlo con C

Adamic Adar fix

Fixare adamic adar sostituendo il logaritmo e capire perchè con funzione (monotona decrescente?)

MI

Cambiare lingua it-en

Cambio Nome

Ci sono alcuni problemi relativi cambio del nome della libreria:

  • Nel file di configurazione di (setup.py) il link alla repo è cambiato e non viene più mostrato in PyPi
  • I link alle immagini sono cambiate, ma queste sembrano ancora essere mostrate correttamente sia su Github che su PyPi
  • Ricontrollare tutti i link

Wiki

Scrivere la Wiki.

  • Sezione utilizzo monkeflow
  • Sezione prototipo standard di funzioni da implementare
  • Sezione su utilizzo di Pypl
  • Guida al Makefile

Note: usare pydoc3 e pyment per generare la documentazione e hostare il risultato in github-pages

NMF

Cambiare valore di default

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.