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.4.tar.gz (29.3 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.4-py3-none-any.whl (34.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: groupmultiness-0.0.4.tar.gz
  • Upload date:
  • Size: 29.3 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.4.tar.gz
Algorithm Hash digest
SHA256 6997a264ebba61296248a57c9d0425afd3b8fe5ef6ae7e6ec79dfbc90f026e85
MD5 5e1bd98bef2fabf012b1a1553cbc31b0
BLAKE2b-256 53a8a90a5d61e5e884ca219bb9a091ec4a6d7d40cd6e7b2a2c74b3803c5c46c0

See more details on using hashes here.

File details

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

File metadata

  • Download URL: groupmultiness-0.0.4-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.4-py3-none-any.whl
Algorithm Hash digest
SHA256 d5860007adf6b931f62881baac54728123e9b2b5bbf2d74900db0cbb006b8d8c
MD5 f33ea0deeac74dba5654763b4e2b87da
BLAKE2b-256 7f4bde4c624a97f6f69ef6aaf450b63ceeba158a6c4cdb60135e0b396a57f4a4

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