Skip to content
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

fix 'cuml' w/ 'hdbscan' type checks in cluster/_utils.py #981

Merged
merged 1 commit into from
Feb 9, 2023
Merged

fix 'cuml' w/ 'hdbscan' type checks in cluster/_utils.py #981

merged 1 commit into from
Feb 9, 2023

Conversation

FelSiq
Copy link
Contributor

@FelSiq FelSiq commented Feb 3, 2023

I believe that current type checks in bertopic/cluster/_utils.py for cuml + hdbscan clusterers are incorrect.

Since the "cuml" string is always evaluating to True (see lines 22, 34, and 45 in bertopic/cluster/_utils.py), any subclass of HDBSCAN is triggering the cuml import, raising an ImportError when not installed. Even if installed, calling cuml_hdbscan module may not be adequate for all HDBSCAN subclasses.

I'm opening this PR with a simple solution proposal, but feel free to find another way to fix this issue.

@MaartenGr
Copy link
Owner

Thanks for the PR! This indeed should resolve any future HDBSCAN-like models to be implemented as well as custom models that do not yet support probability calculation.

@MaartenGr MaartenGr merged commit 04dccbe into MaartenGr:master Feb 9, 2023
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.

2 participants