How to choose the optimal k in k-protoypes?

To analyze a dataset from banking I have both numerical and categorical values. I transform them to analyze with k-prototypes.

The original dataset:

The modified dataset:

• E.g.: Job (for 1 to 12 'cos there are 12 levels)

Should I scale the dataset before doing the k-prototypes?

How could I determine the optimal "k" to choose (coding)?

I thought to execute:

library(clustMixType)

lbd <- lambdaest(BPor)

kpres <- kproto(BPor, 5, lambda = lbd) #Change '5' for every possible value of k.

print(kpres)


And then, calculate the sum of within cluster error (choosing the little one).

• Duplicate of: stats.stackexchange.com/q/293877/7828 Aug 18, 2017 at 6:15
• @Anony-Mousse Not from the same user, and not even a cross-post. So, shouldn't be closed with that reason Aug 18, 2017 at 7:30
• How do you calibrate lambda coefficient in K-prototypes algorithm in R ? Any gridsearch possible with variation of K and lambda (Let's say I want 100 different lambda values and varying number of clusters K from 2 to 15) and then compare compactness of clusters ? Oct 6, 2021 at 10:47