2
$\begingroup$

In my dataset I have a feature having below data :

Input

Feature
Brain Dementia Routine(Comfortone)
Morning Check
Dementia Brain-Routine(Comfortone)
Brain MRA Routine (Comfortone)
Brain-Dementia/Routine(MRCP)
MRCP BH WITH DYNAMIC****
LIVER/MRCP W/O, W/
MRCP Routine 30slice
MRCP-Routine/Dr.Robert

How do I cluster values that have similar words in it .

Output

Feature Cluster
Brain Dementia Routine(Comfortone) A
Morning Check C
Dementia Brain-Routine(Comfortone) A
Brain MRA Routine (Comfortone) A
Brain-Dementia/Routine(Comfortone) A
MRCP BH WITH DYNAMIC**** B
LIVER/MRCP W/O, W/ B
MRCP Routine 30slice B
Dr.Robert/MRCP Routine/ B
$\endgroup$

1 Answer 1

1
$\begingroup$

You can either use a sentence embedding model to associate a vector to each of your inputs, and use a clustering algorithm like KMeans, or build a similarity matrix between your strings using a string distance metric, and use a similarity-based algorithm like Spectral Clustering or Agglomerative Clustering.

The first one using KMeans might not work the best because the sentence embedding model will have been trained on data that doesn't specifically look like what you have, but it will be able to process new data.

For the second one, because you can use any string distance you want, you can design one that works really well with your data. But because it uses similarity based clustering, you wont be able to process new data as easily.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.