Skip to content

Commit

Permalink
Adding warning in benchmarks when UMAP-learn is not found
Browse files Browse the repository at this point in the history
  • Loading branch information
cjnolet committed May 4, 2020
1 parent d019d96 commit 6b9141f
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions python/cuml/benchmark/algorithms.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
from cuml.utils.import_utils import has_umap
import numpy as np
import tempfile
import warnings

from cuml.benchmark.bench_helper_funcs import (
fit,
Expand Down Expand Up @@ -206,8 +207,8 @@ def all_algorithms():
AlgorithmPair(
sklearn.cluster.KMeans,
cuml.cluster.KMeans,
shared_args=dict(init="kmeans++", n_clusters=8,
max_iter=300, n_init=10),
shared_args=dict(init="k-means++", n_clusters=8,
max_iter=300, n_init=1),
cuml_args=dict(oversampling_factor=0),
name="KMeans",
accepts_labels=False,
Expand Down Expand Up @@ -454,6 +455,9 @@ def all_algorithms():
accuracy_function=cuml.metrics.trustworthiness,
)
])
else:
warnings.warn("Could not find UMAP-learn library. UMAP benchmarks "
"will not be available.")

return algorithms

Expand Down

0 comments on commit 6b9141f

Please sign in to comment.