I was trying to run KPrototypes for exactly one iteration by setting max_iter=1. However, this seems to result in the algorithm running two iterations.
K = 20
N = int(1e5)
M = 10
MN = 5
data = np.random.randint(1, 1000, (N, M))
KPrototypes(n_clusters=K, init='Huang', n_init=1, max_iter=1, verbose=2, random_state=9999)\
.fit_predict(data, categorical=list(range(M - MN, M)))
I was trying to run
KPrototypes
for exactly one iteration by settingmax_iter=1
. However, this seems to result in the algorithm running two iterations.Output:
When I set
max_iter=0
I appear to get the one iteration I'm looking for.Output:
I think this is a bug, but I'm not certain. Is there a better way to get exactly one iteration?