Skip to content

Results

matchbox.client.results

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

Classes:

  • Results

    Results of a model run.

Functions:

Results

Results of a model run.

Contains:

  • The probabilities of each pair being a match
  • (Optional) The clusters of connected components at each threshold

Model is required during construction and calculation, but not when loading from storage.

Allows users to easily interrogate the outputs of models, explore decisions on choosing thresholds for clustering, and upload the results to Matchbox.

Methods:

Attributes:

probabilities instance-attribute

probabilities: Table

clusters class-attribute instance-attribute

clusters: Table | None = None

model class-attribute instance-attribute

model: Model | None = None

metadata instance-attribute

metadata: ModelMetadata

check_probabilities classmethod

check_probabilities(value: Table | DataFrame) -> Table

Verifies the probabilities table contains the expected fields.

probabilities_to_pandas

probabilities_to_pandas() -> DataFrame

Returns the probability results as a DataFrame.

inspect_probabilities

inspect_probabilities(
    left_data: DataFrame,
    left_key: str,
    right_data: DataFrame,
    right_key: str,
) -> DataFrame

Enriches the probability results with the source data.

clusters_to_pandas

clusters_to_pandas() -> DataFrame

Returns the cluster results as a DataFrame.

inspect_clusters

inspect_clusters(
    left_data: DataFrame,
    left_key: str,
    right_data: DataFrame,
    right_key: str,
) -> DataFrame

Enriches the cluster results with the source data.

to_matchbox

to_matchbox() -> None

Writes the results to the Matchbox database.

calculate_clusters

calculate_clusters(
    func: Callable[P, R],
) -> Callable[P, R]

Decorator to calculate clusters if it hasn’t been already.