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
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
Sure, just use the predict
method. Continuing the example from the referenced question
X_new = vectorizer.transform([sentence])
y_new = model.predict(X_new)