tensorly.metrics
.correlation_index
- correlation_index(factors_1: list, factors_2: list, tol: float = 5e-16, method: str = 'stacked') float [source]
CorrIndex implementation to assess tensor decomposition outputs. From [1] Sobhani et al 2022 (https://doi.org/10.1016/j.sigpro.2022.108457). Metric is scaling and column-permutation invariant, wherein each column is a factor.
- Parameters:
- factors_1list
The loading/factor matrices [A_1 … A_N] for a low-rank tensor from its factors, output from first decomposition
- factors_2list
The loading/factor matrices [A_1 … A_N] for a low-rank tensor from its factors, output from second decomposition
- tolfloat, optional
Precision threshold below which to call the CorrIndex score 0, by default 5e-16
- methodstr, optional
Method to obtain the CorrIndex by comparing the A matrices from two decompositions, by default ‘stacked’. Possible options are:
- ‘stacked’The original method implemented in [1]. Here all A matrices from the same decomposition are
vertically concatenated, building a big A matrix for each decomposition.
- ‘max_score’This computes the CorrIndex for each pair of A matrices (i.e. between A_1 in factors_1 and
factors_2, between A_2 in factors_1 and factors_2, and so on). Then the max score is selected (the most conservative approach). In other words, it selects the max score among the CorrIndexes computed dimension-wise.
‘min_score’ : Similar to ‘max_score’, but the min score is selected (the least conservative approach).
‘avg_score’ : Similar to ‘max_score’, but the avg score is selected.
- Returns:
- scorefloat
CorrIndex metric [0,1]; lower score indicates higher similarity between matrices