-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How can we link topics with samples? #34
Comments
I have written a set of functions that do this, based on the
|
One thing to keep in mind is that this plot is communicating a slightly different thing than the |
Thank you @elmonten for the question and @JCSzamosi for the great functions. For completeness, here's how you can look up samples with large values in specific topics. This code runs an alignment,
The topics slot in the alignment output summarizes all the topics across the models. m refers to a column in the alignment plot and k to the topic within that model.
If we realize we are interested in a specific topic, then we can go back to the original LDA output to find the samples that have high weights on that topic. E.g., for topic 3 in model 8, we could use
which shows that sample 1063701288 is nearly a pure representative from that topic.
To go from the alignment diagram to a specific path ID, you might want to show the path IDs in the legend. For this, we have to manually override the default plotting function (not elegant, but it works).
I'll let @lasy decide whether we should make a pull request. I've been able to use the function to see labels in the gamma plot for our demo data. She might also have other ideas for inspecting samples. |
Perfect, thank you all very much! |
Hello,
How can we map back which topics are present in which samples?
Best wishes,
Elena
The text was updated successfully, but these errors were encountered: