{
 "cranqe_package": "libqe-stats",
 "dev_metadata": {
  "author": "Cody L Marquart <cody.marquart@wisc.edu>",
  "description": "# qe-stats\n\nPython bindings for [libqe-stats](https://qe-libs.org/conan/libqe-stats/), the\nheader-only C++ statistics for checking qualitative coding that the `qestats`\nR package and `@qe-libs/libqe-stats-wasm` share: classification metrics,\nhypergeometric intervals and perfect-sample sizes, metric derivation from\nknown metrics, bootstrap comparison of two coders, and Shaffer's rho (ported\nfrom rhoR).\n\n```sh\npip install qe-stats --index-url https://qe-libs.org/py/simple/\n```\n\n## Quick start\n\n```python\nimport qestats\n\n# Metrics from a confusion matrix\nm = qestats.calculate_metrics(tp=50, fp=10, fn=5, tn=100)\nm[\"kappa\"], m[\"precision\"], m[\"FDR\"]\n\n# Shaffer's rho for an observed kappa of 0.88 on an 80-item test set\n# from a population with base rate 0.2 (rhoR's rhoK)\nqestats.rho(0.88, 0.2, 80, seed=1)          # 0.1025\n\n# How large must a perfect sample be to show kappa > 0.65?\nqestats.ps_kappa(0.65, baserate=0.12)       # {'n': ..., 'power': ..., 'cost': ...}\n\n# Compare two coders' kappa\nqestats.p_diff({\"TP\": 50, \"FP\": 10, \"FN\": 5, \"TN\": 100},\n               {\"TP\": 40, \"FP\": 20, \"FN\": 10, \"TN\": 100},\n               n_sample=0, metric=\"kappa\")\n```\n\nMetric results are dicts keyed as in R (`baserate`, `baserate2`, `precision`,\n`recall`, `accuracy`, `FDR`, `FOR`, `kappa`, and the four cells). A confusion\nmatrix argument is a dict with `TP`, `FP`, `FN`, `TN` or a sequence\n`(tp, fp, fn, tn)`.\n\n## API\n\n| Function | R (`qestats`) |\n|----------|---------------|\n| `calculate_metrics(tp, fp, fn, tn)` | `qestats_calculate_metrics` |\n| `kappa_from_counts(tp, fp, fn, tn)` | \u2014 |\n| `derive(name1, val1, name2, val2, name3, val3)` | `qestats_derive` |\n| `derive_from_rates(baserate, fdr, for_rate)` | `qestats_derive_from_rates` |\n| `range(name1, val1, name2, val2, target)` | `qestats_range` |\n| `phyper(q, K, N_minus_K, n)` | `qestats_phyper` |\n| `hyper_range(n_pos, n, N, alpha=0.05)` | `qestats_hyper_range` |\n| `metrics_range(tp, fp, fn, tn, N, baserate, alpha=0.05)` | `qestats_metrics_range` |\n| `ps_proportion(x0, x1=0, N=0, allowed_errors=0, alpha=0.05)` | `qestats_ps_proportion` |\n| `ps_est_proportion(n, N=0, allowed_errors=0, alpha=0.05)` | `qestats_ps_est_proportion` |\n| `ps_kappa(kappa0, baserate, kappa1=0, N=0, allowed_errors=0, alpha=0.05)` | `qestats_ps_kappa` |\n| `ps_est_kappa(n, baserate, N=0, allowed_errors=0, alpha=0.05)` | `qestats_ps_est_kappa` |\n| `bootstrap_metrics(cm, n_sample, n_set=0, n_bootstrap=1000, conf_level=0.95)` | `qestats_bootstrap_metrics` |\n| `p_diff(cm1, cm2, n_sample, metric, n_set=0, n_bootstrap=1000, alpha=0.05)` | `qestats_p_diff` |\n| `n_diff2(cm1, cm2, metric, N, d=0.1, alpha=0.05)` | `qestats_N_Diff2` |\n| `rho(x, baserate, test_set_length, ..., method=\"standard\", seed=None)` | `qestats_rho` |\n\n`range` is called as `qestats.range(...)`; it is not exported by\n`from qestats import *`, so the builtin is not replaced.\n\n## rho and random numbers\n\n`rho` runs either of rhoR's methods: `\"standard\"` (rhoR's default, written in\nR) or `\"fast\"` (its C++ path). It draws from libqe-stats' own generator\n(mt19937_64), so a `seed` gives the same rho in Python, Julia (QEStats.jl) and\nC++ on every platform; without one, each call draws a fresh seed. It cannot\nreproduce a seeded rhoR call, which uses R's generator: for that, use the R\npackage (`qestats_rho` or rhoR itself).",
  "description_content_type": "text/markdown",
  "license": "GPL-3.0-only",
  "name": "qe-stats",
  "project_urls": [
   [
    "Homepage",
    "https://qe-libs.org/py/project/qe-stats/"
   ],
   [
    "Documentation",
    "https://qe-libs.org/py/docs/qe-stats/"
   ],
   [
    "Repository",
    "https://gitlab.com/epistemic-analytics/qe-packages/libqe-stats"
   ]
  ],
  "requires_dist": [
   "pytest; extra == \"dev\""
  ],
  "requires_python": ">=3.9",
  "summary": "Python bindings for libqe-stats \u2014 classification metrics, sample sizes, metric derivation, bootstrap comparison and Shaffer's rho for qualitative coding",
  "version": "0.1.3.9001"
 },
 "dev_metadata_from": "0.1.3.9001",
 "files": {
  "qe_stats-0.1.2-cp311-cp311-macosx_26_0_arm64.whl": {
   "published": "2026-11-11",
   "sha256": "6eac2c607ec897835484ea2e735215c17e7f396a89e325a7124509dcf09955be",
   "size": 80325,
   "url": "https://gitlab.com/api/v4/projects/22522458/packages/pypi/files/6eac2c607ec897835484ea2e735215c17e7f396a89e325a7124509dcf09955be/qe_stats-0.1.2-cp311-cp311-macosx_26_0_arm64.whl",
   "version": "0.1.2"
  },
  "qe_stats-0.1.2-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl": {
   "published": "2026-11-11",
   "sha256": "7565d067587ca6f3b69b75bcfddfb8134175f2687c0eb6753c4d408344b2f9fc",
   "size": 92997,
   "url": "https://gitlab.com/api/v4/projects/22522458/packages/pypi/files/7565d067587ca6f3b69b75bcfddfb8134175f2687c0eb6753c4d408344b2f9fc/qe_stats-0.1.2-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl",
   "version": "0.1.2"
  },
  "qe_stats-0.1.2-cp312-cp312-macosx_26_0_arm64.whl": {
   "published": "2026-11-11",
   "sha256": "4f8593f6bdd08e5a558ea3ef2be04c147e875a1f96ae6200372ba6f42b8c1e88",
   "size": 79468,
   "url": "https://gitlab.com/api/v4/projects/22522458/packages/pypi/files/4f8593f6bdd08e5a558ea3ef2be04c147e875a1f96ae6200372ba6f42b8c1e88/qe_stats-0.1.2-cp312-cp312-macosx_26_0_arm64.whl",
   "version": "0.1.2"
  },
  "qe_stats-0.1.2-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl": {
   "published": "2026-11-11",
   "sha256": "461665a9159b13840be0eeb820661d6f22d7a5a32dbb9fea05b1cdefd0ec4707",
   "size": 92542,
   "url": "https://gitlab.com/api/v4/projects/22522458/packages/pypi/files/461665a9159b13840be0eeb820661d6f22d7a5a32dbb9fea05b1cdefd0ec4707/qe_stats-0.1.2-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl",
   "version": "0.1.2"
  },
  "qe_stats-0.1.2-cp313-cp313-macosx_26_0_arm64.whl": {
   "published": "2026-11-11",
   "sha256": "fcf2081cc5042e29f833bff62f94bef972eab8b77aaa1f3837946cde80b91c76",
   "size": 79500,
   "url": "https://gitlab.com/api/v4/projects/22522458/packages/pypi/files/fcf2081cc5042e29f833bff62f94bef972eab8b77aaa1f3837946cde80b91c76/qe_stats-0.1.2-cp313-cp313-macosx_26_0_arm64.whl",
   "version": "0.1.2"
  },
  "qe_stats-0.1.2-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl": {
   "published": "2026-11-11",
   "sha256": "e9d15e1a33822c06518f4443411661ad417ca953113d0b10568e5eb4f7b3f3c9",
   "size": 92483,
   "url": "https://gitlab.com/api/v4/projects/22522458/packages/pypi/files/e9d15e1a33822c06518f4443411661ad417ca953113d0b10568e5eb4f7b3f3c9/qe_stats-0.1.2-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl",
   "version": "0.1.2"
  },
  "qe_stats-0.1.2.tar.gz": {
   "published": "2026-11-11",
   "sha256": "9ace6415e05b8d30dd3c2b1aa2e59e683e9584c99793168c7302a8f15f978186",
   "size": 27987,
   "url": "https://gitlab.com/api/v4/projects/22522458/packages/pypi/files/9ace6415e05b8d30dd3c2b1aa2e59e683e9584c99793168c7302a8f15f978186/qe_stats-0.1.2.tar.gz",
   "version": "0.1.2"
  },
  "qe_stats-0.1.3.9001-cp311-cp311-macosx_26_0_arm64.whl": {
   "published": "2026-11-11",
   "sha256": "0e5c66d0cf20393b0509ccc7b62f87616197bc790a942503d32d8c4c836de1d0",
   "size": 80362,
   "version": "0.1.3.9001"
  },
  "qe_stats-0.1.3.9001-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl": {
   "published": "2026-11-11",
   "sha256": "7c3391730b23c915d0aed8ddf58f53c193dd4a533524538f4b48a2eab7c4aa22",
   "size": 93044,
   "version": "0.1.3.9001"
  },
  "qe_stats-0.1.3.9001-cp312-cp312-macosx_26_0_arm64.whl": {
   "published": "2026-11-11",
   "sha256": "a50a8f6bde072870e3f63ddeaf48efaf3c7c8e85297a4aa3b0dde37473ccd91b",
   "size": 79506,
   "version": "0.1.3.9001"
  },
  "qe_stats-0.1.3.9001-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl": {
   "published": "2026-11-11",
   "sha256": "7331452ba4b92b1024ea367a6c9c124213d2c94e7f51807ea69c79691b238300",
   "size": 92590,
   "version": "0.1.3.9001"
  },
  "qe_stats-0.1.3.9001-cp313-cp313-macosx_26_0_arm64.whl": {
   "published": "2026-11-11",
   "sha256": "053cc0c8ee5893763f74ebcf963adc530632662ed070be7b6513cb66d11534e8",
   "size": 79537,
   "version": "0.1.3.9001"
  },
  "qe_stats-0.1.3.9001-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl": {
   "published": "2026-11-11",
   "sha256": "e5e0a9e69001c711bdfca865f78fc801f7a7c1c009626beed18bbdc0cc69e0f3",
   "size": 92531,
   "version": "0.1.3.9001"
  },
  "qe_stats-0.1.3.9001.tar.gz": {
   "published": "2026-11-11",
   "sha256": "b28d0221bcd750291297c4f5cd8e03c39eff3cd492788aa8e88e6bdf02101378",
   "size": 27994,
   "version": "0.1.3.9001"
  }
 },
 "metadata": {
  "author": "Cody L Marquart <cody.marquart@wisc.edu>",
  "description": "# qe-stats\n\nPython bindings for [libqe-stats](https://qe-libs.org/conan/libqe-stats/), the\nheader-only C++ statistics for checking qualitative coding that the `qestats`\nR package and `@qe-libs/libqe-stats-wasm` share: classification metrics,\nhypergeometric intervals and perfect-sample sizes, metric derivation from\nknown metrics, bootstrap comparison of two coders, and Shaffer's rho (ported\nfrom rhoR).\n\n```sh\npip install qe-stats --index-url https://qe-libs.org/py/simple/\n```\n\n## Quick start\n\n```python\nimport qestats\n\n# Metrics from a confusion matrix\nm = qestats.calculate_metrics(tp=50, fp=10, fn=5, tn=100)\nm[\"kappa\"], m[\"precision\"], m[\"FDR\"]\n\n# Shaffer's rho for an observed kappa of 0.88 on an 80-item test set\n# from a population with base rate 0.2 (rhoR's rhoK)\nqestats.rho(0.88, 0.2, 80, seed=1)          # 0.1025\n\n# How large must a perfect sample be to show kappa > 0.65?\nqestats.ps_kappa(0.65, baserate=0.12)       # {'n': ..., 'power': ..., 'cost': ...}\n\n# Compare two coders' kappa\nqestats.p_diff({\"TP\": 50, \"FP\": 10, \"FN\": 5, \"TN\": 100},\n               {\"TP\": 40, \"FP\": 20, \"FN\": 10, \"TN\": 100},\n               n_sample=0, metric=\"kappa\")\n```\n\nMetric results are dicts keyed as in R (`baserate`, `baserate2`, `precision`,\n`recall`, `accuracy`, `FDR`, `FOR`, `kappa`, and the four cells). A confusion\nmatrix argument is a dict with `TP`, `FP`, `FN`, `TN` or a sequence\n`(tp, fp, fn, tn)`.\n\n## API\n\n| Function | R (`qestats`) |\n|----------|---------------|\n| `calculate_metrics(tp, fp, fn, tn)` | `qestats_calculate_metrics` |\n| `kappa_from_counts(tp, fp, fn, tn)` | \u2014 |\n| `derive(name1, val1, name2, val2, name3, val3)` | `qestats_derive` |\n| `derive_from_rates(baserate, fdr, for_rate)` | `qestats_derive_from_rates` |\n| `range(name1, val1, name2, val2, target)` | `qestats_range` |\n| `phyper(q, K, N_minus_K, n)` | `qestats_phyper` |\n| `hyper_range(n_pos, n, N, alpha=0.05)` | `qestats_hyper_range` |\n| `metrics_range(tp, fp, fn, tn, N, baserate, alpha=0.05)` | `qestats_metrics_range` |\n| `ps_proportion(x0, x1=0, N=0, allowed_errors=0, alpha=0.05)` | `qestats_ps_proportion` |\n| `ps_est_proportion(n, N=0, allowed_errors=0, alpha=0.05)` | `qestats_ps_est_proportion` |\n| `ps_kappa(kappa0, baserate, kappa1=0, N=0, allowed_errors=0, alpha=0.05)` | `qestats_ps_kappa` |\n| `ps_est_kappa(n, baserate, N=0, allowed_errors=0, alpha=0.05)` | `qestats_ps_est_kappa` |\n| `bootstrap_metrics(cm, n_sample, n_set=0, n_bootstrap=1000, conf_level=0.95)` | `qestats_bootstrap_metrics` |\n| `p_diff(cm1, cm2, n_sample, metric, n_set=0, n_bootstrap=1000, alpha=0.05)` | `qestats_p_diff` |\n| `n_diff2(cm1, cm2, metric, N, d=0.1, alpha=0.05)` | `qestats_N_Diff2` |\n| `rho(x, baserate, test_set_length, ..., method=\"standard\", seed=None)` | `qestats_rho` |\n\n`range` is called as `qestats.range(...)`; it is not exported by\n`from qestats import *`, so the builtin is not replaced.\n\n## rho and random numbers\n\n`rho` runs either of rhoR's methods: `\"standard\"` (rhoR's default, written in\nR) or `\"fast\"` (its C++ path). It draws from libqe-stats' own generator\n(mt19937_64), so a `seed` gives the same rho in Python, Julia (QEStats.jl) and\nC++ on every platform; without one, each call draws a fresh seed. It cannot\nreproduce a seeded rhoR call, which uses R's generator: for that, use the R\npackage (`qestats_rho` or rhoR itself).",
  "description_content_type": "text/markdown",
  "license": "GPL-3.0-only",
  "name": "qe-stats",
  "project_urls": [
   [
    "Homepage",
    "https://qe-libs.org/py/project/qe-stats/"
   ],
   [
    "Documentation",
    "https://qe-libs.org/py/docs/qe-stats/"
   ],
   [
    "Repository",
    "https://gitlab.com/epistemic-analytics/qe-packages/libqe-stats"
   ]
  ],
  "requires_dist": [
   "pytest; extra == \"dev\""
  ],
  "requires_python": ">=3.9",
  "summary": "Python bindings for libqe-stats \u2014 classification metrics, sample sizes, metric derivation, bootstrap comparison and Shaffer's rho for qualitative coding",
  "version": "0.1.2"
 },
 "metadata_from": "0.1.2",
 "name": "qe-stats"
}
