Add docs for `estimate_m_from_pairwise_labels`
@@ -1405,6 +1405,29 @@ class Linker:
return profile_columns(self, column_expressions, top_n=top_n, bottom_n=bottom_n)
def estimate_m_from_pairwise_labels(self, table_name):
+ """Estimate the m parameters of the linkage model from a dataframe of pairwise labels.
+
+ The table of labels should be in the following format, and should
+ be registered with your database:
+ |source_dataset_l|unique_id_l|source_dataset_r|unique_id_r|clerical_match_score|
+ |----------------|-----------|----------------|-----------|--------------------|
+ |df_1 |1 |df_2 |2 |0.99 |
+ |df_1 |1 |df_2 |3 |0.2 |
+
+ Note that `source_dataset` and `unique_id` should correspond to the
+ values specified in the settings dict, and the `input_table_aliases`
+ passed to the `linker` object. Note that at the moment
+ `clerical_match_score` is ignored and it is assumed that every row in
+ the table of labels is a score of 1, i.e. a perfect match.
+
+ Args:
+ labels_tablename (str): Name of table containing labels in the database
+
+ Examples:
+ >>> pairwise_labels = pd.read_csv("./data/pairwise_labels_to_estimate_m.csv")
+ >>> linker.register_table(pairwise_labels, "labels", overwrite=True)
+ >>> linker.estimate_m_from_pairwise_labels("labels")
+ """
self._initialise_df_concat_with_tf(materialise=True)
estimate_m_from_pairwise_labels(self, table_name)
