Skip to content

polynomial_kernel_interdependence

Bases: numerical_kernel_based_interdependence

A kernel-based interdependence class using the polynomial kernel.

Notes

Polynomial Kernel:

\[
    \begin{equation}
    \text{kernel}(\mathbf{x}, \mathbf{y} | c, d) = \left(\left\langle \mathbf{x}, \mathbf{y} \right \rangle +c \right)^d.
    \end{equation}
\]

Attributes:

Name Type Description
kernel Callable

The polynomial kernel function.

Methods:

Name Description
__init__

Initializes the polynomial kernel interdependence function.

Source code in tinybig/interdependence/numerical_kernel_interdependence.py
class polynomial_kernel_interdependence(numerical_kernel_based_interdependence):
    r"""
        A kernel-based interdependence class using the polynomial kernel.

        Notes
        ----------
        __Polynomial Kernel:__

        $$
            \begin{equation}
            \text{kernel}(\mathbf{x}, \mathbf{y} | c, d) = \left(\left\langle \mathbf{x}, \mathbf{y} \right \rangle +c \right)^d.
            \end{equation}
        $$

        Attributes
        ----------
        kernel : Callable
            The polynomial kernel function.

        Methods
        -------
        __init__(...)
            Initializes the polynomial kernel interdependence function.
    """
    def __init__(self, name: str = 'polynomial_kernel_interdependence', c: float = 0.0, d: int = 1, *args, **kwargs):
        """
            Initializes the polynomial kernel interdependence function.

            Parameters
            ----------
            name : str, optional
                Name of the interdependence function. Defaults to 'polynomial_kernel_interdependence'.
            c : float, optional
                Coefficient of the polynomial kernel. Defaults to 0.0.
            d : int, optional
                Degree of the polynomial kernel. Defaults to 1.
            *args : tuple
                Additional positional arguments for the parent class.
            **kwargs : dict
                Additional keyword arguments for the parent class.
        """
        polynomial_kernel_func = functools.partial(polynomial_kernel, c=c, d=d)
        super().__init__(kernel=polynomial_kernel_func, name=name, *args, **kwargs)

__init__(name='polynomial_kernel_interdependence', c=0.0, d=1, *args, **kwargs)

Initializes the polynomial kernel interdependence function.

Parameters:

Name Type Description Default
name str

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

'polynomial_kernel_interdependence'
c float

Coefficient of the polynomial kernel. Defaults to 0.0.

0.0
d int

Degree of the polynomial kernel. Defaults to 1.

1
*args tuple

Additional positional arguments for the parent class.

()
**kwargs dict

Additional keyword arguments for the parent class.

{}
Source code in tinybig/interdependence/numerical_kernel_interdependence.py
def __init__(self, name: str = 'polynomial_kernel_interdependence', c: float = 0.0, d: int = 1, *args, **kwargs):
    """
        Initializes the polynomial kernel interdependence function.

        Parameters
        ----------
        name : str, optional
            Name of the interdependence function. Defaults to 'polynomial_kernel_interdependence'.
        c : float, optional
            Coefficient of the polynomial kernel. Defaults to 0.0.
        d : int, optional
            Degree of the polynomial kernel. Defaults to 1.
        *args : tuple
            Additional positional arguments for the parent class.
        **kwargs : dict
            Additional keyword arguments for the parent class.
    """
    polynomial_kernel_func = functools.partial(polynomial_kernel, c=c, d=d)
    super().__init__(kernel=polynomial_kernel_func, name=name, *args, **kwargs)