cosine_dist: Computes the cosine similarity between numeric vectors

View source: R/jmotif.R

cosine_distR Documentation

Computes the cosine similarity between numeric vectors

Description

Computes the cosine similarity between numeric vectors

Usage

cosine_dist(m)

Arguments

m

the data matrix

Value

Returns the cosine similarity

Examples

a <- c(2, 1, 0, 2, 0, 1, 1, 1)
b <- c(2, 1, 1, 1, 1, 0, 1, 1)
sim <- cosine_dist(rbind(a,b))

jMotif/jmotif-R documentation built on Sept. 27, 2022, 4:31 p.m.