0

I was reading this stackoverflow and had a further question. Once the clusters have been made, is it possible to determine what cluster a new sentence will fall into ?

Clustering text documents using scikit-learn kmeans in Python

Community
  • 1
  • 1
Steve
  • 4,388
  • 3
  • 17
  • 25

1 Answers1

1

Sure, just use the predict method. Continuing the example from the referenced question

X_new = vectorizer.transform([sentence])
y_new = model.predict(X_new)
Sergei Lebedev
  • 2,659
  • 20
  • 23