Skip to main content

GroupMultiNeSS package

Project description

GroupMultiNeSS

GroupMultiNeSS is a package for statistical modeling of multilayer networks. It implements multiple approaches allowing to extract shared, group, and individual latent structures from a collection of networks on a shared set of nodes. Specifically, it contains the implementation of fitting and sampling procedures for the following models:

  • GroupMultiNeSS [Kagan et al. (2025)] - likelihood based approach with nuclear norm penalization, accounts for the additional group latent structure
  • MultiNeSS [MacDonald et al. (2021)] - likelihood based approach with nuclear norm penalization
  • MultiNeSS [Tian et al. (2024)] - likelihood based approach with pre-estimation of latent ranks via Shared Space Hunting algorithm
  • COSIE [Arroyo et al. (2020)] - spectral-based Multiple Adjacency Spectral Embedding algorithm

Installation

Use the package manager pip to install GroupMultiNeSS.

pip install GroupMultiNeSS

Usage

# Imports
import numpy as np
from GroupMultiNeSS.group_multiness import GroupMultiNeSS
from GroupMultiNeSS.data_generation import GroupLatentPositionGenerator
from GroupMultiNeSS.utils import make_group_indices


# Sample true latent positions and group indices
n, M, K = 200, 16, 4
group_props = np.ones(K) / K  # make ballanced groups
group_indices = make_group_indices(group_props, M)

lpg = GroupLatentPositionGenerator(n_nodes=n, n_layers=M, group_indices=group_indices)
lpg.generate(random_seed=1)

As, Ps_true, S_true, Qs_true, Rs_true = lpg.As, lpg.Ps, lpg.S, lpg.Qs, lpg.Rs

# Fit GroupMultiNeSS model and compute the relative errors with ground-truth
group_multiness = GroupMultiNeSS(group_indices, n_jobs=K)
group_multiness.fit(As, lr=0.8)
print(group_multiness.make_final_error_report(S_true, Qs_true, Rs_true, Ps=Ps_true))

# {'Shared component': 0.026, 'Group components': 0.051, 'Individual components': 0.122, 'Ps': 0.077}

License

MIT License

Copyright (c) 2025 Alexander Kagan

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

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

groupmultiness-0.0.5.tar.gz (29.4 kB view details)

Uploaded Source

Built Distribution

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

groupmultiness-0.0.5-py3-none-any.whl (34.8 kB view details)

Uploaded Python 3

File details

Details for the file groupmultiness-0.0.5.tar.gz.

File metadata

  • Download URL: groupmultiness-0.0.5.tar.gz
  • Upload date:
  • Size: 29.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for groupmultiness-0.0.5.tar.gz
Algorithm Hash digest
SHA256 bbb3ee5b820472c5e4deb0895bae87eb7092f1aaac34c610d808727fe4949405
MD5 051995ba6e4985fd0a726bc79b990836
BLAKE2b-256 ce0d4070accd98693a98db74a7e6cd7d8e89070f4da1270bf0ae9dc3c058dc01

See more details on using hashes here.

File details

Details for the file groupmultiness-0.0.5-py3-none-any.whl.

File metadata

  • Download URL: groupmultiness-0.0.5-py3-none-any.whl
  • Upload date:
  • Size: 34.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for groupmultiness-0.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 91629413ba954b463e228e9f253eb6f5378db6117e29e2615370c06952e0587c
MD5 d366e4ad701e4315798db61a9b7703fb
BLAKE2b-256 e0d12b588fdd18c12ff8f246f002f4013b0bebfcf7028051d5135dc94dbf360f

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