quanda.utils.functions.correlations module¶
Correlation functions.
- quanda.utils.functions.correlations.kendall_rank_corr(tensor1, tensor2)[source]¶
Calculate torchmetrics kendall_corrcoef function.
The difference is that the input tensors are transposed before passing to the function.
- Parameters:
tensor1 (torch.Tensor) – The input tensors to compute the correlation coefficient.
tensor2 (torch.Tensor) – The input tensors to compute the correlation coefficient.
- Returns:
The Kendall Rank correlation coefficient between the two tensors.
- Return type:
torch.Tensor
- quanda.utils.functions.correlations.spearman_rank_corr(tensor1, tensor2)[source]¶
Calculate torchmetrics spearman_corrcoef function.
The difference is that the input tensors are transposed before passing to the function.
- Parameters:
tensor1 (torch.Tensor) – The input tensors to compute the correlation coefficient.
tensor2 (torch.Tensor) – The input tensors to compute the correlation coefficient.
- Returns:
The Spearman correlation coefficient between the two tensors.
- Return type:
torch.Tensor