@@ -40,11 +40,13 @@ class KernelPCovR(_BasePCA, LinearModel):
4040    ---------- 
4141    mixing : float, default=0.5 
4242        mixing parameter, as described in PCovR as :math:`{\alpha}` 
43+ 
4344    n_components : int, float or str, default=None 
4445        Number of components to keep. 
4546        if n_components is not set all components are kept:: 
4647
4748            n_components == n_samples 
49+ 
4850    svd_solver : {'auto', 'full', 'arpack', 'randomized'}, default='auto' 
4951        If auto : 
5052            The solver is selected by a default policy based on `X.shape` and 
@@ -62,6 +64,7 @@ class KernelPCovR(_BasePCA, LinearModel):
6264            0 < n_components < min(X.shape) 
6365        If randomized : 
6466            run randomized SVD by the method of Halko et al. 
67+ 
6568    regressor : {instance of `sklearn.kernel_ridge.KernelRidge`, `precomputed`, None}, default=None 
6669        The regressor to use for computing 
6770        the property predictions :math:`\hat{\mathbf{Y}}`. 
@@ -72,36 +75,47 @@ class KernelPCovR(_BasePCA, LinearModel):
7275
7376        If `precomputed`, we assume that the `y` passed to the `fit` function 
7477        is the regressed form of the targets :math:`{\mathbf{\hat{Y}}}`. 
78+ 
7579    kernel : "linear" | "poly" | "rbf" | "sigmoid" | "cosine" | "precomputed" 
7680        Kernel. Default="linear". 
81+ 
7782    gamma : float, default=None 
7883        Kernel coefficient for rbf, poly and sigmoid kernels. Ignored by other 
7984        kernels. 
85+ 
8086    degree : int, default=3 
8187        Degree for poly kernels. Ignored by other kernels. 
88+ 
8289    coef0 : float, default=1 
8390        Independent term in poly and sigmoid kernels. 
8491        Ignored by other kernels. 
92+ 
8593    kernel_params : mapping of str to any, default=None 
8694        Parameters (keyword arguments) and values for kernel passed as 
8795        callable object. Ignored by other kernels. 
96+ 
8897    center : bool, default=False 
8998            Whether to center any computed kernels 
99+ 
90100    fit_inverse_transform : bool, default=False 
91101        Learn the inverse transform for non-precomputed kernels. 
92102        (i.e. learn to find the pre-image of a point) 
103+ 
93104    tol : float, default=1e-12 
94105        Tolerance for singular values computed by svd_solver == 'arpack' 
95106        and for matrix inversions. 
96107        Must be of range [0.0, infinity). 
108+ 
97109    n_jobs : int, default=None 
98110        The number of parallel jobs to run. 
99111        :obj:`None` means 1 unless in a :obj:`joblib.parallel_backend` context. 
100112        ``-1`` means using all processors. 
113+ 
101114    iterated_power : int or 'auto', default='auto' 
102115        Number of iterations for the power method computed by 
103116        svd_solver == 'randomized'. 
104117        Must be of range [0, infinity). 
118+ 
105119    random_state : int, :class:`numpy.random.RandomState` instance or None, default=None 
106120        Used when the 'arpack' or 'randomized' solvers are used. Pass an int 
107121        for reproducible results across multiple function calls. 
@@ -111,18 +125,23 @@ class KernelPCovR(_BasePCA, LinearModel):
111125    pt__: numpy.darray of size :math:`({n_{components}, n_{components}})` 
112126           pseudo-inverse of the latent-space projection, which 
113127           can be used to contruct projectors from latent-space 
128+ 
114129    pkt_: numpy.ndarray of size :math:`({n_{samples}, n_{components}})` 
115130           the projector, or weights, from the input kernel :math:`\mathbf{K}` 
116131           to the latent-space projection :math:`\mathbf{T}` 
132+ 
117133    pky_: numpy.ndarray of size :math:`({n_{samples}, n_{properties}})` 
118134           the projector, or weights, from the input kernel :math:`\mathbf{K}` 
119135           to the properties :math:`\mathbf{Y}` 
136+ 
120137    pty_: numpy.ndarray of size :math:`({n_{components}, n_{properties}})` 
121138          the projector, or weights, from the latent-space projection 
122139          :math:`\mathbf{T}` to the properties :math:`\mathbf{Y}` 
140+ 
123141    ptx_: numpy.ndarray of size :math:`({n_{components}, n_{features}})` 
124142         the projector, or weights, from the latent-space projection 
125143         :math:`\mathbf{T}` to the feature matrix :math:`\mathbf{X}` 
144+ 
126145    X_fit_: numpy.ndarray of shape (n_samples, n_features) 
127146        The data used to fit the model. This attribute is used to build kernels 
128147        from new data. 
@@ -133,12 +152,10 @@ class KernelPCovR(_BasePCA, LinearModel):
133152    >>> from skmatter.decomposition import KernelPCovR 
134153    >>> from skmatter.preprocessing import StandardFlexibleScaler as SFS 
135154    >>> from sklearn.kernel_ridge import KernelRidge 
136-     >>> 
137155    >>> X = np.array([[-1, 1, -3, 1], [1, -2, 1, 2], [-2, 0, -2, -2], [1, 0, 2, -1]]) 
138156    >>> X = SFS().fit_transform(X) 
139157    >>> Y = np.array([[0, -5], [-1, 1], [1, -5], [-3, 2]]) 
140158    >>> Y = SFS(column_wise=True).fit_transform(Y) 
141-     >>> 
142159    >>> kpcovr = KernelPCovR( 
143160    ...     mixing=0.1, 
144161    ...     n_components=2, 
@@ -248,6 +265,7 @@ def fit(self, X, Y, W=None):
248265            means and scaled. If features are related, the matrix should be scaled 
249266            to have unit variance, otherwise :math:`\mathbf{X}` should be 
250267            scaled so that each feature has a variance of 1 / n_features. 
268+ 
251269        Y : numpy.ndarray, shape (n_samples, n_properties) 
252270            Training data, where n_samples is the number of samples and 
253271            n_properties is the number of properties 
@@ -256,6 +274,7 @@ def fit(self, X, Y, W=None):
256274            means and scaled. If features are related, the matrix should be scaled 
257275            to have unit variance, otherwise :math:`\mathbf{Y}` should be 
258276            scaled so that each feature has a variance of 1 / n_features. 
277+ 
259278        W : numpy.ndarray, shape (n_samples, n_properties) 
260279            Regression weights, optional when regressor=`precomputed`. If not 
261280            passed, it is assumed that `W = np.linalg.lstsq(K, Y, self.tol)[0]` 
@@ -463,6 +482,7 @@ def score(self, X, y):
463482        ---------- 
464483        X : numpy.ndarray 
465484            independent (predictor) variable 
485+ 
466486        Y : numpy.ndarray 
467487            dependent (response) variable 
468488
0 commit comments