The linear (i.e., dot-product) kernel. Notes ----- For input vectors :math:`\mathbf{x}` and :math:`\mathbf{y}`, the linear kernel is: .. math:: k(\mathbf{x}, \mathbf{y}) = \mathbf{x}^\\top \mathbf{y} + c_0 Parameters --
(self, c0=0)
| 71 | |
| 72 | class LinearKernel(KernelBase): |
| 73 | def __init__(self, c0=0): |
| 74 | """ |
| 75 | The linear (i.e., dot-product) kernel. |
| 76 | |
| 77 | Notes |
| 78 | ----- |
| 79 | For input vectors :math:`\mathbf{x}` and :math:`\mathbf{y}`, the linear |
| 80 | kernel is: |
| 81 | |
| 82 | .. math:: |
| 83 | |
| 84 | k(\mathbf{x}, \mathbf{y}) = \mathbf{x}^\\top \mathbf{y} + c_0 |
| 85 | |
| 86 | Parameters |
| 87 | ---------- |
| 88 | c0 : float |
| 89 | An "inhomogeneity" parameter. When `c0` = 0, the kernel is said to be |
| 90 | homogenous. Default is 1. |
| 91 | """ |
| 92 | super().__init__() |
| 93 | self.hyperparameters = {"id": "LinearKernel"} |
| 94 | self.parameters = {"c0": c0} |
| 95 | |
| 96 | def _kernel(self, X, Y=None): |
| 97 | """ |