You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Maybe we want to add the option to determine n_components automatically from the data? For an old project I implemented this using one approach and looked up two other ones, that I didn't implement yet. Not sure if we want this option (n_components could then maybe be of type int or Literal(implemented methods)), but I will paste my old code/references here just in case:
defdet_malinowski_factor(eigenvalues: np.ndarray) ->int:
""" Determines minimum number of principal components according to: Malinowski, E. R. Determination of the number of factors and the experimental error in a data matrix. Anal. Chem. 49, 612–617 (1977). """ind=np.zeros([eigenvalues.shape[0]-1, 1])
forninrange(ind.shape[0]):
ind[n] =np.sqrt(np.sum(eigenvalues[n:]/(eigenvalues.shape[0]-(n+1)))) / (eigenvalues.shape[0]-(n+1))**2returnint(np.argmin(ind))
defdet_nelson_factor(eigenvalues: np.ndarray) ->int:
""" Determines minimum number of principal components according to: Nelson, L.R. (2005). Some observations on the scree test, and on coefficient alpha. Thai Journal of Educational Research and Measurement: 3(1), 1-17. """# Todo: implement function :)passdefdet_median_noise_factor(eigenvalues: np.ndarray) ->int:
""" Determines minimum number of principal components according to: Manjón, J.V. et al. (2015). MRI noise estimation and denoising using non-local PCA. Medical Image Analysis 22 (2015) 35–47 """# Todo: implement function :)pass
The text was updated successfully, but these errors were encountered:
ckolbPTB
changed the title
Determine n_components for PCACompressionOp automatically from the data
Determine components for PCACompressionOp automatically
Oct 24, 2024
Originally posted by @schuenke in #181 (comment)
The text was updated successfully, but these errors were encountered: