Hindi Machine Learning Tutorial 6 - Dummy Variables & One Hot Encoding

Поділитися
Вставка
  • Опубліковано 14 жов 2024
  • Machine learning models work very well for dataset having only numbers. But how do we handle text information in dataset? Simple approach is to use interger or label encoding but when categorical variables are nominal, using simple label encoding can be problematic. One hot encoding is the technique that can help in this situation. In this tutorial, we will use pandas get_dummies method to create dummy variables that allows us to perform one hot encoding on given dataset. Alternatively we can use sklearn.preprocessing OneHotEncoder as well to create dummy variables.
    #MachineLearningHindi #PythonMachineLearning #MachineLearningTutorial #Python #PythonTutorial #PythonTraining #MachineLearningCource #OneHotEncoding
    Code in tutorial: github.com/cod...
    Exercise csv file: github.com/cod...
    To download csv and code for all tutorials: go to github.com/cod..., click on a green button to clone or download the entire repository and then go to relevant folder to get access to that specific file.
    Website: codebasicshub.com/
    Facebook: / codebasicshub
    Twitter: / codebasicshub

КОМЕНТАРІ • 63

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

    Check out our premium machine learning course with 2 Industry projects: codebasics.io/courses/machine-learning-for-data-science-beginners-to-advanced

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

      Why did u use.. Model. Predict([[ 👈 3 brackets over here..?

  • @Why_I_am_a_theist
    @Why_I_am_a_theist 11 місяців тому +1

    I must say that you have a kind of inexplicable calm way of describing , that really helped . The problem with some hindi channels is that they don't care much about the aesthetics of teaching . You are different

  • @abdulmanan17529
    @abdulmanan17529 11 місяців тому +1

    I think everything is easy to learn if you have a real tutor like you Sir
    Salute ❤
    Form pakistan

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

    I came from english codebasics channel 😎. I didn't knew another legendary data science channel exist . 🙏🙏

  • @SulemanTheTraveller
    @SulemanTheTraveller 3 роки тому +5

    Sir its giving error
    TypeError: __init__() got an unexpected keyword argument 'categorical_features'

  • @suyash7450
    @suyash7450 Рік тому

    Your way of teaching is just amazing I am glad that i found your channel

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

    First technique was easier..
    Is it okay to use it instead of the 2nd one ??

  • @sanuarhossain8184
    @sanuarhossain8184 2 місяці тому

    Sir, here we have only 3 towns that why we drop one town after concat dummy variable with dataset. if here 5 or 10 types of town then how it works?

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

    sir if we have labeled using labelencoder it is giving same as pandas dummy variable so why we are further using fit_transform of onehotencoding

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

    good learning, thank you so much dhaval sir.

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

    Sir, What is the difference between pandas get dummy method and one hot encoding? It is doing same thing only..

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

    Hello sir,
    I really glad that i am learning ML from you.
    I am doing Exercise
    1st use label encoder
    Then use linear regression
    Score is 0.87199
    Sir how we plot scatter on multi linear regression?

    • @meetsaurabhtiwari
      @meetsaurabhtiwari 11 місяців тому

      hi, please guide me i m doing prepration of data scientist ,please

  • @jaygajjar40
    @jaygajjar40 Рік тому +1

    If there were 3 categories, we needed to drop one column.
    What to do when we have more than 3 ?
    Still we need to remove 1 column or more?

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

    Sir in my categorical command not working, any problem, reply Sir

  • @farhanfarooq
    @farhanfarooq 5 років тому +4

    mercedes benz, 4 yrs, 45K mileage: model.predict([[0, 1, 45000, 4]]) predicted: array([36991.31721062])
    BMW X5, 7 yrs, 86K mileage: model.predict([[1, 0, 86000, 7]]) predicted: array([11080.74313219])
    score: 0.9417050937281083
    Can you please confirm if it is correct or not?

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

    Thanks For calling us smart

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

    Bhai Mahaan hen ap

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

    Hello Sir , I hope ur fine in this pandemic situation :) :) sir I got the exercise answer perfectly fine with dummy variable method but when i'm doing this with one hot encoding method it did not give the correct answer and you also in ur github doing it with first method

  • @shaiksajid613.
    @shaiksajid613. 3 роки тому

    Sir can you tell me how to convert continuous value to discrete value !!!

  • @omicronart_lab9595
    @omicronart_lab9595 Рік тому

    Categorical feature not work in One hot encoding.please help

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

    My score is coming out to be 0.9688...
    But the given solution is not matching my answer. Is this possible?
    I have given the same data set as provided... Please tell🙏

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

    if categorical_features = [1] not working
    use this one:
    from sklearn.compose import ColumnTransformer
    ct = ColumnTransformer([("town", OneHotEncoder(), [0])], remainder = 'passthrough')
    x=ct.fit_transform(x)

  • @mrbeastfangame
    @mrbeastfangame 2 місяці тому

    👌

  • @anuskasinha8295
    @anuskasinha8295 5 років тому +3

    👍

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

    Appreciated!
    Dear, would u like to explain how we deploy or import our trained data into web app?

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

    Amazing just amazing

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

    prabhu apne bhakto k liye aur zyada se zyada video banaye na

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

    1.model.predict([[0,1,45000,4]])
    array([[36991.31721062]])
    2. model.predict([[0,0,86000,7]])
    array([[15365.40972059]])
    3.model.score(x,y)
    0.9417050937281083

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

    Nice

  • @izainonline
    @izainonline Рік тому

    Thanks Sir great learning just 1 qs chalo means😅

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

    sir, I am not getting the csv files from the provided link.plz help me out

    • @codebasicsHindi
      @codebasicsHindi  5 років тому +2

      Fahim can you go to root directory and download the entire py repository? I think I have provided instructions in video description

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

    aapki 4 hi columns aa rhi hn dummy variable ki lekin meri 7 aa rhi hn....(one hot encoder se) koi btade plzzzz

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

    Thank you very much for your efforts. Love from Pakistan.

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

    How to do this when there are many categorical columns?

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

    mercedes benz c class, 4 yrs, 45000 mileage: model.predict([[ 45000,4,0,1]]) predicted: array([36991.31721061])
    BMW X5, 7 yrs, 86K mileage: model.predict([[86000, 7,1,0]]) predicted: array([11080.74313219])
    model.score(x,y):0.9417050937281082

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

    Sir please help me out resolving that error

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

    1st answer is 36991
    and 2nd is 15365

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

    14:48 One hot encoder naam ekdam hot hai

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

    I am getting error in this