QuaPy/quapy/tests
Alejandro Moreo Fernandez 24719ed0af Add HistNetQ, a differentiable-histogram neural quantifier
Ports the "hard" histogram variant of HistNetQ (from
https://github.com/pglez84/histnetq) into quapy/method/_histnet.py, dropping
that repo's quantificationlib-backed bag generators in favor of QuaPy's own
sampling protocols (UPP by default). Implemented as a BaseQuantifier,
alongside QuaNet, since it trains end-to-end on samples of known prevalence
rather than following the classify-then-aggregate pattern.

- HistNetQ.fit(X, y): resamples training/validation bags from a
  LabelledCollection via a configurable protocol (UPP by default; fresh
  random bags each training epoch, a fixed reproducible sequence for
  validation).
- HistNetQ.fit_from_samples(protocol, val_protocol=None, mix_bags=False):
  trains directly from a protocol that already yields bags (e.g. LeQua's
  SamplesFromDir), with an optional mixer to synthesize extra
  intermediate-prevalence bags from the given ones.
- Aliased in meta.py (torch-optional, mirroring the existing QuaNet guard)
  and registered in META_METHODS.
- Adds test_histnetq covering both entry points on binary and multiclass
  synthetic data.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-19 18:44:57 +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 HistNetQ, a differentiable-histogram neural quantifier 2026-08-19 18:44:57 +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