简体   繁体   中英

NMF returns all-zero weights when scikit-learn updates to 0.24.2 (or newer)

I used Non-Negative Matrix Factorization (NMF) to conduct topic modelling for a long time.

When I updated my environment to the latest sickit-learn update (from 0.24.1 to 0.24.2) NMF stopped working properly and instead returned all-zero weights.

  • It is worth noticing that this error did not apply for the NMF-Kullback variation.

  • My NMF training script looked like this:

     nmf = NMF(n_components = self.no_topics, alpha = 0.1, l1_ratio =.5, init = 'nndsvd').fit(tfidf)

Any ideas?

2 ways of resolving this problem worked for me:

  1. Setting alpha equal to 0.0 (sub-optimal)
  2. Downgrading sickit-learn back to 0.24.1

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM