Skip to content

fix: freeze F during prediction in project_poisson_nmf#65

Open
roi-meir wants to merge 2 commits intostephenslab:masterfrom
roi-meir:bugfix/fix_f_matrix_in_predict
Open

fix: freeze F during prediction in project_poisson_nmf#65
roi-meir wants to merge 2 commits intostephenslab:masterfrom
roi-meir:bugfix/fix_f_matrix_in_predict

Conversation

@roi-meir
Copy link
Copy Markdown

Without update.factors = NULL, fit_poisson_nmf used its default seq(1, ncol(X)) and refitted every row of F on the new (test) data, silently corrupting the training-estimated factors. Adding update.factors = NULL reduces to integer(0), which causes the main update loop to skip all factor updates so that only L is learned for the new data points.

Fix issue #64

Without `update.factors = NULL`, fit_poisson_nmf used its default
seq(1, ncol(X)) and refitted every row of F on the new (test) data,
silently corrupting the training-estimated factors. Adding
`update.factors = NULL` reduces to integer(0), which causes the main
update loop to skip all factor updates so that only L is learned for
the new data points.
The test verifies project_poisson_nmf returns F with the same column-normalised structure as the input (catches the update.factors = NULL fix)
@roi-meir roi-meir force-pushed the bugfix/fix_f_matrix_in_predict branch from aaae836 to dbad59b Compare April 14, 2026 14:45
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

Successfully merging this pull request may close these issues.

1 participant