Skip to content

Commit e144cdb

Browse files
committed
Adding PCovC code,examples, as well as testing suite
1 parent 722d582 commit e144cdb

File tree

7 files changed

+2780
-4
lines changed

7 files changed

+2780
-4
lines changed

examples/pcovc/PCovC-BreastCancerDataset.ipynb

Lines changed: 367 additions & 0 deletions
Large diffs are not rendered by default.

examples/pcovc/PCovC-IrisDataset.ipynb

Lines changed: 344 additions & 0 deletions
Large diffs are not rendered by default.

src/skmatter/decomposition/_pcovr.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -409,6 +409,7 @@ def _fit_sample_space(self, X, Y, Yhat, W):
409409
\mathbf{U}_\mathbf{\tilde{K}}^T \mathbf{Y}
410410
"""
411411
Kt = pcovr_kernel(mixing=self.mixing, X=X, Y=Yhat)
412+
#This is the gram matrix K
412413

413414
if self.fit_svd_solver_ == "full":
414415
U, S, Vt = self._decompose_full(Kt)
@@ -429,9 +430,9 @@ def _fit_sample_space(self, X, Y, Yhat, W):
429430
S_sqrt_inv = np.diagflat([1.0 / np.sqrt(s) if s > self.tol else 0.0 for s in S])
430431
T = Vt.T @ S_sqrt_inv
431432

432-
self.pxt_ = P @ T
433-
self.pty_ = T.T @ Y
434-
self.ptx_ = T.T @ X
433+
self.pxt_ = P @ T # equation 1 in fit_sample_space read the docs
434+
self.pty_ = T.T @ Y #equation 2 in fit_sample_space read the docs
435+
self.ptx_ = T.T @ X # equation 3 in fit_sample_space read the docs
435436

436437
def _decompose_truncated(self, mat):
437438
if not 1 <= self.n_components_ <= min(self.n_samples_in_, self.n_features_in_):

0 commit comments

Comments
 (0)