QuaPy/quapy/tests
Alejandro Moreo Fernandez 89548d3a8b Add GMNet, a Gaussian-mixture neural quantifier
Ports GMNet (from https://github.com/pglez84/gmnet) into quapy/method/_gmnet.py,
mirroring how HistNetQ was ported: dropping that repo's quantificationlib-backed
bag generators in favor of QuaPy's own sampling protocols, and adding geotorch
(now a 'neural' extra dependency) to keep the Gaussian layers' covariance matrices
positive-definite during training.

- GMNet represents each bag instance by its likelihood under one or more learned
  mixtures of Gaussians ("GM branches"), mean-pools these representations over the
  bag, and predicts prevalence from the result. Supports multiple stacked GM
  branches with an optional CKA-regularization term encouraging their latent
  representations to be dissimilar.
- Fixes two aspects of the original architecture that assumed a fixed, training-time
  bag_size baked into the network (a reshape step, and forward-hook-based activation
  capture for CKA): both are now computed from the actual input shape/plain
  attributes at forward time, so the model also works on predict()'s arbitrary-sized
  test samples, not just same-size bags.
- Factors the bag-based training loop shared by HistNetQ and GMNet (bag generation,
  fit/fit_from_samples, early stopping, LR scheduling, checkpointing, predict) out of
  _histnet.py into a new BagTrainedQuantifier base class in
  quapy/method/_neural_bags.py; HistNetQ's public API and behavior are unchanged.
- Aliased in meta.py (torch/geotorch-optional, mirroring HistNetQ/QuaNet) and
  registered in META_METHODS.
- Adds test_gmnet covering single-branch and multi-branch+CKA (via
  fit_from_samples/mix_bags) variants.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-08 14:47:03 +02:00
..
__init__.py integrating bayesian methods and related functionality, plus unit test refactor 2026-06-05 14:08:06 +02:00
_synthetic.py integrating bayesian methods and related functionality, plus unit test refactor 2026-06-05 14:08:06 +02:00
integration_datasets.py integrating bayesian methods and related functionality, plus unit test refactor 2026-06-05 14:08:06 +02:00
integration_methods.py integrating bayesian methods and related functionality, plus unit test refactor 2026-06-05 14:08:06 +02:00
test_base.py refactored unittests 2024-04-16 17:46:58 +02:00
test_bayesian_utils.py Add smoke tests for previously-untested modules, fix wasteful svmperf tmpdir creation 2026-07-04 19:05:06 +02:00
test_calibration.py add random_state to calibration classes, fix flaky calibration test 2026-07-20 11:16:43 +02:00
test_confidence.py improving doc manuals and added bonferroni parameter to interval construction 2026-07-06 12:11:24 +02:00
test_evaluation.py integrating bayesian methods and related functionality, plus unit test refactor 2026-06-05 14:08:06 +02:00
test_functional.py improving docs and new example for image datasets 2026-07-03 17:07:02 +02:00
test_hierarchy.py mergin and solving pytests 2025-10-06 12:13:10 +02:00
test_labelcollection.py adding documentation 2023-02-14 18:04:13 +01:00
test_methods.py Add GMNet, a Gaussian-mixture neural quantifier 2026-09-08 14:47:03 +02:00
test_modsel.py integrating bayesian methods and related functionality, plus unit test refactor 2026-06-05 14:08:06 +02:00
test_plot.py improving docs and new example for image datasets 2026-07-03 17:07:02 +02:00
test_protocols.py integrating bayesian methods and related functionality, plus unit test refactor 2026-06-05 14:08:06 +02:00
test_reader.py Add smoke tests for previously-untested modules, fix wasteful svmperf tmpdir creation 2026-07-04 19:05:06 +02:00
test_replicability.py integrating bayesian methods and related functionality, plus unit test refactor 2026-06-05 14:08:06 +02:00
test_threshold_optim.py Add smoke tests for previously-untested modules, fix wasteful svmperf tmpdir creation 2026-07-04 19:05:06 +02:00