ensign.decomp_diff.decomp_diff

decomp_diff(decomps, analyses=None, modes=None, components=None, threshold=0.6, ignore_weights=False, metric='cosine')[source]

Determine differences(similarities) between decompositions.

Parameters
decomps[ensign.CPDecomp]

A list of CPDecomp objects, one for each decomposition to be compared.

analyses[string]

A list of analysis types. One or more of: ‘number’, ‘mapping’, ‘similarity’

modes[int]

A list of mode identifiers to be used in the comparison. Default: all modes are compared.

components[[int]]

One per decomposition, a list of component identifiers to be used in comparison. Default: all components are compared for every decomposition.

thresholdfloat

The threshold value that determines similarity when determining similar components

ignore_weightsbool

Either ignore (True) or use (False) decomposition weights when comparing decompositions. Default: False

metricstring

The name of metric to be used in comparisons. Can be either a metric from scipy.spatial.distance, or a custom metric defined in ensign.distance.

Returns
resultdict
The key to the dictionary is the analysis type, the value is the result of that analysis.

‘number’ : float - The result of comparing each decomposition ‘mapping’ : dict - For each component in decomp[0] show the most similar component(s) in “

“decomp[1] within the given threshold. A unique component in decomp[0] will ” “map to an empty list. Also, map components from decomp[1] with no similar ” “component in decomp[0], within the threshold.

‘similarity’numpy.ndarray - The similarity matrix showing comparision between all specified

components of decomp[0] and all specified components of decomp[1]