Skip to contents

Suggests the most similar records. It automatically constructs a data generator from the left and right datasets iterating over all the elements of their Cartesian product. The method calls the predict method of the passed model using the constructed generator. For each record in the left dataset of, the function returns count records from the right dataset having the greatest matching predictions.

Usage

suggest(object, left, right, count, ...)

# S4 method for class 'neer_match.matching_model.DLMatchingModel'
suggest(object, left, right, count, ...)

# S4 method for class 'neer_match.matching_model.NSMatchingModel'
suggest(object, left, right, count, batch_size = 32L, ...)

# S4 method for class 'neer_match.reasoning.RefutationModel'
suggest(object, left, right, count, batch_size = 32L, ...)

Arguments

object

A matching model object.

left

A data frame with the left records.

right

A data frame with the right records.

count

The number of returned suggestions from the right dataset for each record in the left dataset.

...

Additional arguments passed to the predict method.

batch_size

The batch size (integer).

Value

A data frame with the most similar records.

Examples

smap <- SimilarityMap(
  instructions = list(
    `score` = list("gaussian", "euclidean"),
    `platform` = list("osa", "indel")
  )
)
model <- NSMatchingModel(smap)
compile(model)
matching_data <- fuzzy_games_example_data()
fit(
  model,
  matching_data$left, matching_data$right, matching_data$matches,
  epochs = 1L,
  verbose = 0L
)
suggest(
  model, matching_data$left[1:2, ], matching_data$right[1:2, ],
  count = 2L
)
#>   left right prediction
#> 1    1     2  0.5349829
#> 0    1     1  0.5345929
#> 2    2     1  0.5349829
#> 3    2     2  0.5345929