Skip to contents

Distance metric: Hamming distance

Usage

hamming_distance(df, weights_row)

Arguments

df

Dataframe containing one subjectkey column in the first column and at least 1 categorical data column. All feature data should be categorical.

weights_row

Single-row dataframe where the column names contain the column names in df and the row contains the corresponding weights.

Value

distance_matrix A distance matrix.