Skip to content

fix: clamp topic_entropy to prevent negative values and add pytest suite#4

Open
Karan24Soni wants to merge 1 commit into
google-deepmind:mainfrom
Karan24Soni:main
Open

fix: clamp topic_entropy to prevent negative values and add pytest suite#4
Karan24Soni wants to merge 1 commit into
google-deepmind:mainfrom
Karan24Soni:main

Conversation

@Karan24Soni

Copy link
Copy Markdown

fixed a bug in topic_entropy where single-class distributions were returning a tiny negative number (like -1.44e-12) because of that 1e-12 smoothing. just clamped it to 0 so it stops acting weird.
also added a tests/ folder at the repo root since pyproject.toml already had testpaths = ["tests"] but there were zero tests. wrote 25 pytest tests covering topic_entropy, embedding_coverage, overall_diversity, failure_rate, and compute_samples_to_threshold from proeval/utils/metrics.py — all pure functions so no API keys or GPU needed to run em.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant