Fit a match model to candidate comparison vectors
fit_match_model.RdTwo methods, both returning an object usable by predict_match() to emit a
calibrated per-pair match probability (p_match), the confidence signal the
downstream panel model wants:
"em"(default, unsupervised)Fellegi-Sunter latent-class model. Each field is binarised (similarity
>= agree_cutoffis agreement) andreclin2::problink_em()learns, by EM with no labels, the probability of agreement among true matches (m) and among non-matches (u) plus the prior match rate. Weights become learned rather than hand-set; the posterior is the naive-Bayes combination of the per-field log likelihood ratios."logistic"(supervised)Logistic regression of the label on the graded (not binarised) similarities, so it uses the full resolution of the comparators. Missing fields are mean-imputed with a missingness indicator. Requires
labels.
Usage
fit_match_model(
comparisons,
method = c("em", "logistic"),
labels = NULL,
agree_cutoff = 0.5
)Arguments
- comparisons
Output of
candidate_comparisons().- method
"em"or"logistic".- labels
Integer/logical vector of length
nrow(comparisons)(1/0,NAto ignore) — required for"logistic", ignored for"em".- agree_cutoff
Similarity at or above which a field counts as agreement (EM only).
Examples
if (FALSE) { # \dontrun{
cmp <- candidate_comparisons(panel)
em <- fit_match_model(cmp) # unsupervised
fs_weights(em) # learned agreement/disagreement weights
} # }