-
Notifications
You must be signed in to change notification settings - Fork 417
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
KPrototypes fit_predict error: "could not convert string to float" #47
Comments
Could you post the full traceback, so I can see where the error occurs exactly? Also, what does your data look like? |
With |
Hi categorical=[1,2,3] is just for snipped only, The actual categorical written in python is ranging from 1-116. Thus I need to do treatment for categorical data because two alphabetic categorical cannot be converted into float? |
I want to apply Kprototype into my dataset but it seems that the code can't convert into numpy arrays?
km = kprototypes.KPrototypes(n_clusters=10, init='Cao', verbose=2)
train=pd.read_csv('/home/lemma/train.csv')
train['clusters_KModes'] = km.fit_predict(train1,categorical=[1])
ValueError: could not convert string to float: MJ
Trying to convert into object to match the example given also not successful:
km = kprototypes.KPrototypes(n_clusters=10, init='Cao', verbose=2)
train=pd.read_csv('/home/lemma/train.csv')
train1=train1.values.astype(object)
train['clusters_KModes'] = km.fit_predict(train1,categorical=[1])
ValueError: could not convert string to float: MJ
The text was updated successfully, but these errors were encountered: