Skip to main content

A Python package for row matching and F1 score calculations.

Project description

Tamarix Analytics

A Python package for row matching and F1 score calculations using the Hungarian algorithm.

Installation

pip install tamarix-analytics

Usage

from tamarix_analytics import (
    match_rows,
    f1_score_unordered,
    f1_score_ordered,
    get_row_score,
    f1_score_ordered_by_field,
    f1_score_ordered_by_field_with_nested,
    extract_nested_rows,
    detect_nested_list_fields,
)

Methods

Document-level scores

  • match_rows(tentative_data, baseline_data) — Hungarian row alignment.
  • f1_score_unordered(tentative_data, baseline_data) — bag-of-values F1.
  • f1_score_ordered(tentative_data, baseline_data) — structure-aware F1 after matching.
  • get_row_score(tentative_data, baseline_data)len(tentative) / len(baseline).

Field-level scores

  • f1_score_ordered_by_field(tentative_data, baseline_data) -> dict[str, float] — per-field ordered F1. Returns {} when both sides have at most one row. Skips list-of-dict container fields. Omits fields with no evidence (both-None).
  • f1_score_ordered_by_field_with_nested(...) — same as above, plus nested list-of-dict fields scored after concatenating all nested objects across main rows. Nested keys are namespaced (sub_amounts.amount, sub_amounts.type, …).
  • extract_nested_rows(rows, nested_field) / detect_nested_list_fields(rows) — helpers for nested tables.

Both sides must be list[BaseModel] with a shared field schema (except nested union keys, which are aligned automatically by f1_score_ordered_by_field_with_nested).

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tamarix_analytics-0.0.8.tar.gz (4.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

tamarix_analytics-0.0.8-py3-none-any.whl (5.2 kB view details)

Uploaded Python 3

File details

Details for the file tamarix_analytics-0.0.8.tar.gz.

File metadata

  • Download URL: tamarix_analytics-0.0.8.tar.gz
  • Upload date:
  • Size: 4.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.6

File hashes

Hashes for tamarix_analytics-0.0.8.tar.gz
Algorithm Hash digest
SHA256 a45f17e2b430446dd6038d1b97b62048cce62ca39f4603dd1e4afe26bf77515a
MD5 3dd2b55e0b472735307dcfbf258646b4
BLAKE2b-256 757d4051378d3527196387c434089a60b559e0293554824d8386fe7ba8f1fdf1

See more details on using hashes here.

File details

Details for the file tamarix_analytics-0.0.8-py3-none-any.whl.

File metadata

File hashes

Hashes for tamarix_analytics-0.0.8-py3-none-any.whl
Algorithm Hash digest
SHA256 f216fb5e81d58d6f3e2872dbe7955e2924fbc3b7801f02c1fe9cd88e24e30426
MD5 9c29d2fa904aedad28934c8dcc779861
BLAKE2b-256 6148f6282b96bc538c4906e75076a19287fb6b82cbb3893b3aa1c6a7fe994ee0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page