similarities: Similarities for sparse and dense 2d representations

Description Usage Arguments

Description

Similarity counterparts of distances, which see. Generally similarities are computed from their distance counterparts through s=1-d or s=1/(1+d), but this need not always be the case. See the source code for the exact computation.

Usage

1
2
3
4
5
sim_cosine(x, y = NULL, ptrans = "l2", strans = NULL, by = c("primary",
  "secondary", "row", "column"), ref_names = NULL)

sim_euclidean(x, y = NULL, ptrans = NULL, strans = NULL,
  by = c("primary", "secondary", "row", "column"), ref_names = NULL)

Arguments

x

sparse or dense objects supported by simdist. See simdist-package for description of supported types and related terminology.

y

sparse or dense objects supported by simdist. See simdist-package for description of supported types and related terminology.

ptrans

Primary and secondary transformations. Can be either a function, string or a numeric vector. When a function, it must take 3 arguments - an object supported by simdist distance measures, names of a dimension ("primary" or "secondary") and logical na.rm. When a string it must name a transformation function without the semantic prefix (norm_, scale_ or trans_); see link{transformations}. When numeric vector it specifies weights to scale along the corresponding dimension.

strans

Primary and secondary transformations. Can be either a function, string or a numeric vector. When a function, it must take 3 arguments - an object supported by simdist distance measures, names of a dimension ("primary" or "secondary") and logical na.rm. When a string it must name a transformation function without the semantic prefix (norm_, scale_ or trans_); see link{transformations}. When numeric vector it specifies weights to scale along the corresponding dimension.

by

Dimension along which to perform distance computation. For all supported data structures computation along primary dimension is more or as efficient than along the secondary dimension.

ref_names

reference names for secondary entries. By default both x and y secondary names are used. Secondary entries not in ref_names are discarded from x and y.


vspinu/simdist documentation built on May 3, 2019, 7:09 p.m.