Emotion Classification 7

PHOTO EMBED

Sat Apr 22 2023 07:42:47 GMT+0000 (Coordinated Universal Time)

Saved by @kentrickfelix #python

# Create an instance of AgglomerativeClustering
content = df_emotions['sentiment']
agglomerative_vec = tfidf.fit_transform(content)
agg_clustering = AgglomerativeClustering(n_clusters=13, metric='euclidean', linkage='ward')

# Create labels from the Agglomerative Clustering above
labels = np.array(agg_clustering.fit_predict(agglomerative_vec.toarray()))
print(labels)
content_copyCOPY