Skip to content

Results

matchbox.client.results

Objects representing the results of running a model client-side.

Classes:

Functions:

ResolverMatches

ResolverMatches(sources: list[Source], query_results: list[DataFrame])

Matches according to a resolver.

Parameters:

  • sources

    (list[Source]) –

    List of Source objects

  • query_results

    (list[DataFrame]) –

    List of tables with SCHEMA_QUERY_WITH_LEAVES

Methods:

  • from_dump

    Initialise ResolverMatches from concatenated dataframe representation.

  • as_lookup

    Return lookup across matchbox ID and source keys.

  • as_dump

    Return mapping across root, leaf, source and keys.

  • as_leaf_sets

    Return grouping of lead IDs.

  • view_cluster

    Return source data for all records in cluster.

  • merge

    Combine two instances of resolved matches by merging clusters.

Attributes:

sources instance-attribute

sources = sources

query_results instance-attribute

query_results = query_results

from_dump classmethod

from_dump(cluster_key_map: DataFrame, dag: DAG) -> Self

Initialise ResolverMatches from concatenated dataframe representation.

as_lookup

as_lookup() -> DataFrame

Return lookup across matchbox ID and source keys.

as_dump

as_dump() -> DataFrame

Return mapping across root, leaf, source and keys.

as_leaf_sets

as_leaf_sets() -> list[list[int]]

Return grouping of lead IDs.

view_cluster

view_cluster(cluster_id: int, merge_fields: bool = False) -> DataFrame

Return source data for all records in cluster.

Parameters:

  • cluster_id
    (int) –

    ID of root cluster to view

  • merge_fields
    (bool, default: False ) –

    whether to remove source qualifier when concatenating rows. Only applies to index fields - key fields are not affected.

merge

merge(other: Self) -> Self

Combine two instances of resolved matches by merging clusters.

All cluster IDs will be replaced with negative integers and lose their association with cluster IDs on the backend.

normalise_model_scores

normalise_model_scores(scores: DataFrame) -> DataFrame

Validate and normalise model output scores.