commonground-score
Pure-Python scoring utilities for Common Ground deliberation evaluations.
API
commonground_score exposes:
prop_test(successes, trials)two_prop_test(s_in, s_out, p_in, p_out)comment_stats(votes)vote_entropy(votes)cluster_separation(votes)rating_to_vote(value)vote_accuracy(predictions, held_out)brier_score(predictions, held_out)
vote_entropy normalizes agree/disagree/pass entropy to [0, 1].
cluster_separation returns the fraction of faction-vote pairs taking different
stances. Together they provide the deterministic panel-disagreement math used
by commonground-elicit; missing votes are excluded from both calculations.
brier_score accepts bare point predictions (1, -1, or 0) and
probability mappings keyed by agree, disagree, and pass or their numeric
equivalents. Valid non-negative finite mappings are normalized before scoring.
Invalid or non-normalizable mappings score as the uniform distribution
(1/3, 1/3, 1/3) to represent no information. Version 0.2 divides the
three-class squared-error sum by two, so the returned score is bounded to
[0,1]; callers requiring the unnormalized convention must multiply by two.
rating_to_vote(value) implements the canonical 0-10 rating conversion used for
dataset parity:
signed = (2 * (value - 5)) / 10
Values outside the inclusive 0-10 range, plus non-finite values, map to
neutral/pass (0). In-range values below 5 return a negative score, values
above 5 return a positive score, and exactly 5 returns 0.
Parity Fixtures
The test suite includes a parity fixture loader for
tests/fixtures/parity_*.json. The harness requires fixtures for
prop_test, two_prop_test, comment_stats, and rating_to_vote. Fixture
files should use:
{"function":"prop_test","cases":[{"args":[2,4],"expected":0.4472135954999579}]}
JSON cannot encode NaN, so NaN arguments are represented as the exact string
"NaN" and decoded by the harness before invocation.
Release files for commonground-score 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| commonground_score-0.2.0.tar.gz | 7.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| commonground_score-0.2.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 17.3 kB
Release files / commonground_score-0.2.0.tar.gz
| Download URL | commonground_score-0.2.0.tar.gz |
|---|---|
| Size | 7.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6b3631cfffb0d5d589b47b9e63cf3ce2c572f59a267055c0fc988a3a44a75969
|
|
BLAKE2b-256 checksum How to use checksums |
184905775e1e1a4bccb0653044c26bd99e17f8442323182db25461faaddf10d3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.10.9 {"installer":{"name":"uv","version":"0.10.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / commonground_score-0.2.0-py3-none-any.whl
| Download URL | commonground_score-0.2.0-py3-none-any.whl |
|---|---|
| Size | 9.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
08a85c41f3557927b92d53a78e99b48a071a2e7696d767763211e24028c52ee2
|
|
BLAKE2b-256 checksum How to use checksums |
01a578b745fdfe8fc06464ab5557f7c490cf91d5dc9dc09cac20897b22d65b4c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.10.9 {"installer":{"name":"uv","version":"0.10.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|