|  | 
| 22 | 22 | 
 | 
| 23 | 23 | 
 | 
| 24 | 24 | class KernelPCovC(LinearClassifierMixin, _BaseKPCov): | 
| 25 |  | -    r"""Kernel Principal Covariates Classification is a modification on the Principal | 
| 26 |  | -    Covariates Classification proposed in [Jorgensen2025]_. It determines a latent-space | 
| 27 |  | -    projection :math:`\mathbf{T}` which minimizes a combined loss in supervised and unsupervised | 
|  | 25 | +    r"""Kernel Principal Covariates Classification (KPCovC). | 
|  | 26 | +
 | 
|  | 27 | +    KPCovC is a modification on the PrincipalCovariates Classification | 
|  | 28 | +    proposed in [Jorgensen2025]_.  It determines  a latent-space projection | 
|  | 29 | +    :math:`\mathbf{T}` which minimizes a combined loss in supervised and unsupervised | 
| 28 | 30 |     tasks in the reproducing kernel Hilbert space (RKHS). | 
| 29 | 31 | 
 | 
| 30 | 32 |     This projection is determined by the eigendecomposition of a modified gram matrix | 
| @@ -69,16 +71,22 @@ class KernelPCovC(LinearClassifierMixin, _BaseKPCov): | 
| 69 | 71 |             run randomized SVD by the method of Halko et al. | 
| 70 | 72 | 
 | 
| 71 | 73 |     classifier: `estimator object` or `precomputed`, default=None | 
| 72 |  | -        classifier for computing :math:`{\mathbf{Z}}`. The classifier should be one of | 
| 73 |  | -        `sklearn.linear_model.LogisticRegression`, `sklearn.linear_model.LogisticRegressionCV`, | 
| 74 |  | -        `sklearn.svm.LinearSVC`, `sklearn.discriminant_analysis.LinearDiscriminantAnalysis`, | 
| 75 |  | -        `sklearn.linear_model.RidgeClassifier`, `sklearn.linear_model.RidgeClassifierCV`, | 
| 76 |  | -        `sklearn.linear_model.SGDClassifier`, or `Perceptron`. | 
|  | 74 | +        classifier for computing :math:`{\mathbf{Z}}`. The classifier should be | 
|  | 75 | +        one of the following: | 
|  | 76 | +
 | 
|  | 77 | +        - ``sklearn.linear_model.LogisticRegression()`` | 
|  | 78 | +        - ``sklearn.linear_model.LogisticRegressionCV()`` | 
|  | 79 | +        - ``sklearn.svm.LinearSVC()`` | 
|  | 80 | +        - ``sklearn.discriminant_analysis.LinearDiscriminantAnalysis()`` | 
|  | 81 | +        - ``sklearn.linear_model.RidgeClassifier()`` | 
|  | 82 | +        - ``sklearn.linear_model.RidgeClassifierCV()`` | 
|  | 83 | +        - ``sklearn.linear_model.Perceptron()`` | 
|  | 84 | +
 | 
| 77 | 85 |         If a pre-fitted classifier is provided, it is used to compute :math:`{\mathbf{Z}}`. | 
| 78 | 86 |         If None, ``sklearn.linear_model.LogisticRegression()`` | 
| 79 | 87 |         is used as the classifier. | 
| 80 | 88 | 
 | 
| 81 |  | -    kernel : {'linear', 'poly', 'rbf', 'sigmoid', 'precomputed'} or callable, default='linear' | 
|  | 89 | +    kernel : {"linear", "poly", "rbf", "sigmoid", "precomputed"} or callable, default="linear" | 
| 82 | 90 |         Kernel. | 
| 83 | 91 | 
 | 
| 84 | 92 |     gamma : {'scale', 'auto'} or float, default=None | 
| @@ -223,8 +231,9 @@ def __init__( | 
| 223 | 231 |         self.classifier = classifier | 
| 224 | 232 | 
 | 
| 225 | 233 |     def fit(self, X, Y, W=None): | 
| 226 |  | -        r"""Fit the model with X and Y. A computed kernel K is | 
| 227 |  | -        derived from X, and W is taken from the | 
|  | 234 | +        r"""Fit the model with X and Y. | 
|  | 235 | +
 | 
|  | 236 | +        A computed kernel K is derived from X, and W is taken from the | 
| 228 | 237 |         coefficients of a linear classifier fit between K and Y to compute | 
| 229 | 238 |         Z: | 
| 230 | 239 | 
 | 
| @@ -265,7 +274,7 @@ def fit(self, X, Y, W=None): | 
| 265 | 274 | 
 | 
| 266 | 275 |         super().fit(X) | 
| 267 | 276 | 
 | 
| 268 |  | -        K = super()._get_kernel(X) | 
|  | 277 | +        K = self._get_kernel(X) | 
| 269 | 278 | 
 | 
| 270 | 279 |         if self.center: | 
| 271 | 280 |             self.centerer_ = KernelNormalizer() | 
|  | 
0 commit comments