Improving how predictions and probilities are handled - #2537
Merged
Conversation
MaartenGr
marked this pull request as ready for review
August 31, 2026 13:30
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.
Handling predictions and probabilities should be much better now!
The idea of rearranging the probabilities was difficult and needed alignment in various places which overcomplicated things unnecessarily. This is an effort to simplify things where possible. The whole idea of the
TopicsandCorpusobjects was to have a foundation that served to simplify things and make them more stable.This also fixes a number of things whenever the model had outliers
.transform()returned a differently shaped array than.fit()did.delete_topics()never touched probabilities, so they still described the topics you'd deleted.Probabilities now always have one column per topic, in the same order as
topic_ids(), outlier included when there is one.This also results in fewer lines of code, which is great 😄
But first, let's see if the tests also pass here.