Components
matchlab.resolvers.components
¶
Connected-components resolver methodology.
Classes:
-
Components–Resolver methodology that computes connected components.
Components
¶
Bases: ResolverMethod
flowchart TD
matchlab.resolvers.components.Components[Components]
matchlab.resolvers.base.ResolverMethod[ResolverMethod]
matchlab.resolvers.base.ResolverMethod --> matchlab.resolvers.components.Components
click matchlab.resolvers.components.Components href "" "matchlab.resolvers.components.Components"
click matchlab.resolvers.base.ResolverMethod href "" "matchlab.resolvers.base.ResolverMethod"
Resolver methodology that computes connected components.
A threshold defaults to 0.0 if not set.
Methods:
-
compute_clusters–Compute cluster assignments from model edges.
Attributes:
-
version(int) – -
resolver_type(ResolverType) – -
thresholds(dict[int, Annotated[float, Field(ge=0.0, le=1.0)]]) – -
model_config–
thresholds
class-attribute
instance-attribute
¶
thresholds: dict[int, Annotated[float, Field(ge=0.0, le=1.0)]] = Field(default_factory=dict, description="Minimum score for an edge to count, per input, keyed by the input's position. Write these as `{model: 0.9}`. `Resolver` takes the model object and works out the position.")
model_config
class-attribute
instance-attribute
¶
compute_clusters
¶
compute_clusters(model_edges: Mapping[int, DataFrame]) -> DataFrame
Compute cluster assignments from model edges.
Parameters:
-
(model_edges¶Mapping[int, DataFrame]) –Input position to that model's edges, conforming to SCHEMA_MODEL_EDGES. Positions index the resolver's inputs, in the order they were given, and are what per-model settings key by.
Returns:
-
DataFrame–A Polars DataFrame which conforms to SCHEMA_CLUSTERS