Skip to contents

Calculate distances and similarity from features to prototype. The compute function does this and more when you have multiple prototypes.

Usage

calculateDistSim(data, P, w, g, r = 1)

Arguments

data

a data frame, as returned by the `make_data()` function

P

a K-sized vector of binary features (i.e., the prototype)

w

a K-sized vector of attention weights

g

a sensitivity parameter, a number larger than zero

r

the type of distance, 1 for Manhattan, 2 for Euclidean

Value

a data frame with distance and similarity