MultivariateStats.jl icon indicating copy to clipboard operation
MultivariateStats.jl copied to clipboard

Setting the output dimension for PCA

Open esraiak opened this issue 8 years ago • 3 comments

Is it possible to set the output dimension for a PCA instance? (From the documentation, it seems like PCA's are constructed only by the fit() method, and that method determines the output dimension from pratio.)

esraiak avatar Sep 08 '17 20:09 esraiak

Use maxoutdim keyword argument when you're calling fit.

wildart avatar Sep 09 '17 00:09 wildart

The maxoutdim only limits the number of output components from above, but I want to set it exactly. I realize now that I can use "maxoutdim=7, pratio=1.0" to get exactly 7 output components. Still, it would make sense to be able to achieve this in a more natural way.

esraiak avatar Sep 11 '17 21:09 esraiak

Current PCA implementation targets a dimensionality reduction of the data rather than orthogonal transformation of it. Thus, you need to disable reduction step by setting maximum value for pratio parameter.

wildart avatar Sep 12 '17 00:09 wildart