non-negative matrix factorization (nmfit is also based upon linear algebra all of the above mentioned algorithms for topic modeling would have the number of topics as parameterdocument-word matrix as an input and wtm (word topic matrixtdm (topic document matrixas output