18

I am implementing PCA and LDA for compression and classification respectively (implementing both an LDA for compression and classification).

I have the code written and everything works. What I need to know, for the report, is what the general definition of reconstruction error is.

I can find a lot of math, and uses of it in the literature... but what I really need is a bird's eye view / plain word definition, so I can adapt it to the report.

Chris
  • 336
  • Reconstruction error is the concept that applies (from your list) only to PCA, not to LDA or naive Bayes. Are you asking about what reconstruction error in PCA means, or do you want some "general definition" that would also apply to LDA and naive Bayes? – amoeba Feb 05 '16 at 23:05
  • Do you know both? The report involves both PCA and LDA as pertains to compression of data, so I have to have some kind of answer w.r.t. both PCA and LDA...but not necessarily NB. So, maybe the detailed pca-specific version...and the general idea, so I can apply it to LDA as well as I can. Then, I'd have enough knowledge to search on google more effectively if I run into snags... – Chris Feb 05 '16 at 23:11
  • This question might better get closed because general definition of reconstruction error is elusively broad. – ttnphns Feb 10 '16 at 18:04
  • 2
    @ttnphns, I don't think it's too broad. I think the question can be reformulated as "Can we apply the PCA notion of reconstruction error to LDA?" and I think it is an interesting and on-topic question (+1). I will try to write an answer myself if I find time. – amoeba Feb 10 '16 at 18:09
  • 1
    @amoeba, in the formulation suggested by you the question indeed receives light. Yes, it is possible to write an answer then (and I may expect yours will be good). A tricky thing about "what is being reconstructed" in LDA is issue what is being considered as DVs and what IVs in LDA. – ttnphns Feb 10 '16 at 18:18

5 Answers5

13

For PCA what you do is that you project your data on a subset of your input space. Basically, everything holds on this image above: you project data on the subspace with maximum variance. When you reconstruct your data from the projection, you'll get the red points, and the reconstruction error is the sum of the distances from blue to red points: it indeed corresponds to the error you've made by projecting your data on the green line. It can be generalized in any dimension of course!

enter image description here

As pointed out in the comments, it does not seem that simple for LDA and I can't find a proper definition on the internet. Sorry.

Vince.Bdn
  • 785
  • LDA case is more tricky than that. What would you do in case of 2-dimensional projections? In PCA, two principal axes are orthogonal and form a 2D plane so of course the same idea of reconstruction error applies. But in LDA, two discriminant axes are not orthogonal. How exactly are you suggesting to define the reconstruction error then? – amoeba Feb 10 '16 at 17:44
  • I've got two remarks on the answer. 1) Are you saying that your pic 1 shows the true PC1? 2) For LDA and the 2nd pic - well, you can draw discriminants as axes in the original space and call data point residuals "reconstruction error". But it is a loose terminological practice. What do discriminants reconstruct? Also, add here what amoeba said about axial nonorthogonality (seen here). – ttnphns Feb 10 '16 at 18:01
  • It's a picture taken from a google search that shows error but indeed the pca would be much more vertical, i'll try to find a better one and update.
  • – Vince.Bdn Feb 10 '16 at 18:05
  • I've edited my post. I tend to see the discriminants as axes in the original space indeed for a geometric point of view but as pointed out there's not orthogonality. My mistake...
  • – Vince.Bdn Feb 10 '16 at 18:13
  • 1
    Vince, it's your decision. But as for me, in your place I'd better left the second pic in the answer, too. You were not mistaken and your view is possible. The issue is, however, more complex with LDA; comments were just to stress that. – ttnphns Feb 10 '16 at 18:22
  • I second what @ttnphns said. I'd also suggest you keep the LDA picture but add the explanation of why the same notion of reconstruction error cannot be easily applied in this case. – amoeba Feb 10 '16 at 18:27