Skip to content

Commit

Permalink
FIX spherical k-means confusion in example (#23380)
Browse files Browse the repository at this point in the history
  • Loading branch information
andreasgrv authored and glemaitre committed May 19, 2022
1 parent e69117d commit 98549c3
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions examples/text/plot_document_clustering.py
Expand Up @@ -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)
Expand Down

0 comments on commit 98549c3

Please sign in to comment.