Use tmtoolkit to fit multiple LDA models in parallel.#18
Open
SeppeDeWinter wants to merge 1 commit intomainfrom
Open
Use tmtoolkit to fit multiple LDA models in parallel.#18SeppeDeWinter wants to merge 1 commit intomainfrom
SeppeDeWinter wants to merge 1 commit intomainfrom
Conversation
Collaborator
|
Okay, looks interesting, will have to test this. |
Collaborator
Author
True! That way we don't have to change the API. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Using this change it is easier for a user to explore multiple parameters for LDA modeling.
The function
run_topic_modelingnow accepts a list of values forWhen a list of values is given for one or more of these parameters multiple models will be fit in parallel to allow the user to explore the most optimal hyperparameters. This is done under the hood using tmtoolkit. The function now returns a list of topic models along with quality metrics.
After a model has been selected this can be added to the AnnData object using the new function
add_topic_modeling_result.tmtoolkit provides multiple functionalities to evaluate topic models, see https://tmtoolkit.readthedocs.io/en/latest/topic_modeling.html#Evaluation-of-topic-models.
For this reason the loglikelihood function is removed given that it is already implement in tmtoolkit.
This change does introduce a new dependency. We could consider making the topic modeling dependencies optional given that it is a more advanced use case.
pip install tfmindi[topic]for instance.