Label Encoding | Dummies How to Convert Categorical Column into Numerical Column Python Tutorial

Поділитися
Вставка
  • Опубліковано 3 жов 2024

КОМЕНТАРІ • 37

  • @DarshanSingh-fx7bb
    @DarshanSingh-fx7bb 4 роки тому +14

    great effort but time-consuming
    but you can simplify this by using transform as well
    after import Label encoder you can use this command. either you have two categories or more in any feature. it will work efficiently
    data[['sex']] = LabelEncoder().fit_transform(data['sex'])
    data[['smoker']] = LabelEncoder().fit_transform(data['smoker'])
    data[['day']] = LabelEncoder().fit_transform(data['day'])
    data[['time']] = LabelEncoder().fit_transform(data['time'])
    data.head()

  • @FarazKhan-wo4xm
    @FarazKhan-wo4xm 3 роки тому +3

    brooooo...YOU R AWESOME ... you just sort out my one of the biggest confusion it was showing very long error that only integer value can be inserted in the array ....YOUR tutorial just sav the day ...Keep up the good work bro 😍😍

  • @ashishkumar-fk8rh
    @ashishkumar-fk8rh 4 роки тому +11

    where le came from in the line le.fit_transform? I think it should be l3 instead of le...

    • @Moonwalkerrabhi
      @Moonwalkerrabhi 3 роки тому +1

      same here i m still wondering how the code ran

    • @AirIsTotal
      @AirIsTotal 3 роки тому +1

      @@Moonwalkerrabhi he probably had le properly defined in a previous kernel.

    • @Zwei200123
      @Zwei200123 3 роки тому

      At 4:44, he imported a package called LabelEncoder from sklearn

    • @lahiru954
      @lahiru954 3 роки тому

      really, I wondered how it could be executed

  • @karakavalasagoutham1317
    @karakavalasagoutham1317 3 роки тому +3

    Hi, since you had only two values ( male and female), u easily added to a new data frame, what if I am having 10 values and 10 new dummy columns that gets created and need to every time give the to_list command to concatenate all the 10 columns.

  • @Zwei200123
    @Zwei200123 3 роки тому

    Thank you so much for a great tutorial!!

  • @semmeke9142
    @semmeke9142 4 роки тому +2

    Good work but just slow down please... No need to rush!!

  • @JaiRudraNath
    @JaiRudraNath 2 роки тому

    How to pickle the label encoders used in training for use in prediction ?

  • @edgarkaptum1216
    @edgarkaptum1216 4 роки тому +2

    What were you doing you look mixed up

  • @Neetish21
    @Neetish21 4 роки тому

    Super tutorial, does this work the same way if label data have multiple classes eg countries

  • @MadhukarMishra
    @MadhukarMishra 3 роки тому +2

    Change your way to do man everything you did buttermilk .. unfortunately i am here

  • @FarazKhan-wo4xm
    @FarazKhan-wo4xm 3 роки тому

    bro your method is working corrrectly but when I am using standard sceler function and doing feature scaling there is an error that is popping out that cannot covert string into float
    i don't know how to do that will you tell please

  • @MOHAN-PYARA
    @MOHAN-PYARA Рік тому

    what to do if found string and float in one column

  • @rohitthorat888
    @rohitthorat888 4 роки тому

    how to convert more categorical data and can we start from numeriacal 10 as you started from 0,1,2,etc

  • @ritvikpant7107
    @ritvikpant7107 3 роки тому +1

    confused while learning

  • @msalmanai62
    @msalmanai62 3 роки тому

    Sir, Can we use non categorical data in training/testing our model?
    And can we convert non categorical data into numerical data?

  • @FULLCOUNSEL
    @FULLCOUNSEL 4 роки тому

    Your video is very nice, but you are abit too fast brother, please calm down abit. Otherwise your very much appreciated

  • @MutenRoshiUI
    @MutenRoshiUI 4 роки тому

    How can i check what value has been assigned to what data if i have a lot of categories using label encoder?

    • @SoumilShah
      @SoumilShah  4 роки тому

      Do fist df[somecol].nunique(). This will tell you how many categories it has

  • @sadanandh8785
    @sadanandh8785 3 роки тому

    very high speed n in rush

  • @shashankathawale6618
    @shashankathawale6618 4 роки тому

    hey, i understand everything please goa little slow in other videos.

  • @TheOraware
    @TheOraware 4 роки тому +3

    you lost me

  • @AshokPatel-qc1hz
    @AshokPatel-qc1hz 5 років тому

    Soumil upload the csv file of data also to work on that data file

    • @SoumilShah
      @SoumilShah  5 років тому

      Ashok Patel sure allow me some time

    • @SoumilShah
      @SoumilShah  5 років тому

      Ashok Patel for this example there is no csv I am using built in dataset from Seaborn

  • @muhammadshahab854
    @muhammadshahab854 4 роки тому +2

    confuse man

  • @cablemaster8874
    @cablemaster8874 3 роки тому

    very good , soumilshah1995

  • @patrickbateman7665
    @patrickbateman7665 3 роки тому

    You tried so hard to Concate two Data variables. LOL
    Keep it, Simple buddy. Don't complicate things.

  • @agrajjoshi6635
    @agrajjoshi6635 4 роки тому +1

    Bad demo

  • @SachinYadav-qe3gb
    @SachinYadav-qe3gb 4 роки тому

    How to convert big number to small number?
    Example big number 76527556375 .
    How to convert into small number?