Plot Dendrogram X-axis with TF-IDF

Asked

Viewed 20 times

2

I’m trying to plot Dendrograma with data that was vectored by TF-idf, however the axis x always presents me with numbers.

I would like to know how to move to the Graphics Labels option, the real names of each index.

vect_hierar = TfidfVectorizer(input='filename', stop_words=stopwords_list, encoding='utf8', 

ngram_range=(1,2), min_df=3)

tf_idf_matrix_hierar = vect_hierar.fit_transform(list_of_files).todense()
print(tf_idf_matrix_hierar)

from sklearn.cluster import AgglomerativeClustering
import scipy.cluster.hierarchy as sch

plt.figure(figsize=(12, 8))
plt.title("Customer Dendograms")
dend = sch.dendrogram(sch.linkage(tf_idf_matrix_hierar, method='ward'))

inserir a descrição da imagem aqui

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.