fferroni / DEC-Keras

Deep Embedding Clustering in Keras
GNU General Public License v3.0
130 stars 59 forks source link

How to get the cluster label for new data X #12

Open hana9090 opened 6 years ago

hana9090 commented 6 years ago

After the cluster is formed, how to know which cluster does the new data belong to? And also how to retrieve all images which rely on the same cluster?

anuraagvaidya commented 5 years ago

I'd like to know this as well.

digivi13 commented 5 years ago

to find out which cluster new data belongs to, get the embedded representations for all the images and perform a PCA on the entire set of embedded training data. Then use model.encoder.predict(X) or model.get_layer(index=0).predict(X) (depending on if you are loading a saved model) to get the embedded representation of the new image. Use the same PCA object (important!) on the embedding of the new image to get the coordinates and plot it along with the training data (different colors of course)