cassiopeia.solver.dissimilarity_functions.hamming_distance#

cassiopeia.solver.dissimilarity_functions.hamming_distance(s1, s2, ignore_missing_state=False, missing_state_indicator=-1)[source]#

Computes the vanilla hamming distance between two samples.

Counts the number of positions that two samples disagree at. A user can optionally specify to ignore missing data.

Parameters:
s1 <class ‘int’>

The first sample

s2 <class ‘int’>

The second sample

ignore_missing_state bool (default: False)

Ignore comparisons where one is the missing state indicator

missing_state_indicator int (default: -1)

Indicator for missing data.

Return type:

int

Returns:

The number of positions two nodes disagree at.