Global AI and Data Science

 View Only
  • 1.  How to deal with Categorical features in Modeling

    Posted Mon March 09, 2020 09:14 AM
    Hi everybody,

    My name is Josue Afouda and i'm a self-learner in Data Science. I want to predict the agricole production in terms of Type of culture (millet, corn , ...), locality and many other features. But i get an error when i trying to make a MLR model due to categoricals features. How can i deal with these categorical features.

    Is someone can help me please ?

    Josué Afouda

    #GlobalAIandDataScience
    #GlobalDataScience


  • 2.  RE: How to deal with Categorical features in Modeling

    Posted Tue March 10, 2020 12:55 AM
    It can happen that categorical features are not numerical. You can first map / convert to numerical and then try to build the model.

    ------------------------------
    Manash Sarma
    ------------------------------



  • 3.  RE: How to deal with Categorical features in Modeling

    Posted Tue March 10, 2020 06:09 AM
    Edited by System Fri January 20, 2023 04:45 PM
    you can do one hot enconding for categorical data.if data is ordinal means categories has different weights than you can do label encoding.

    ------------------------------
    rahul rahul
    ------------------------------



  • 4.  RE: How to deal with Categorical features in Modeling

    Posted Wed March 11, 2020 06:55 AM
    As there are categories involve, it's better that you use decision trees, in MLR, it won't be optimal and I don't know even know effective to use where data is categorized unless you use the numerical part of it to decide on each category one by one and then combine the results.

    ------------------------------
    Muhammad Tehseen
    ------------------------------



  • 5.  RE: How to deal with Categorical features in Modeling

    Posted Thu March 12, 2020 09:26 AM
    Hi,

    Linear Regression algorithm like many other needs numerical features. if categorical features exists, they needs to be converted first before applying the model.  There are many different ways of converting categorical to numerical depending on what kind of categorical variables you are dealing with. 
    Since I don't have full details of the features you are working with, sharing here the link to refer and apply the correct method to convert categorical features to numeric. 
    https://towardsdatascience.com/all-about-categorical-variable-encoding-305f3361fd02
    Please let me know if that helps. 


    ------------------------------
    Nataraj Krishnappa
    ------------------------------