Scikit-network is an open-source python package for machine learning on graphs.
Each graph is represented by its adjacency matrix in the sparse CSR format of
An overview of the package is presented in this notebook.
To install scikit-network, run this command in your terminal:
$ pip install scikit-network
Alternately, you can download the sources from Github and run:
$ cd <scikit-network folder> $ python setup.py develop
Import scikit-network in Python:
import sknetwork as skn
A graph is represented by its adjacency matrix (square matrix). When the graph is bipartite, it can be represented by its biadjacency matrix (rectangular matrix). Check our tutorial for various ways of loading a graph (from a list of edges, a dataframe or a CSV file, for instance).
Each algorithm is represented as an object with a
from sknetwork.data import karate_club from sknetwork.clustering import Louvain adjacency = karate_club() algorithm = Louvain() algorithm.fit(adjacency)
More details are provided in this tutorial.