Skip to main content

gcisens

CI PyPI Python Documentation Status License

gcisens is a Python library for analysing how individual criteria influence the results of MCDA models. It uses Sobol' sensitivity analysis to compare declared criteria weights with their actual impact, helping identify hidden nonlinear effects and interactions in ESP-COMET and ESP-SPOTIS models.

Documentation: Read the Docs

PyPI: gcisens

Features

Analysis

  • Global sensitivity analysis — calculates first-order (S1), total-order (ST) and pairwise interaction (S2) Sobol' indices with confidence intervals.
  • Global and local criterion importance — estimates the model's overall criterion weights and can examine importance around a selected reference point.
  • Ranking comparison — compares rankings produced by criterion weights, S1 and ST, including Spearman rank correlations.

Diagnosis and validation

  • Sensitivity Discrepancy Report — identifies hidden criterion influence, interaction dominance, moderate discrepancies and agreement between weights and observed sensitivity.
  • External validation — evaluates model scores against known labels using group differences and lift at selected cut-offs.
  • Configuration comparison — presents results from multiple model setups side by side.

Visualisation and reporting

  • Visual analysis — includes index charts, S2 interaction heatmaps, ranking flows, decision surfaces with ESPs and score distributions.
  • Reusable outputs — exports results to CSV, LaTeX and standalone HTML reports.

Analysis pipeline

The workflow combines gcisens code with established implementations from SALib, pymcdm and scikit-learn.

Step Function Implementation
Complete workflow SobolStudy.run(reference_point=None) Coordinates sampling, model evaluation, weight analysis, ranking and diagnosis in gcisens
Sobol' indices sobol_analysis(adapter.scores, adapter.bounds, names, ...) Wraps SALib's Sobol or Saltelli sampler and Sobol analyser to calculate S1, ST and S2 indices with confidence intervals
Global weights comet_global_weights(model, bounds) Builds the COMET characteristic-object grid and uses scikit-learn's LinearRegression to estimate criterion weights
Local weights adapter.local_weights(point, ...) Uses pymcdm's get_local_weights for COMET and the gcisens range-sweep implementation for SPOTIS or custom models
Discrepancy diagnosis classify(criteria_names, weights, S1, ST, ...) Applies the gcisens classification rules configured through DiagnosisThresholds

Supported models

The COMET, SPOTIS and ESPExpert implementations are provided by pymcdm and re-exported by gcisens for a consistent interface.

Model Weight handling Notes
esp_comet(esps, bounds) or any COMET estimated by regression supports one or multiple ESPs
esp_spotis(esp, bounds, weights) or any SPOTIS supplied with the model uses distance scores, where lower means closer
any callable f(X) -> scores optional enables sensitivity analysis of custom scoring models

Installation

You can install gcisens from PyPI using pip:

pip install gcisens

Quick start

The example below builds an ESP-COMET model with three criteria and one expected solution point, runs a Sobol' sensitivity analysis and shows how to inspect and export the results:

import numpy as np
from gcisens import esp_comet, SobolStudy

bounds = np.array([[18, 60], [1, 29], [1009, 19999]], float)
esps = np.array([[25, 25, 2000]])          # expected solution point(s)

model = esp_comet(esps=esps, bounds=bounds,
                  criteria_names=["Age", "Distance", "Income"])

result = SobolStudy(model, n_samples=2048, seed=42).run()

result.table()        # weights, S1, ST, ranks, category per criterion
result.diagnosis()    # Sensitivity Discrepancy Report
result.summary()      # R², ΣS1, ΣST, Spearman correlations
result.plot_indices() # w vs S1 vs ST bar chart
result.to_latex()     # publication-ready table

Alternatively, the model can be constructed directly with the re-exported pymcdm classes and passed to SobolStudy:

from gcisens import COMET, ESPExpert, SobolStudy

expert = ESPExpert(esps=esps, bounds=bounds)
model = COMET(expert.make_cvalues_psi(), expert)
result = SobolStudy(model, bounds=bounds).run()

Examples

The repository includes ready-to-run examples based on the bundled IBM HR Attrition dataset:

  • article_esp_comet.py - analyses multiple ESP-COMET configurations and generates CSV, LaTeX and HTML reports.
  • esp_spotis_demo.py - compares ESP-SPOTIS with ESP-COMET using the same expected solution point.

References

License

gcisens is available under the MIT License. You may use, modify and distribute it under its terms. See the LICENSE file for details.

Metadata

Release files for gcisens 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for gcisens 0.1.1
File Size Uploaded
gcisens-0.1.1.tar.gz 82.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for gcisens 0.1.1
File Interpreter ABI Platform
gcisens-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 112.6 kB

Release files / gcisens-0.1.1.tar.gz

Download URL gcisens-0.1.1.tar.gz
Size 82.8 kB
Tags Source
SHA-256 checksum
How to use checksums
03688319c4dd658e4fc25c8cc11189954d89c70cec787cc78fd43fe46581ce40
BLAKE2b-256 checksum
How to use checksums
cb99f9824bcbb7cbd99bcc5108013a59aaf515e50a0b1bb6150215fd31528fdb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 28, 2026.

Transparency log

Release files / gcisens-0.1.1-py3-none-any.whl

Download URL gcisens-0.1.1-py3-none-any.whl
Size 29.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4bf6c67edd10824ffaf7a5f3575216f04f6075c65bc41ec60d218f88ab562949
BLAKE2b-256 checksum
How to use checksums
f66027ce6ce4e1f2ead5fdeaf425dd44767132d67f1be78c98b7a6bcc2d275dd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 28, 2026.

Transparency log

Release history Release notifications | RSS feed

0.1.2

2 release files

This release

0.1.1 This release

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page