Reputation: 4668
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
Upvotes: 0
Views: 214
Reputation: 2679
Sure, just use the predict
method. Continuing the example from the referenced question
X_new = vectorizer.transform([sentence])
y_new = model.predict(X_new)
Upvotes: 1