Function VisualizeTopics

Visualizes topics in a 2D map

visualizetopics( DP,ALPHA,S,VIZMODE ) takes the topic strings in S and the document-topic count matrix DP where DP(i,j) contains the number of times a word in document i has been assigned to topic j. These counts are transformed to probability distributions over documents for each topic. For each topic pair, the symmetrized Kullback Leibler distance between document distributions is calculated. Classical multidimensional scaling is used to visualize all pairwise topic distances in a 2D map.


The variable VIZMODE can be set to 'horizontal' or 'vertical' which determines the way the topics are displayed.

The variable ALPHA is the hyperparameter on the topic distributions needed to calculate the topic-document distributions calculate prob distribution over documents for each topic