Skip to content

pearson_correlation_interdependence

Bases: statistical_kernel_based_interdependence

A statistical kernel-based interdependence class using the Pearson correlation kernel.

Notes

Pearson Correlation based Kernel:

$$ \begin{equation} \text{kernel}(\mathbf{x}, \mathbf{y}) = \frac{\sum_{i=1}^b (\frac{\mathbf{x}(i) - \mu_x}{\sigma_x} ) (\frac{\mathbf{y}(i) - \mu_y}{\sigma_y} )}{b}, \end{equation} $$ where \(\mu_x, \mu_y, \sigma_x, \sigma_y\) are the mean and std.

Attributes:

Name Type Description
kernel Callable

The Pearson correlation kernel function.

Methods:

Name Description
__init__

Initializes the Pearson correlation interdependence function.

Source code in tinybig/interdependence/statistical_kernel_interdependence.py
class pearson_correlation_interdependence(statistical_kernel_based_interdependence):
    r"""
        A statistical kernel-based interdependence class using the Pearson correlation kernel.

        Notes
        ----------
        __Pearson Correlation based Kernel:__

        $$
            \begin{equation}
            \text{kernel}(\mathbf{x}, \mathbf{y}) = \frac{\sum_{i=1}^b (\frac{\mathbf{x}(i) - \mu_x}{\sigma_x} ) (\frac{\mathbf{y}(i) - \mu_y}{\sigma_y} )}{b},
            \end{equation}
        $$
        where $\mu_x, \mu_y, \sigma_x, \sigma_y$ are the mean and std.

        Attributes
        ----------
        kernel : Callable
            The Pearson correlation kernel function.

        Methods
        -------
        __init__(...)
            Initializes the Pearson correlation interdependence function.
    """
    def __init__(self, name: str = 'pearson_correlation_interdependence', *args, **kwargs):
        """
            Initializes the Pearson correlation interdependence function.

            Parameters
            ----------
            name : str, optional
                Name of the interdependence function. Defaults to 'pearson_correlation_interdependence'.
            *args : tuple
                Additional positional arguments for the parent class.
            **kwargs : dict
                Additional keyword arguments for the parent class.
        """
        super().__init__(kernel=batch_pearson_correlation_kernel, name=name, *args, **kwargs)

__init__(name='pearson_correlation_interdependence', *args, **kwargs)

Initializes the Pearson correlation interdependence function.

Parameters:

Name Type Description Default
name str

Name of the interdependence function. Defaults to 'pearson_correlation_interdependence'.

'pearson_correlation_interdependence'
*args tuple

Additional positional arguments for the parent class.

()
**kwargs dict

Additional keyword arguments for the parent class.

{}
Source code in tinybig/interdependence/statistical_kernel_interdependence.py
def __init__(self, name: str = 'pearson_correlation_interdependence', *args, **kwargs):
    """
        Initializes the Pearson correlation interdependence function.

        Parameters
        ----------
        name : str, optional
            Name of the interdependence function. Defaults to 'pearson_correlation_interdependence'.
        *args : tuple
            Additional positional arguments for the parent class.
        **kwargs : dict
            Additional keyword arguments for the parent class.
    """
    super().__init__(kernel=batch_pearson_correlation_kernel, name=name, *args, **kwargs)