# forum.alglib.net

ALGLIB forum
 It is currently Wed Jul 26, 2017 8:38 pm

 All times are UTC

### Forum rules

1. This forum can be used for discussion of both ALGLIB-related and general numerical analysis questions
2. This forum is English-only - postings in other languages will be removed.

 Page 1 of 1 [ 3 posts ]
 Print view Previous topic | Next topic
Author Message
 Post subject: Seed PCA calculation with shared basis vectorsPosted: Sat Jul 01, 2017 7:51 pm

Joined: Fri May 24, 2013 3:45 pm
Posts: 3
I have many similar datasets that I currently use PCA to reduce dimensionality on, storing the basis vectors and variance values for each of these data sets. I would like to be able to utilize the similarity of the datasets to reduce how much data I end up storing by running the PCA algorithm on the entire dataset, generating a small number of basis vectors that would be shared for all data sets.

My thought on how to implement this is as follows:
Create a large matrix of all sample points
Run truncated subspace PCA to generate N basis vectors
No need to retain variance values; just the N basis vectors

For each smaller dataset:
Create matrix of small dataset sample points (same number of rows as original)
Project dataset onto original basis vectors, reducing the dimensionality somewhat. (How could I calculate the variance values from this?)
Run PCA algorithm on dataset to generate additional basis vectors and variance values.
Store the additional basis vectors and the full set of variance values for each smaller dataset.

Does this seem like a reasonable way to approach the problem? I think that the subset basis vectors will be orthogonal to the shared basis vectors, but this is not a requirement for my application. Thanks!

Top

 Post subject: Re: Seed PCA calculation with shared basis vectorsPosted: Wed Jul 05, 2017 1:44 pm

Joined: Fri May 07, 2010 7:06 am
Posts: 775
Hi!

The general approach makes sense, I just want to clarify a few details. (Linear algebra for such problems is often confusing - sometimes you have to work with orthogonal basis, sometimes with its orthogonal complement.)

First part of your proposal is completely right. You select small number N, small fraction of your dataset dimensionality, and perform truncated PCA (just N vectors instead of dim(dataset)) on large combined dataset.

Second part is a bit tricky. Before you start with PCA you should project your smaller dataset onto shared basis and subtract this projection from dataset. After such transformation, perform ever one more truncated PCA to get M "subset vectors". As result, your subset basis will be orthogonal to the shared basis (projection-subtraction step enforces this property) - and I think that it is quite important property.

Top

 Post subject: Re: Seed PCA calculation with shared basis vectorsPosted: Wed Jul 05, 2017 8:34 pm

Joined: Fri May 24, 2013 3:45 pm
Posts: 3
Thank you, I think that is exactly what I needed to know. Thanks!

Top

 Display posts from previous: All posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost timeSubject AscendingDescending
 Page 1 of 1 [ 3 posts ]

 All times are UTC

#### Who is online

Users browsing this forum: Bing [Bot] and 1 guest

 You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot post attachments in this forum

Search for: