multivariate-probit 0.3.4__tar.gz → 0.3.5__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (64) hide show
  1. {multivariate_probit-0.3.4 → multivariate_probit-0.3.5}/CITATION.cff +2 -2
  2. {multivariate_probit-0.3.4 → multivariate_probit-0.3.5}/PKG-INFO +1 -1
  3. {multivariate_probit-0.3.4 → multivariate_probit-0.3.5}/docs/api.md +1 -1
  4. {multivariate_probit-0.3.4 → multivariate_probit-0.3.5}/pyproject.toml +1 -1
  5. {multivariate_probit-0.3.4 → multivariate_probit-0.3.5}/src/multivariate_probit/__init__.py +1 -1
  6. {multivariate_probit-0.3.4 → multivariate_probit-0.3.5}/src/multivariate_probit/model.py +10 -3
  7. {multivariate_probit-0.3.4 → multivariate_probit-0.3.5}/tests/test_evaluators.py +20 -1
  8. {multivariate_probit-0.3.4 → multivariate_probit-0.3.5}/.github/ISSUE_TEMPLATE/use-case.md +0 -0
  9. {multivariate_probit-0.3.4 → multivariate_probit-0.3.5}/.gitignore +0 -0
  10. {multivariate_probit-0.3.4 → multivariate_probit-0.3.5}/LICENSE +0 -0
  11. {multivariate_probit-0.3.4 → multivariate_probit-0.3.5}/README.md +0 -0
  12. {multivariate_probit-0.3.4 → multivariate_probit-0.3.5}/benchmarks/bench.py +0 -0
  13. {multivariate_probit-0.3.4 → multivariate_probit-0.3.5}/benchmarks/benchmarks.ipynb +0 -0
  14. {multivariate_probit-0.3.4 → multivariate_probit-0.3.5}/benchmarks/ref_d12_n3000_100_rho0.4_s0.npz +0 -0
  15. {multivariate_probit-0.3.4 → multivariate_probit-0.3.5}/benchmarks/ref_d16_n3000_100_rho0.4_s0.npz +0 -0
  16. {multivariate_probit-0.3.4 → multivariate_probit-0.3.5}/benchmarks/ref_d3_n3000_100_rho0.4_s0.npz +0 -0
  17. {multivariate_probit-0.3.4 → multivariate_probit-0.3.5}/benchmarks/ref_d5_n3000_100_rho0.4_s0.npz +0 -0
  18. {multivariate_probit-0.3.4 → multivariate_probit-0.3.5}/benchmarks/ref_d8_n3000_100_rho0.4_s0.npz +0 -0
  19. {multivariate_probit-0.3.4 → multivariate_probit-0.3.5}/benchmarks/ref_pairwise_d12_n3000_100_s0.npz +0 -0
  20. {multivariate_probit-0.3.4 → multivariate_probit-0.3.5}/benchmarks/ref_pairwise_d16_n3000_100_s0.npz +0 -0
  21. {multivariate_probit-0.3.4 → multivariate_probit-0.3.5}/benchmarks/ref_pairwise_d3_n3000_100_s0.npz +0 -0
  22. {multivariate_probit-0.3.4 → multivariate_probit-0.3.5}/benchmarks/ref_pairwise_d5_n3000_100_s0.npz +0 -0
  23. {multivariate_probit-0.3.4 → multivariate_probit-0.3.5}/benchmarks/ref_pairwise_d8_n3000_100_s0.npz +0 -0
  24. {multivariate_probit-0.3.4 → multivariate_probit-0.3.5}/benchmarks/results.csv +0 -0
  25. {multivariate_probit-0.3.4 → multivariate_probit-0.3.5}/docs/benchmarks.md +0 -0
  26. {multivariate_probit-0.3.4 → multivariate_probit-0.3.5}/docs/fiml.md +0 -0
  27. {multivariate_probit-0.3.4 → multivariate_probit-0.3.5}/docs/ifm.md +0 -0
  28. {multivariate_probit-0.3.4 → multivariate_probit-0.3.5}/docs/implementation.md +0 -0
  29. {multivariate_probit-0.3.4 → multivariate_probit-0.3.5}/docs/limitations.md +0 -0
  30. {multivariate_probit-0.3.4 → multivariate_probit-0.3.5}/docs/studies/README.md +0 -0
  31. {multivariate_probit-0.3.4 → multivariate_probit-0.3.5}/docs/studies/comparators.md +0 -0
  32. {multivariate_probit-0.3.4 → multivariate_probit-0.3.5}/docs/studies/ghk.md +0 -0
  33. {multivariate_probit-0.3.4 → multivariate_probit-0.3.5}/docs/studies/index-correlation-shortcut.md +0 -0
  34. {multivariate_probit-0.3.4 → multivariate_probit-0.3.5}/docs/studies/log-score-evaluator.md +0 -0
  35. {multivariate_probit-0.3.4 → multivariate_probit-0.3.5}/docs/studies/margin-gaps.md +0 -0
  36. {multivariate_probit-0.3.4 → multivariate_probit-0.3.5}/docs/studies/mulan-multilabel.md +0 -0
  37. {multivariate_probit-0.3.4 → multivariate_probit-0.3.5}/docs/studies/multilabel-benchmarks.md +0 -0
  38. {multivariate_probit-0.3.4 → multivariate_probit-0.3.5}/docs/studies/sparse-label-transfer.md +0 -0
  39. {multivariate_probit-0.3.4 → multivariate_probit-0.3.5}/docs/studies/uci-credit.md +0 -0
  40. {multivariate_probit-0.3.4 → multivariate_probit-0.3.5}/docs/use-cases/README.md +0 -0
  41. {multivariate_probit-0.3.4 → multivariate_probit-0.3.5}/docs/use-cases/claims-fast-track.md +0 -0
  42. {multivariate_probit-0.3.4 → multivariate_probit-0.3.5}/docs/use-cases/content-moderation.md +0 -0
  43. {multivariate_probit-0.3.4 → multivariate_probit-0.3.5}/docs/use-cases/cyber.md +0 -0
  44. {multivariate_probit-0.3.4 → multivariate_probit-0.3.5}/docs/use-cases/fraud-vendor-fusion.md +0 -0
  45. {multivariate_probit-0.3.4 → multivariate_probit-0.3.5}/docs/use-cases/hcc-codes.md +0 -0
  46. {multivariate_probit-0.3.4 → multivariate_probit-0.3.5}/docs/use-cases/property-imagery.md +0 -0
  47. {multivariate_probit-0.3.4 → multivariate_probit-0.3.5}/hatch_build.py +0 -0
  48. {multivariate_probit-0.3.4 → multivariate_probit-0.3.5}/src/multivariate_probit/_corr.py +0 -0
  49. {multivariate_probit-0.3.4 → multivariate_probit-0.3.5}/src/multivariate_probit/_mvn.py +0 -0
  50. {multivariate_probit-0.3.4 → multivariate_probit-0.3.5}/src/multivariate_probit/_remote.py +0 -0
  51. {multivariate_probit-0.3.4 → multivariate_probit-0.3.5}/src/multivariate_probit/ifm.py +0 -0
  52. {multivariate_probit-0.3.4 → multivariate_probit-0.3.5}/src/multivariate_probit/inner.py +0 -0
  53. {multivariate_probit-0.3.4 → multivariate_probit-0.3.5}/src/multivariate_probit/linear.py +0 -0
  54. {multivariate_probit-0.3.4 → multivariate_probit-0.3.5}/src/multivariate_probit/orthant/__init__.py +0 -0
  55. {multivariate_probit-0.3.4 → multivariate_probit-0.3.5}/src/multivariate_probit/results.py +0 -0
  56. {multivariate_probit-0.3.4 → multivariate_probit-0.3.5}/tests/conftest.py +0 -0
  57. {multivariate_probit-0.3.4 → multivariate_probit-0.3.5}/tests/test_calibration.py +0 -0
  58. {multivariate_probit-0.3.4 → multivariate_probit-0.3.5}/tests/test_conditional.py +0 -0
  59. {multivariate_probit-0.3.4 → multivariate_probit-0.3.5}/tests/test_contract.py +0 -0
  60. {multivariate_probit-0.3.4 → multivariate_probit-0.3.5}/tests/test_correlation_projection.py +0 -0
  61. {multivariate_probit-0.3.4 → multivariate_probit-0.3.5}/tests/test_linear.py +0 -0
  62. {multivariate_probit-0.3.4 → multivariate_probit-0.3.5}/tests/test_modal_fit.py +0 -0
  63. {multivariate_probit-0.3.4 → multivariate_probit-0.3.5}/tests/test_rf.py +0 -0
  64. {multivariate_probit-0.3.4 → multivariate_probit-0.3.5}/tests/test_xgboost.py +0 -0
@@ -6,8 +6,8 @@ authors:
6
6
  - family-names: Shipman
7
7
  given-names: Mark
8
8
  orcid: "https://orcid.org/0009-0008-7193-1263"
9
- version: 0.3.4
10
- date-released: 2026-11-05
9
+ version: 0.3.5
10
+ date-released: 2026-11-28
11
11
  license: MIT
12
12
  repository-code: "https://github.com/sign-of-fourier/multivariate-probit"
13
13
  url: "https://quantecarlo.com/multivariate-probit"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: multivariate-probit
3
- Version: 0.3.4
3
+ Version: 0.3.5
4
4
  Summary: Joint probabilities for correlated binary outcomes: P(any), P(all), patterns and conditionals that agree. Any classifier per outcome; scikit-learn-style API.
5
5
  Project-URL: Homepage, https://quantecarlo.com/multivariate-probit
6
6
  Project-URL: Source, https://github.com/sign-of-fourier/multivariate-probit
@@ -36,7 +36,7 @@ MultivariateProbit(
36
36
  | `project_correlation` | `True` | Project a pairwise estimate onto the nearest positive-definite correlation matrix. No effect when `dependence="joint"`. |
37
37
  | `random_state` | `None` | Controls the cross-fitting split and `sample`. |
38
38
  | `evaluator` | `"quadrature"` | Backend for the orthant probabilities behind `dependence="joint"` and every joint query: `"quadrature"`, `"scipy"`, `"orthant"` or `"ghk"`. See [Evaluators](#evaluators). |
39
- | `resolution` | `"high"` | Passed to `evaluator="orthant"`; ignored otherwise. `"high"`, `"highest"` (most accurate, about 2–3× the time of `"high"`: median error under 0.00005 on an equicorrelated Σ against up to 0.0001 at `"high"`, and 0.0001–0.0031 on a near-singular Σ against 0.0006–0.0061; see [benchmarks.md](benchmarks.md)), `"smooth"` (the cost of `"highest"`, continuous in the parameters with no threshold where the method changes, for gradient-based fitting; not uniformly more accurate than `"high"`) or `"low"` (cheapest). |
39
+ | `resolution` | `"high"` | Passed to `evaluator="orthant"`; ignored otherwise. `"high"`, `"highest"` (most accurate, about 2–3× the time of `"high"`: median error under 0.00005 on an equicorrelated Σ against up to 0.0001 at `"high"`, and 0.0001–0.0031 on a near-singular Σ against 0.0006–0.0061; see [benchmarks.md](benchmarks.md)), `"smooth"` (the cost of `"highest"`, continuous in the parameters with no threshold where the method changes, for gradient-based fitting; not uniformly more accurate than `"high"`), `"surgical"` (accurate mode for small problems, up to about 10 outcomes: on grouped covariances at d = 6, median error about 0.00002 against about 0.0003 at `"highest"`, no systematic lean, about 5–10× the cost of `"highest"`, growing with d²; from 0.3.5), `"low"` (cheapest) or `"ovus"` (Bhat's OVUS, for comparison). |
40
40
  | `fitter` | `"ifm"` | `"ifm"`: the local two-stage fit. `"modal"`: full maximum likelihood on a hosted GPU service ([fiml.md](fiml.md)) — `inner="linear"` only, `inner_params` may set only `alpha`; `dependence`, `cv`, `optimizer` and `project_correlation` do not apply. Uploads X, Y and `sample_weight`. An int `random_state` seeds its Sobol draws (default seed 0). |
41
41
  | `n_draws` | `512` | Sobol draws per row for `fitter="modal"` and `evaluator="ghk"`; ignored otherwise. Powers of 2 keep the Sobol set balanced. |
42
42
 
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "multivariate-probit"
7
- version = "0.3.4"
7
+ version = "0.3.5"
8
8
  description = "Joint probabilities for correlated binary outcomes: P(any), P(all), patterns and conditionals that agree. Any classifier per outcome; scikit-learn-style API."
9
9
  readme = "README.md"
10
10
  license = { file = "LICENSE" }
@@ -34,7 +34,7 @@ from .linear import ProbitRegressor
34
34
  from .model import MultivariateProbit
35
35
  from .results import MultivariateProbitProba
36
36
 
37
- __version__ = "0.3.4"
37
+ __version__ = "0.3.5"
38
38
 
39
39
  __all__ = [
40
40
  "MultivariateProbit",
@@ -169,7 +169,7 @@ class MultivariateProbit:
169
169
  n_quad : int, default=24
170
170
  Gauss-Legendre order for ``evaluator="quadrature"``. Lower it if
171
171
  fitting with many outcomes gets slow.
172
- resolution : {"high", "highest", "smooth", "low", "ovus"}, default="high"
172
+ resolution : {"high", "highest", "surgical", "smooth", "low", "ovus"}, default="high"
173
173
  Passed to ``evaluator="orthant"``; ignored otherwise. ``"highest"``
174
174
  is the most accurate setting, at about 2-3 times the time of
175
175
  ``"high"``: in docs/benchmarks.md its median error is under 0.00005 on
@@ -178,11 +178,18 @@ class MultivariateProbit:
178
178
  ``"smooth"`` costs the same as ``"highest"`` and is continuous in the
179
179
  parameters (no threshold where the method changes, near-duplicates
180
180
  included), for gradient-based fitting; it is not uniformly more
181
- accurate than ``"high"``. ``"low"`` is the cheapest. ``"ovus"`` is
181
+ accurate than ``"high"``. ``"surgical"`` is the accurate setting for
182
+ small problems (up to about 10 outcomes), for likelihoods where small
183
+ errors add up over many rows: on grouped covariances at d = 6 its median
184
+ error is about 0.00002 against about 0.0003 for ``"highest"``, with no
185
+ systematic lean, at about 5-10 times the cost of ``"highest"``; its
186
+ cost grows with d squared, so above about 10 ``"highest"`` is the
187
+ better trade. ``"low"`` is the cheapest. ``"ovus"`` is
182
188
  Bhat's (2018) OVUS approximation (the one inside MACML), same values
183
189
  as pybhatlib's ``mvncd(method="ovus")``, for side-by-side
184
190
  comparison. ``"highest"`` and ``"smooth"`` are not available in 0.3.0
185
- and earlier, ``"ovus"`` not before 0.3.4.
191
+ and earlier, ``"ovus"`` not before 0.3.4, ``"surgical"`` not before
192
+ 0.3.5.
186
193
  optimizer : str, default="Nelder-Mead"
187
194
  Passed to ``scipy.optimize.minimize`` for ``dependence="joint"``.
188
195
  Derivative-free by design: the orthant likelihood has no convenient
@@ -120,7 +120,8 @@ def test_orthant_without_key_runs_at_low_resolution_up_to_three(tmp_path):
120
120
  @orthant_built
121
121
  @pytest.mark.parametrize(
122
122
  "d, resolution, message",
123
- [(4, "low", "n=4 requires a license"), (3, "high", "resolution='high' requires a license")],
123
+ [(4, "low", "n=4 requires a license"), (3, "high", "resolution='high' requires a license"),
124
+ (3, "surgical", "resolution='surgical' requires a license")],
124
125
  )
125
126
  def test_orthant_without_key_refuses_rather_than_falling_back(tmp_path, d, resolution, message):
126
127
  out = _run_orthant(
@@ -209,3 +210,21 @@ def test_orthant_loads_an_extension_from_memory():
209
210
  with open(ORTHANT_DIR / f"_ofree.{_tag()}.so", "rb") as f:
210
211
  mod = _import_extension(f.read(), "_ofree")
211
212
  assert callable(mod.cdf)
213
+
214
+
215
+ @orthant_built
216
+ @pytest.mark.skipif(not os.environ.get("ORTHANT_KEY"), reason="needs $ORTHANT_KEY")
217
+ def test_orthant_surgical_with_key(tmp_path):
218
+ out = _run_orthant(
219
+ """
220
+ eta, Y, corr = problem(5)
221
+ corr[:2, :2] = 0.8
222
+ np.fill_diagonal(corr, 1.0)
223
+ got = pattern_prob(eta, Y, corr, evaluator="orthant", resolution="surgical")
224
+ ref = pattern_prob(eta, Y, corr)
225
+ assert np.abs(got - ref).max() < 2e-3, np.abs(got - ref).max()
226
+ """,
227
+ key=os.environ["ORTHANT_KEY"],
228
+ tmp_path=tmp_path,
229
+ )
230
+ assert out.returncode == 0, out.stderr