predict.problink_em {reclin2}R Documentation

Calculate weights and probabilities for pairs

Description

Calculate weights and probabilities for pairs

Usage

## S3 method for class 'problink_em'
predict(
  object,
  pairs = newdata,
  newdata = NULL,
  type = c("weights", "mpost", "probs", "all"),
  binary = FALSE,
  add = FALSE,
  comparators,
  inplace = FALSE,
  new_name = NULL,
  ...
)

Arguments

object

an object of type problink_em as produced by problink_em.

pairs

a object with pairs for which to calculate weights.

newdata

an alternative name for the pairs argument. Specify newdata or pairs.

type

a character vector of length one specifying what to calculate. See results for more information.

binary

convert comparison vectors to binary vectors using the comparison function in comparators.

add

add the predictions to the original pairs object.

comparators

a list of comparison functions (see compare_pairs). When missing attr(pairs, 'comparators') is used.

inplace

logical indicating whether pairs should be modified in place. When pairs is large this can be more efficient.

new_name

name of new object to assign the pairs to on the cluster nodes (only relevant when pairs is of type cluster_pairs.

...

unused.

Value

When pairs is of type pairs, returns a data.table with either the .x and .y columns from pairs (when add = FALSE) or all columns of pairs. To these columns are added:

In case of compare_pairs.cluster_pairs, compare_pair.pairs is called on each cluster node and the resulting pairs are assigned to new_name in the environment reclin_env. When new_name is not given (or equal to NULL) the original pairs on the nodes are overwritten.


[Package reclin2 version 0.5.0 Index]