Predict Using an Entity Matching Model
- async AsyncCogniteClient.entity_matching.predict(
- sources: Sequence[dict] | None = None,
- targets: Sequence[dict] | None = None,
- num_matches: int = 1,
- score_threshold: float | None = None,
- id: int | None = None,
- external_id: str | None = None,
-
Warning
Blocks and waits for the model to be ready if it has been recently created.
Note
All users on this CDF subscription with assets read-all and entitymatching read-all and write-all capabilities in the project, are able to access the data sent to this endpoint.
- Parameters:
sources (Sequence[dict] | None) – entities to match from, does not need an ‘id’ field. Tolerant to passing more than is needed or used (e.g. json dump of time series list). If omitted, will use data from fit.
targets (Sequence[dict] | None) – entities to match to, does not need an ‘id’ field. Tolerant to passing more than is needed or used. If omitted, will use data from fit.
num_matches (int) – number of matches to return for each item.
score_threshold (float | None) – only return matches with a score above this threshold
id (int | None) – id of the model to use.
external_id (str | None) – external id of the model to use.
- Returns:
object which can be used to wait for and retrieve results.
- Return type:
Examples
>>> from cognite.client import CogniteClient, AsyncCogniteClient >>> client = CogniteClient() >>> # async_client = AsyncCogniteClient() # another option >>> sources = {"id": 101, "name": "ChildAsset1", "description": "Child of ParentAsset1"} >>> targets = {"id": 1, "name": "ParentAsset1", "description": "Parent to ChildAsset1"} >>> true_matches = [(1, 101)] >>> model = client.entity_matching.predict( ... sources=sources, targets=targets, num_matches=1, score_threshold=0.6, id=1 ... )