Skip to content

Commit df8fa2e

Browse files
committed
Making PCovC accessible via API reference on docs for now.
1 parent f66aa9d commit df8fa2e

File tree

4 files changed

+30
-21
lines changed

4 files changed

+30
-21
lines changed

docs/src/references/index.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ API Reference
1111
selection
1212
linear_models
1313
clustering
14-
decomposition
14+
pcovc_decomposition
15+
pcovr_decomposition
1516
metrics
1617
neighbors
1718
datasets
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
Principal Covariates Classification (PCovC)
2+
================================================================
3+
4+
.. _PCovC-api:
5+
6+
PCovC
7+
-----
8+
9+
.. autoclass:: skmatter.decomposition.PCovC
10+
:show-inheritance:
11+
:special-members:
12+
13+
.. automethod:: fit
14+
15+
.. automethod:: _fit_feature_space
16+
.. automethod:: _fit_sample_space
17+
18+
.. automethod:: transform
19+
.. automethod:: predict
20+
.. automethod:: inverse_transform
21+
.. automethod:: decision_function
22+
.. automethod:: score

docs/src/references/decomposition.rst renamed to docs/src/references/pcovr_decomposition.rst

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
Principal Covariates Regression (PCovR)
2-
=======================================
2+
================================================================
33

44
.. _PCovR-api:
55

@@ -19,20 +19,6 @@ PCovR
1919
.. automethod:: predict
2020
.. automethod:: inverse_transform
2121
.. automethod:: score
22-
.. _PCovR-api:
23-
24-
PCovC
25-
-----
26-
27-
.. autoclass:: skmatter.decomposition.PCovC
28-
:show-inheritance:
29-
:special-members:
30-
31-
.. automethod:: fit
32-
.. automethod:: transform
33-
.. automethod:: predict
34-
.. automethod:: inverse_transform
35-
.. automethod:: score
3622

3723
.. _KPCovR-api:
3824

src/skmatter/decomposition/_pcovc.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -158,20 +158,20 @@ class PCovC(LinearClassifierMixin, _BasePCov):
158158
the projector, or weights, from the input space :math:`\mathbf{X}`
159159
to the latent-space projection :math:`\mathbf{T}`
160160
161-
pxz_ : ndarray of size :math: `({n_{features}, })` or `({n_{features}, n_{classes}})`
161+
pxz_ : ndarray of size :math:`({n_{features}, })` or :math:`({n_{features}, n_{classes}})`
162162
the projector, or weights, from the input space :math:`\mathbf{X}`
163163
to the class confidence scores :math:`\mathbf{Z}`
164164
165-
ptz_ : ndarray of size :math: `({n_{components}, })` or `({n_{components}, n_{classes}})`
165+
ptz_ : ndarray of size :math:`({n_{components}, })` or :math:`({n_{components}, n_{classes}})`
166166
the projector, or weights, from the latent-space projection
167167
:math:`\mathbf{T}` to the class confidence scores :math:`\mathbf{Z}`
168168
169-
explained_variance_ : ndarray of shape (n_components,)
169+
explained_variance_ : numpy.ndarray of shape (n_components,)
170170
The amount of variance explained by each of the selected components.
171171
Equal to n_components largest eigenvalues
172172
of the PCovC-modified covariance matrix of :math:`\mathbf{X}`.
173173
174-
singular_values_ : ndarray of shape (n_components,)
174+
singular_values_ : numpy.ndarray of shape (n_components,)
175175
The singular values corresponding to each of the selected components.
176176
177177
Examples
@@ -315,7 +315,7 @@ def _fit_feature_space(self, X, Y, Z):
315315
\mathbf{\tilde{C}} = \alpha \mathbf{X}^T \mathbf{X} +
316316
(1 - \alpha) \left(\left(\mathbf{X}^T
317317
\mathbf{X}\right)^{-\frac{1}{2}} \mathbf{X}^T
318-
\mathbf{Z}\mathbf{Z}}^T \mathbf{X} \left(\mathbf{X}^T
318+
\mathbf{Z}\mathbf{Z}^T \mathbf{X} \left(\mathbf{X}^T
319319
\mathbf{X}\right)^{-\frac{1}{2}}\right)
320320
321321
where

0 commit comments

Comments
 (0)