Skip to main content

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)
  • brier_skill_score(predictions, held_out, reference_predictions=None)
  • probability_reward(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. The current contract 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. probability_reward returns 1 - brier_score for a non-empty target set. The environment remains responsible for enforcing its exact response schema before calling this scorer. brier_skill_score returns relative improvement over an explicit reference forecast; when omitted, it uses the three-class uniform forecast. A score of zero equals the reference, one is perfect, and negative values are worse than the reference. When reference losses vary across tasks, study-level skill must be computed from pooled losses (1 - mean(model_loss) / mean(reference_loss)), not by averaging the per-task ratios returned by separate calls.

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.

Metadata

Release files for commonground-score 0.7.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for commonground-score 0.7.1
File Size Uploaded Provenance
commonground_score-0.7.1.tar.gz 8.6 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for commonground-score 0.7.1
File Interpreter ABI Platform
commonground_score-0.7.1-py3-none-any.whl Python 3 none any Details

Total release size: 18.9 kB

Release files / commonground_score-0.7.1.tar.gz

Download URL commonground_score-0.7.1.tar.gz
Size 8.6 kB
Tags Source
SHA-256 checksum
How to use checksums
809b3f15e8114e2711d2b85ca13ae57667f9b67b244d924eeee60bc2fb11596d
BLAKE2b-256 checksum
How to use checksums
b46cfc2807cb295c0eaf2267c4131a9bfdf842927bc2a25121d3a3bcfa516e53
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.7.1-py3-none-any.whl

Download URL commonground_score-0.7.1-py3-none-any.whl
Size 10.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b1677ca5670efb86f8b624cd33bcf3d8874e345fae33c4ac0a20c81660da234d
BLAKE2b-256 checksum
How to use checksums
630930e7c2d9a7dcfc9a5e21a10ad45f7545336fdb47866400e7dbf2b789dbd2
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}

Security for commonground-score 0.7.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.7.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page