Skip to main content
added 470 characters in body
Source Link

i m try to apply k-means with Python 3 to my dataset (Amazon review) for classify similar user (from review).

I just have a TF and TF-IDF matrix (and i have a row(user) and columns(words) value, row is user and columns is word of review in distinct csv file) and i wish cluster the user. enter image description here

I m starting with sklearn from this sketch

https://scikit-learn.org/stable/auto_examples/text/plot_document_clustering.html#sphx-glr-auto-examples-text-plot-document-clustering-py

but in my case i don't have label or category.

For now, and i applydon't understand how k-means and make some analysis on thecan cluster and on the variancedifferent items from this matrix TD-IDF. After i wish calculate a centroid and make a plot of

  1. How can I group similar words from my dataset, from the matrix without having any information?
  2. How do I show these n-clusters in the chart?
  3. And how do I show the similar words of this cluster, if I do not have any information (like label or category)?

For now this clustering, but i can't, because i don't have a label like in exampleis my code :

labelsk = dataset5
km = KMeans(n_clusters=k, init='k-means++', max_iter=100, n_init=5)
km.targetfit(Y) ##Y is my TD-IDF matrix

original_centroids = svd.inverse_transform(km.cluster_centers_)
print(original_centroids.shape) 
for i in range(original_centroids.shape[0]):
original_centroids[i] = np.array([x for x in original_centroids[i]])
svd_centroids = original_centroids.argsort()[:, ::-1]

In this example , maybe the label will be compute before.

I m findingi would like have a set like this example too:

https://medium.com/@roberto.sannazzaro/unsupervised-learning-come-catalogare-un-dataset-senza-labels-52bf9b6a3073

but don't help me so much.(with similar word near)

So, the question is: Can i apply k-means without label?enter image description here

I m very lost, because i m new in this word.

i m try to apply k-means with Python 3 to my dataset (Amazon review) for classify similar user (from review).

I just have a TF and TF-IDF matrix (and i have a row and columns value, row is user and columns is word of review ) and i wish cluster the user.

I m starting with sklearn from this sketch

https://scikit-learn.org/stable/auto_examples/text/plot_document_clustering.html#sphx-glr-auto-examples-text-plot-document-clustering-py

but in my case i don't have label or category.

For now i apply k-means and make some analysis on the cluster and on the variance. After i wish calculate a centroid and make a plot of this clustering, but i can't, because i don't have a label like in example:

labels = dataset.target

In this example , maybe the label will be compute before.

I m finding this example too:

https://medium.com/@roberto.sannazzaro/unsupervised-learning-come-catalogare-un-dataset-senza-labels-52bf9b6a3073

but don't help me so much.

So, the question is: Can i apply k-means without label?

I m very lost, because i m new in this word.

i m try to apply k-means with Python 3 to my dataset (Amazon review) for classify similar user (from review).

I just have a TF and TF-IDF matrix (and i have a row(user) and columns(words) value in distinct csv file) enter image description here

I m starting with sklearn from this sketch

https://scikit-learn.org/stable/auto_examples/text/plot_document_clustering.html#sphx-glr-auto-examples-text-plot-document-clustering-py

but in my case i don't have label or category, and i don't understand how k-means can cluster different items from this matrix TD-IDF.

  1. How can I group similar words from my dataset, from the matrix without having any information?
  2. How do I show these n-clusters in the chart?
  3. And how do I show the similar words of this cluster, if I do not have any information (like label or category)?

For now this is my code :

k = 5
km = KMeans(n_clusters=k, init='k-means++', max_iter=100, n_init=5)
km.fit(Y) ##Y is my TD-IDF matrix

original_centroids = svd.inverse_transform(km.cluster_centers_)
print(original_centroids.shape) 
for i in range(original_centroids.shape[0]):
original_centroids[i] = np.array([x for x in original_centroids[i]])
svd_centroids = original_centroids.argsort()[:, ::-1]

i would like have a set like this(with similar word near)

enter image description here

I m very lost, because i m new in this word.

Post Closed as "Needs details or clarity" by OmG, Sean Owen
added 57 characters in body
Source Link

i m try to apply k-means with Python 3 to my dataset (Amazon review) for classify similar user (from review).

I just have a TF and TF-IDF matrix (and i have a row and columns value, row is user and columns is word of review ) and i wish cluster the user.

I m starting with sklearn from this sketch

https://scikit-learn.org/stable/auto_examples/text/plot_document_clustering.html#sphx-glr-auto-examples-text-plot-document-clustering-py

but in my case i don't have label or category.

For now i apply k-means and make some analysis on the cluster and on the variance. After i wish calculate a centroid and make a plot of this clustering, but i can't, because i don't have a label like in example:

labels = dataset.target

In this example , maybe the label will be compute before.

I m finding this example too:

https://medium.com/@roberto.sannazzaro/unsupervised-learning-come-catalogare-un-dataset-senza-labels-52bf9b6a3073

but don't help me so much.

So, the question is: Can i apply k-means without label?

I m very lost, because i m new in this word.

i m try to apply k-means with Python 3 to my dataset (Amazon review) for classify similar user (from review).

I just have a TF and TF-IDF matrix (and i have a row and columns value, row is user and columns is word of review ) and i wish cluster the user.

I m starting with sklearn from this sketch

https://scikit-learn.org/stable/auto_examples/text/plot_document_clustering.html#sphx-glr-auto-examples-text-plot-document-clustering-py

but in my case i don't have label or category.

For now i apply k-means and make some analysis on the cluster and on the variance. After i wish calculate a centroid and make a plot of this clustering, but i can't, because i don't have a label like in example:

labels = dataset.target

In this example , maybe the label will be compute before.

I m finding this example too:

https://medium.com/@roberto.sannazzaro/unsupervised-learning-come-catalogare-un-dataset-senza-labels-52bf9b6a3073

but don't help me so much.

I m very lost, because i m new in this word.

i m try to apply k-means with Python 3 to my dataset (Amazon review) for classify similar user (from review).

I just have a TF and TF-IDF matrix (and i have a row and columns value, row is user and columns is word of review ) and i wish cluster the user.

I m starting with sklearn from this sketch

https://scikit-learn.org/stable/auto_examples/text/plot_document_clustering.html#sphx-glr-auto-examples-text-plot-document-clustering-py

but in my case i don't have label or category.

For now i apply k-means and make some analysis on the cluster and on the variance. After i wish calculate a centroid and make a plot of this clustering, but i can't, because i don't have a label like in example:

labels = dataset.target

In this example , maybe the label will be compute before.

I m finding this example too:

https://medium.com/@roberto.sannazzaro/unsupervised-learning-come-catalogare-un-dataset-senza-labels-52bf9b6a3073

but don't help me so much.

So, the question is: Can i apply k-means without label?

I m very lost, because i m new in this word.

Source Link

k-mean without label

i m try to apply k-means with Python 3 to my dataset (Amazon review) for classify similar user (from review).

I just have a TF and TF-IDF matrix (and i have a row and columns value, row is user and columns is word of review ) and i wish cluster the user.

I m starting with sklearn from this sketch

https://scikit-learn.org/stable/auto_examples/text/plot_document_clustering.html#sphx-glr-auto-examples-text-plot-document-clustering-py

but in my case i don't have label or category.

For now i apply k-means and make some analysis on the cluster and on the variance. After i wish calculate a centroid and make a plot of this clustering, but i can't, because i don't have a label like in example:

labels = dataset.target

In this example , maybe the label will be compute before.

I m finding this example too:

https://medium.com/@roberto.sannazzaro/unsupervised-learning-come-catalogare-un-dataset-senza-labels-52bf9b6a3073

but don't help me so much.

I m very lost, because i m new in this word.