Skip to main content

Fast python implementation of the egosplitting framework for overlapping clustering using sknetwork.

Project description

EgoSplit-sknetwork

This package provides a fast and flexible implementation of the egosplitting community detection paradigm for detecting overlapping communities. For details and motivation of the algorithm, please see the paper below. The reference implementation is available here.

Alessandro Epasto, Silvio Lattanzi, and Renato Paes Leme. 2017. Ego-Splitting Framework: from Non-Overlapping to Overlapping Clusters. In Proceedings of the 23rd ACM SIGKDD International Conference on Knowledge Discovery and Data Mining (KDD '17). Association for Computing Machinery, New York, NY, USA, 145-154. https://doi.org/10.1145/3097983.3098054

Installation

Currently you can install this package by cloning this repository and installing locally.

git clone https://github.com/ryandewolfe33/egosplit-sknetwork.git
cd egosplit-sknetwork
pip install .

Example

import sknetwork as sn
from egosplit_sknetwork import EgoSplit

g = sn.data.toy_graphs.karate_club()
egosplit = EgoSplit()
labels = egosplit.fit_predict(g)

By default the algorithm uses Propagation Clustering for local clustering and Leiden for global clustering. To pass other clustering algorithms to egosplit, they must be initialized in advace and passed as parameters. The algorithm accepts any subclass of sknetwork.clustering.BaseClustering for either local_clustering (used to cluster the egonets) or global_clustering (used to cluster the persona graph).

high_res_clusterer = sn.clustering.Louvain(resolution=5, random_state=42)
egosplit = EgoSplit(local_clustering='PC', global_clustering=high_res_clusterer)
egosplit.fit(g)
labels = egosplit.labels_

Labels is a sparse matrix with dimensions (n_labels, n_vertices), where labels[i,j] = True if vertex j is in cluster i.

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

egosplit_sknetwork-0.0.4.tar.gz (6.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

egosplit_sknetwork-0.0.4-py3-none-any.whl (6.6 kB view details)

Uploaded Python 3

File details

Details for the file egosplit_sknetwork-0.0.4.tar.gz.

File metadata

  • Download URL: egosplit_sknetwork-0.0.4.tar.gz
  • Upload date:
  • Size: 6.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.0

File hashes

Hashes for egosplit_sknetwork-0.0.4.tar.gz
Algorithm Hash digest
SHA256 8074a3746a6461b9bb39a3c8b781f5827ea427770d79f2b3bc9596d0b88c428c
MD5 3df5e4d0a6bc6b79ce7b46d554d45c14
BLAKE2b-256 2f2a4785bc85879fea7beca61f5446a630766dcbc8e9d1be784f5b1c8404c61c

See more details on using hashes here.

File details

Details for the file egosplit_sknetwork-0.0.4-py3-none-any.whl.

File metadata

File hashes

Hashes for egosplit_sknetwork-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 41b038b8517ddd601259095a7d35800c4d0bfe3fd9bbb360214e5a52e8627cec
MD5 9381bd19b7e9c39e7345e97f089c3f43
BLAKE2b-256 96d554b55b4b38ca966f8e4ae5f68f6fcbb628c6de1c5fe85d90cb93ddcbc6f9

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page