h2o.stringdist: Compute element-wise string distances between two H2OFrames

Description Usage Arguments Examples

View source: R/frame.R

Description

Compute element-wise string distances between two H2OFrames. Both frames need to have the same shape (N x M) and only contain string/factor columns. Return a matrix (H2OFrame) of shape N x M.

Usage

1
2
3
4
5
6
h2o.stringdist(
  x,
  y,
  method = c("lv", "lcs", "qgram", "jaccard", "jw", "soundex"),
  compare_empty = TRUE
)

Arguments

x

An H2OFrame

y

A comparison H2OFrame

method

A string identifier indicating what string distance measure to use. Must be one of: "lv" - Levenshtein distance "lcs" - Longest common substring distance "qgram" - q-gram distance "jaccard" - Jaccard distance between q-gram profiles "jw" - Jaro, or Jaro-Winker distance "soundex" - Distance based on soundex encoding

compare_empty

if set to FALSE, empty strings will be handled as NaNs

Examples

1
2
3
4
5
6
7
## Not run: 
h2o.init()
x <- as.h2o(c("Martha", "Dwayne", "Dixon"))
y <- as.character(as.h2o(c("Marhta", "Duane", "Dicksonx")))
h2o.stringdist(x, y, method = "jw")

## End(Not run)

h2o documentation built on Oct. 10, 2021, 1:08 a.m.