Git Product home page Git Product logo

Comments (4)

nicodv avatar nicodv commented on June 15, 2024

Could you post the full traceback, so I can see where the error occurs exactly?

Also, what does your data look like?

from kmodes.

kroscek avatar kroscek commented on June 15, 2024

My data contains both numerical (0.xxx)and categorical of one and two alphabet (A,B,XZ). Here is the snippet:

km = kprototypes.KPrototypes(n_clusters=10, init='Cao', verbose=2)
train1=pd.read_csv('/home/lemma/train.csv')
train1=train1.drop(['id','loss'],1)
train1=train1.values.astype(object)
train1['clusters_KModes'] = km.fit_predict(train1,categorical=[1,2,3])
image

from kmodes.

nicodv avatar nicodv commented on June 15, 2024

With categorical=[1,2,3], you're telling the algorithm that the second, third and fourth columns are categorical. But from your screenshot it looks like there's many more categorical variables. That why kmodes is trying to interpret the 'MJ' string as a float.

from kmodes.

kroscek avatar kroscek commented on June 15, 2024

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?

from kmodes.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.