skmeans_xdist: Cosine Cross-Distances

View source: R/skmeans.R

skmeans_xdistR Documentation

Cosine Cross-Distances

Description

Compute cosine cross-distances between the rows of matrices.

Usage

skmeans_xdist(x, y = NULL)

Arguments

x

A numeric data matrix. Can be a dense matrix, simple triplet matrix (package slam), or a dgTMatrix (package Matrix).

y

NULL (default), or as for x. The default is equivalent to taking y as x (but more efficient).

Value

A dense matrix d with entry d_{ij} = 1 - \cos(x_i, y_j) the cosine distance between the i-th row x_i of x and the j-th row y_j of y.


skmeans documentation built on Sept. 11, 2024, 9:02 p.m.