QuaPy/quapy
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
..
classification add random_state to calibration classes, fix flaky calibration test 2026-07-20 11:16:43 +02:00
data Fix 10 correctness bugs and clean up warnings/logging in core library 2026-07-04 18:49:44 +02:00
method Add HistNetQ, a differentiable-histogram neural quantifier 2026-08-19 18:44:57 +02:00
tests Add HistNetQ, a differentiable-histogram neural quantifier 2026-08-19 18:44:57 +02:00
__init__.py Update version to 0.2.1.post1 2026-08-17 15:06:30 +02:00
error.py import fix 2026-07-17 16:53:27 +02:00
evaluation.py refactoring w/o labelled collection 2025-04-20 22:05:46 +02:00
functional.py update docs 2026-07-17 16:45:12 +02:00
model_selection.py Fix 10 correctness bugs and clean up warnings/logging in core library 2026-07-04 18:49:44 +02:00
plot.py Fix 10 correctness bugs and clean up warnings/logging in core library 2026-07-04 18:49:44 +02:00
protocol.py import fix 2026-07-17 16:53:27 +02:00
util.py added dataset for images 2026-07-02 18:21:35 +02:00