Collapses the per-field similarities of an np_compare() result into a single
score in [0, 1]. Three methods are provided so the "best" combiner can be
chosen empirically against a labelled training set:
Arguments
- pairs
An
np_pairsframe fromnp_compare().- config
An
np_config().- method
One of
"weighted","em","model".- model
A fitted model with a
predict()method, required formethod = "model". Must accept a data frame of the similarity columns.
Details
"weighted"— normalized weighted sum using the profile weights inconfig. Transparent, no training required. The default."hier"— name similarity plus a hierarchical geo sub-score that takes the strongest confirmed location granularity (ZIP+4 > street > ZIP5 > PO box > ZIP3 > city > state) via amax, not a sum. Correlated address fields are not double-counted, and a wrong city cannot pull down a ZIP-confirmed match. Degrades gracefully as geo fields go missing. Seenp_default_geo_weights()."em"— unsupervised Fellegi-Sunter weights viareclin2::problink_em();scoreis the match posterior. Learns weights from the data."model"— apply a fitted classifier (glm,ranger,xgboost, ...) supplied inmodelto the per-field similarity columns;scoreis its predicted match probability. This is the hook for supervised optimization.
The chosen method's raw output is retained (weight_em, p_model) so methods
can be compared side by side before one is adopted.