From 98549c3b188220c9a8365826669fc6c25e92708d Mon Sep 17 00:00:00 2001 From: Andreas Grivas Date: Wed, 18 May 2022 16:21:44 +0100 Subject: [PATCH] FIX spherical k-means confusion in example (#23380) --- examples/text/plot_document_clustering.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/examples/text/plot_document_clustering.py b/examples/text/plot_document_clustering.py index 24af666330e5c..66b25ec9851de 100644 --- a/examples/text/plot_document_clustering.py +++ b/examples/text/plot_document_clustering.py @@ -204,9 +204,8 @@ def is_interactive(): if opts.n_components: print("Performing dimensionality reduction using LSA") t0 = time() - # Vectorizer results are normalized, which makes KMeans behave as - # spherical k-means for better results. Since LSA/SVD results are - # not normalized, we have to redo the normalization. + # Since LSA/SVD results are not normalized, + # we redo the normalization to improve the k-means result. svd = TruncatedSVD(opts.n_components) normalizer = Normalizer(copy=False) lsa = make_pipeline(svd, normalizer)