Skip to content

fix: freeze F during prediction in project_poisson_nmf#65

Merged
pcarbo merged 2 commits intostephenslab:masterfrom
roi-meir:bugfix/fix_f_matrix_in_predict
Apr 17, 2026
Merged

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

Conversation

@roi-meir
Copy link
Copy Markdown
Contributor

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
@pcarbo
Copy link
Copy Markdown
Member

pcarbo commented Apr 17, 2026

@roi-meir Thank you very much for the important fix. I'm not sure how and when this issue came about, but it is certainly a current bug in project_poisson_nmf(); I will merge your changes.

@pcarbo pcarbo merged commit 8a0c5d2 into stephenslab:master Apr 17, 2026
1 check failed
@roi-meir
Copy link
Copy Markdown
Contributor Author

@pcarbo thank you for the fast response!

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.

2 participants