The Nipals PCA algorithm calculates the scores and loadings of a data array iteratively. If only (say) 3 scores and loadings are calculated from a data array with more than 3 variables, there is a residual matrix created (called E). How can I extract this matrix from the SciKit Learn PCA algorithm so that I can create contribution charts?
I'm not super familiar with PLS/NIPALS, but I think you need to construct it yourself. Multiply the scores by the loadings and subtract the resulting matrix from the data to get the residual matrix. See here for a more detailed discussion: https://learnche.org/pid/latent-variable-modelling/projection-to-latent-structures/how-the-pls-model-is-calculated