calculate_distance#

calculate_distance(vec1: array, vec2: array, range_per_feature: array) float[source]#

Calculate distance between two vectors using Gower’s method.

Parameters
vec1np.array

First vector.

vec2np.array

Second vector.

range_per_featurenp.array

Range of each numeric feature or -1 for categorical.

Returns
float

representing Gower’s distance between the two vectors.