cassiopeia.solver.dissimilarity_functions.weighted_hamming_similarity#

cassiopeia.solver.dissimilarity_functions.weighted_hamming_similarity(s1, s2, missing_state_indicator, weights=None)[source]#

A function to return the weighted number of (non-missing) character/state mutations shared by two samples.

Parameters:
s1 List[int]

Character states of the first sample

s2 List[int]

Character states of the second sample

missing_state_indicator int

The character representing missing values

weights Optional[Dict[int, Dict[int, float]]] (default: None)

A set of optional weights to weight the similarity of a mutation

Return type:

float

Returns:

The weighted number of shared mutations between two samples