Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Determine components for PCACompressionOp automatically #479

Open
ckolbPTB opened this issue Oct 24, 2024 · 0 comments
Open

Determine components for PCACompressionOp automatically #479

ckolbPTB opened this issue Oct 24, 2024 · 0 comments

Comments

@ckolbPTB
Copy link
Collaborator

          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:
def det_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])
    for n in range(ind.shape[0]):
        ind[n] = np.sqrt(np.sum(eigenvalues[n:]/(eigenvalues.shape[0]-(n+1)))) / (eigenvalues.shape[0]-(n+1))**2

    return int(np.argmin(ind))


def det_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 :)
    pass


def det_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

Originally posted by @schuenke in #181 (comment)

@ckolbPTB ckolbPTB changed the title Determine n_components for PCACompressionOp automatically from the data Determine components for PCACompressionOp automatically Oct 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant