From 5e341f32759f98947de806d1d6b7ccedbc9bb79c Mon Sep 17 00:00:00 2001 From: Sergey Parkhonyuk Date: Mon, 8 Jun 2020 18:32:18 +0700 Subject: [PATCH] add tqdm to KElbowVisualizer --- requirements.txt | 2 +- yellowbrick/cluster/elbow.py | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/requirements.txt b/requirements.txt index 6e0f3680c..03485d36b 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,7 +4,7 @@ scipy>=1.0.0 scikit-learn>=0.20 numpy>=1.13.0 cycler>=0.10.0 - +tqdm>=4.43.0 ## Optional Dependencies (uncomment to use) #umap-learn>=0.3 diff --git a/yellowbrick/cluster/elbow.py b/yellowbrick/cluster/elbow.py index e1a0fed1a..d965984c4 100644 --- a/yellowbrick/cluster/elbow.py +++ b/yellowbrick/cluster/elbow.py @@ -38,7 +38,8 @@ except ImportError: from sklearn.metrics import calinski_harabaz_score as chs - +# add tqdm for progress visualization +from tqdm import tqdm ## Packages for export __all__ = ["KElbowVisualizer", "KElbow", "distortion_score", "kelbow_visualizer"] @@ -303,7 +304,7 @@ def fit(self, X, y=None, **kwargs): self.elbow_value_ = None self.elbow_score_ = None - for k in self.k_values_: + for k in tqdm(self.k_values_): # Compute the start time for each model start = time.time()