I have an mxm kernel matrix, K, which is for the sake of simplicity, a linear kernel computed as pdist2(X,X), where X is mxn and the m dimension relates to feature vectors with n dimensions.
since n is large, I save computation time by precalculating K for all X.
Later on, I need to swap two of the features in X, say X_1 and X_5.
Can I somehow rearrange K, without having to recompute the entire matrix?
If
pvis your permutation vector andJ0=pdist2(X,X), thenshould get you the same answer as
If you are permuting the columns (I couldn’t quite tell from your question), then it seems like
J1andJ0should be equal…