graflo.db.identity_inference¶
Algorithmic identity inference from vertex record samples.
IdentityInferenceConfig
¶
Bases: ConfigBaseModel
External configuration for :class:IdentityInferencer.
Source code in graflo/db/identity_inference.py
IdentityInferenceResult
¶
Bases: ConfigBaseModel
Outcome of identity inference for one vertex type.
Source code in graflo/db/identity_inference.py
IdentityInferencer
¶
Infer vertex identity fields from flat record samples.
Source code in graflo/db/identity_inference.py
275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 | |
apply_identity_inference_to_vertices(vertices, samples_by_name, config=None)
¶
Infer and apply identity fields for each vertex type (immutable copy).
Source code in graflo/db/identity_inference.py
bootstrap_is_stable(samples, key_fields, *, n_boots=5, subsample_ratio=0.8, min_sample_size=10, rng=None)
¶
Return whether bootstrap validation passes on every sub-sample.
Source code in graflo/db/identity_inference.py
bootstrap_pass_rate(samples, key_fields, *, n_boots=5, subsample_ratio=0.8, min_sample_size=10, rng=None)
¶
Return the fraction of bootstrap sub-samples that remain fully unique.
Source code in graflo/db/identity_inference.py
compute_hash_identity(doc, source_fields)
¶
Compute a deterministic SHA256 hex digest from source field values.
Source code in graflo/db/identity_inference.py
infer_column_type_cost(values)
¶
Return per-column type suitability cost, or None when disqualified.
Source code in graflo/db/identity_inference.py
infer_identities_from_snapshot(snapshot_path, output_path=None, *, config=None)
¶
Infer vertex identities from a GraFlo output snapshot and return an updated copy.
Source code in graflo/db/identity_inference.py
score_candidate(fields, type_costs, *, type_cost_weight=0.2, semantic_weight=0.5)
¶
Lower scores are better (parsimony + type cost - semantic bonus).
Source code in graflo/db/identity_inference.py
uniqueness_ratio(samples, key_fields)
¶
Fraction of rows with distinct key tuples.