# How to assign a new data point to a cluster?

I have a user dataset which contains fields like ['age','gender', 'computer_literacy', 'vision', 'colour_blind', 'education', 'font_size','colour'].

I clustered this data and assigned the new cluster to the existing data. Now I want to know: how can I find a similar cluster for a new user?

As an example, if I am a new user I may submit only a few details like ['age', 'gender', 'computer_literacy', 'vision'] but still want to know to which cluster I belong.

What are the possible approaches to solve this problem?

Suppose if you use kmeans clustering then you can

1.train and save the model using pickle

2.loa the model using pickle

3.pass your new sample as a vector to the predict function of the loaded model object model.predict([[0, 0], [12, 3]])

this will give you only one cluster label

4.if you want to get top n clusters that the sample might belong to then take the cluster centers of your model as save it in a variable this will be list of list or matrix .

cc=kmeans.cluster_centers_

compute the similarity between your new sample and the cc matrix , rank the distances and yo will get n nearest clusters

• This doesn't answer the part about having incomplete features Jan 7 at 18:59
• Can be add default data for incomplete one and cluster? Isn't is lead to a wrong clustering? Jan 9 at 13:03