| metric_hamming_distance | R Documentation |
Computes hamming distance.
metric_hamming_distance(actuals, predictions)
actuals |
actual value |
predictions |
predicted value |
Hamming distance is for comparing two binary strings. It is the number of bit positions in which two bits are different.
hamming distance: float
## Not run:
actuals = tf$constant(as.integer(c(1, 1, 0, 0, 1, 0, 1, 0, 0, 1)), dtype=tf$int32)
predictions = tf$constant(as.integer(c(1, 0, 0, 0, 1, 0, 0, 1, 0, 1)),dtype=tf$int32)
result = metric_hamming_distance(actuals, predictions)
paste('Hamming distance: ', result$numpy())
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.