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

How to determinate Appropriate k Values #5

Closed
akikuya opened this issue May 24, 2024 · 1 comment
Closed

How to determinate Appropriate k Values #5

akikuya opened this issue May 24, 2024 · 1 comment

Comments

@akikuya
Copy link

akikuya commented May 24, 2024

Hello, Thank you for providing such an excellent package.
In the GeneNMF demo, the code snippet:

geneNMF.programs <- multiNMF(seu.list, assay="SCT", slot="data", k=4:9, L1=c(0,0), do_centering=TRUE, nfeatures = 2000)

could you please explain why the parameter k was set to range from 4 to 9?
Thank you!

@mass-a
Copy link
Member

mass-a commented Jun 10, 2024

Hello and thanks for your interest in GeneNMF.
When performing NMF on a dataset, we aim at reducing the dimensionality of the count matrix from several hundreds/thousand variable genes to a few 'k' dimensions, roughly corresponding to gene programs. The parameter range for k should correspond to the expected number of gene programs in individual datasets; NMF decomposition will be performed for each value in the range.
As with most parameters, there is not a single answer on the best value to assign. I would suggest to experiment with different ranges, corresponding to different granularity levels for the matrix factorization. In the example code snippet, we used k=4:9 (a shortcut for all integers between 4 and 9) because we could reasonably expect this range of major immune cell types in individual samples. One could of course select a different range to attempt capturing different levels of granularity.
I hope this is helpful.
-m

@mass-a mass-a closed this as completed Jan 13, 2025
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

2 participants