Python package for link prediction
Project description
linkpred is a Python package for link prediction: given a network, linkpred provides a number of heuristics (known as predictors) that assess the likelihood of potential links in a future snapshot of the network.
While some predictors are fairly straightforward (e.g., if two people have a large number of mutual friends, it seems likely that eventually they will meet and become friends), others are more involved.
Example
>>> import linkpred >>> G = linkpred.read_network("examples/training.net") 11:49:00 - INFO - Reading file 'examples/training.net'... 11:49:00 - INFO - Successfully read file. >>> len(G) # number of nodes 632 >>> # We exclude edges already present, to predict only new links >>> simrank = linkpred.predictors.SimRank(G, excluded=G.edges()) >>> simrank_results = simrank.predict(c=0.5) >>> top = simrank_results.top(5) >>> for authors, score in top.items(): ... print authors, score ... Tomizawa, H - Fujigaki, Y 0.188686630053 Shirabe, M - Hayashi, T 0.143866427916 Garfield, E - Fuseler, EA 0.148097050146 Persson, O - Larsen, IM 0.138516589957 Vanleeuwen, TN - Noyons, ECM 0.185040358711
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
linkpred-0.1.zip
(31.7 kB
view details)
File details
Details for the file linkpred-0.1.zip
.
File metadata
- Download URL: linkpred-0.1.zip
- Upload date:
- Size: 31.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 83e25bfa5d851a801a33a77ceaf2fe5cad67bd8d65f07483ff4a3fd49607652d |
|
MD5 | eb8c439521773287a21ac5e29dabc376 |
|
BLAKE2b-256 | 49a1ffaf0edaae8b7c2d474e44a37f7c1b69cf462d6eef33199bb8e8f0bbff4f |