Introduction to the sknet Package

Learn about the sknet Python package, a package focused on machine learning applications in complex networks.

The sknet (or scikit-net) package is a Python library that provides machine learning algorithms for complex networks. Let’s learn about how the package is organized so we can use it to apply a different community detection algorithm to our networks. It’s important to notice that community detection can be considered a machine learning task in the same way that a clustering algorithm is.

Sknet general organization

The library is roughly organized into four different sections:

  • Network construction: The methods available here are responsible for creating networks from tabular datasets and time series and vice-versa. This allows us to apply graph-specific machine learning tasks to different types of data.

  • Supervised methods: These are the methods such as classification and regression algorithms are present here. They use available labels to predict new ones.

  • Unsupervised methods: These are the methods that don’t require the availability of labels. Examples include community detection and anomaly detection algorithms.

  • Semi-supervised methods: These are the methods that use a few available labels. These methods and lots of unlabelled data are available here, usually used for classification.

The sknet package is scikit-learn (a machine learning library for Python) compatible and also NetworkX compatible.

Creating a network from tabular data

Let’s explore one of the main functions of the library: creating a network from tabular data. For that, we’re going to use the famous iris dataset that’s freely available in scikit-learn. Let’s first take a look at what the dataset looks like:

Get hands-on with 1200+ tech skills courses.