I have a very large matrix(10×55678) in “numpy” matrix format. the rows of this matrix correspond to some “topics” and the columns correspond to words(unique words from a text corpus). Each entry i,j in this matrix is a probability, meaning that word j belongs to topic i with probability x. since I am using ids rather than the real words and since the dimension of my matrix is really large I need to visualized it in a way.Which visualization do you suggest? a simple plot? or a more sophisticated and informative one?(i am asking these cause I am ignorant about the useful types of visualization). If possible can you give me an example that using a numpy matrix? thanks
the reason I asked this question is that I want to have a general view of the word-topic distributions in my corpus. any other methods are welcome
You could certainly use matplotlib’s
imshoworpcolormethod to display the data, but as comments have mentioned, it might be hard to interpret without zooming in on subsets of the data.You could then sort the words by the probability that they belong to a cluster:
Here the word index on the y-axis no longer equals the original ordering since things have been sorted.
Another possibility is to use the
networkxpackage to plot word clusters for each category, where the words with the highest probability are represented by nodes that are either larger or closer to the center of the graph and ignore those words that have no membership in the category. This might be easier since you have a large number of words and a small number of categories.Hopefully one of these suggestions is useful.