You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have categorical data, in total ~1600 points. I split it to train and test, then clusterise it. It works well. But when I try to fit the train data to any cluster, it always returns 0.
from sklearn.model_selection import train_test_split
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=10)
km = kmodes.KModes(n_clusters=50, init='Huang', num_runs=5, verbose=1)
clusters = km.fit_predict(X_train)
The above works fine and the results are great, however the below code returns all zeroes:
test_data_clusters = km.predict(X_test)
Am I misunderstanding the predict function and doing something wrong?
The text was updated successfully, but these errors were encountered:
I am probably doing something wrong.
I have categorical data, in total ~1600 points. I split it to train and test, then clusterise it. It works well. But when I try to fit the train data to any cluster, it always returns 0.
The above works fine and the results are great, however the below code returns all zeroes:
Am I misunderstanding the
predict
function and doing something wrong?The text was updated successfully, but these errors were encountered: