Skip to content

Improving how predictions and probilities are handled - #2537

Merged
MaartenGr merged 2 commits into
v1.0from
v1.0-prediction-store
Aug 31, 2026
Merged

Improving how predictions and probilities are handled#2537
MaartenGr merged 2 commits into
v1.0from
v1.0-prediction-store

Conversation

@MaartenGr

Copy link
Copy Markdown
Owner

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 Topics and Corpus objects 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

  • Probabilities didn't sum to 1 (due to the 1-sum(probs) feature of HDBSCAN)
  • .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.

@MaartenGr
MaartenGr marked this pull request as ready for review August 31, 2026 13:30
@MaartenGr
MaartenGr merged commit a7a38d5 into v1.0 Aug 31, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant