etna.analysis.get_correlation_matrix#

get_correlation_matrix(ts: TSDataset, columns: List[str] | None = None, segments: List[str] | None = None, method: str = 'pearson') ndarray[source]#

Compute pairwise correlation of timeseries for selected segments.

Parameters:
  • ts (TSDataset) – TSDataset with timeseries data

  • columns (List[str] | None) – Columns to use, if None use all columns

  • segments (List[str] | None) – Segments to use

  • method (str) –

    Method of correlation:

    • pearson: standard correlation coefficient

    • kendall: Kendall Tau correlation coefficient

    • spearman: Spearman rank correlation

Returns:

Correlation matrix

Return type:

np.ndarray