One Hot Encoder with Python Machine Learning (Scikit-Learn)

แชร์
ฝัง
  • เผยแพร่เมื่อ 4 ต.ค. 2024
  • In this Python Machine Learning Tutorial, we take a look at how you can change categorical data to numeric with the help of One Hot Encoder
    Interested in discussing a Data or AI project? Feel free to reach out via email or simply complete the contact form on my website.
    Looking for the code? Check out the article: ryannolandata....
    📧 Email: ryannolandata@gmail.com
    🌐 Website & Blog: ryannolandata....
    🍿 WATCH NEXT
    Scikit-Learn and Machine Learning Playlist: • Scikit-Learn Tutorials...
    Ordinal Encoder: • Ordinal Encoder with P...
    Column Transformer: • Simplify Data Preproce...
    Cross Validation: • A Comprehensive Guide ...
    MY OTHER SOCIALS:
    👨‍💻 LinkedIn: / ryan-p-nolan
    🐦 Twitter: / ryannolan_
    ⚙️ GitHub: github.com/Rya...
    🖥️ Discord: / discord
    📚 *Data and AI Courses: datacamp.pxf.i...
    📚 *Practice SQL & Python Interview Questions: stratascratch....
    WHO AM I?
    As a full-time data analyst/scientist at a fintech company specializing in combating fraud within underwriting and risk, I've transitioned from my background in Electrical Engineering to pursue my true passion: data. In this dynamic field, I've discovered a profound interest in leveraging data analytics to address complex challenges in the financial sector.
    This TH-cam channel serves as both a platform for sharing knowledge and a personal journey of continuous learning. With a commitment to growth, I aim to expand my skill set by publishing 2 to 3 new videos each week, delving into various aspects of data analytics/science and Artificial Intelligence. Join me on this exciting journey as we explore the endless possibilities of data together.
    *This is an affiliate program. I may receive a small portion of the final sale at no extra cost to you.

ความคิดเห็น • 49

  • @shivi_was_never_here
    @shivi_was_never_here 5 หลายเดือนก่อน

    Thanks a lot Ryan! This has to be one of the best videos out here dealing with encoders. If only others were this easy!
    Thanks again.

    • @shivi_was_never_here
      @shivi_was_never_here 5 หลายเดือนก่อน

      Also, do I have to fit and transform all my sets? Or only the training set? Do I have to fit the test set? Thanks again!

  • @RyanAndMattDataScience
    @RyanAndMattDataScience  ปีที่แล้ว +5

    Have a need for a data project? Email me or fill out the form on my website.
    Looking for the code? Check out the article: Looking for the code? Check out the article: ryannolandata.com/one-hot-encoder/

  • @RyanAndMattDataScience
    @RyanAndMattDataScience  หลายเดือนก่อน

    Hey guys I hope you enjoyed the video! If you did please subscribe to the channel!
    If you want to watch a full course on Machine Learning check out Datacamp: datacamp.pxf.io/XYD7Qg
    Want to solve Python data interview questions: stratascratch.com/?via=ryan
    I'm also open to freelance data projects. Hit me up at ryannolandata@gmail.com
    *Both Datacamp and Stratascratch are affiliate links.

  • @A-K-I-R-A-
    @A-K-I-R-A- 9 หลายเดือนก่อน +1

    Nice tutorial, clean and direct!

  • @yasminwael-pl5fv
    @yasminwael-pl5fv 25 วันที่ผ่านมา

    thank you very much 💕

  • @omer4826
    @omer4826 6 หลายเดือนก่อน

    thanks a lot dude! really helped me grasp the basics!

  • @aniketshrikondawar6598
    @aniketshrikondawar6598 13 วันที่ผ่านมา

    Please make sure all cells are visible on screen. Sometimes not able to view end of cell content.

  • @ahsanjamil1495
    @ahsanjamil1495 หลายเดือนก่อน +1

    in case if we have multiple variables which are non-ordinal, do we use the onehotencoder on all the variables at once by adding them to the list initially or do we do this one by one?

  • @usamaspeakscricket
    @usamaspeakscricket 7 วันที่ผ่านมา

    Thanks buddy

  • @eyadal-naimi3782
    @eyadal-naimi3782 9 หลายเดือนก่อน

    protect this man

  • @alonzoslim
    @alonzoslim 9 หลายเดือนก่อน

    This is a great video. Explained in a manner that a newbie like myself can understand. Thank you.
    A question: What if the dataset contains multiple categorical variables (as well as numerical), and they are all required as input to make a prediction. How can one go about it?

    • @RyanAndMattDataScience
      @RyanAndMattDataScience  9 หลายเดือนก่อน +1

      Thank you! There are multiple ways to one hot encode the categorical variables. Check out my titanic video and or the house predictions. I show a few different processes

  • @neerajchauhan1371
    @neerajchauhan1371 2 หลายเดือนก่อน

    Thanks buudy

  • @message59
    @message59 8 หลายเดือนก่อน

    Thanks a lot was a great help :) hope you have a good day

  • @ayushparwal2210
    @ayushparwal2210 8 หลายเดือนก่อน +1

    thanks buddy it helps me !:)

  • @shadrinan90
    @shadrinan90 7 หลายเดือนก่อน

    Great explanation, thanks

  • @kablamo9999
    @kablamo9999 4 หลายเดือนก่อน

    Thank you!

  • @ginaross295
    @ginaross295 9 หลายเดือนก่อน

    Thank you so much for this video !!!!

  • @La_mia-r5z
    @La_mia-r5z 4 หลายเดือนก่อน

    Thank you ❤

  • @onurdatascience
    @onurdatascience ปีที่แล้ว

    Great video!

  • @swativarsha68
    @swativarsha68 ปีที่แล้ว

    lerant a lot! thanks!!

  • @Futureyouth-be1bo
    @Futureyouth-be1bo 3 หลายเดือนก่อน

    dude how about if i have two different datasets while theier categorical values are different how can i do one hot encoding
    the first one has 9349 rows × 17 columns
    and the second one has 365 rows × 17 columns while if i make one hot encoding they will be produced
    for the first one they become 611 columns of hot encoding
    and the second one become 20 columns please help me how can i do this note the two datasets have Origin and destintion city names

    • @williamalexander5089
      @williamalexander5089 หลายเดือนก่อน

      u can merge them first, encode it, then split it again

  • @juanDoAs
    @juanDoAs 11 หลายเดือนก่อน

    Trying your code I get this error: 'AttributeError: 'OneHotEncoder' object has no attribute 'set_output''. Any idea why this is?

    • @juanDoAs
      @juanDoAs 11 หลายเดือนก่อน

      Nvm just needed to update scikit-learn

    • @RyanAndMattDataScience
      @RyanAndMattDataScience  10 หลายเดือนก่อน

      Ok great. Everything else working properly?

  • @PhilTag-ml6wd
    @PhilTag-ml6wd 5 หลายเดือนก่อน

    Stopped a bit short. Need to go through how to use the encoder for predicting and not just setting up for training. eg. enc.transform() on the features you need to run the prediction on . Has been a bit of a pain with the datatype.

    • @Aldotronix
      @Aldotronix 4 หลายเดือนก่อน

      I don’t know if i understand your comment but you can make a make_pipeline to build all preprocessing steps: use a ColumnTransformer to select the columns to one hot encode and use the one hot encoder. You can cross validate, fit and predict using the pipeline instead of building a model again.

    • @RyanAndMattDataScience
      @RyanAndMattDataScience  3 หลายเดือนก่อน

      I have some projects that do. I may remake this video in the furture

  • @peidomolhado7016
    @peidomolhado7016 หลายเดือนก่อน

    skibi learn 😝😝😝

  • @leodexter191
    @leodexter191 3 หลายเดือนก่อน

    please go lil slow hard to understand

    • @RyanAndMattDataScience
      @RyanAndMattDataScience  3 หลายเดือนก่อน

      I'll have an article on this soon you can also check out

    • @leodexter191
      @leodexter191 3 หลายเดือนก่อน

      @@RyanAndMattDataScience thank you

  • @ttdddaa
    @ttdddaa 2 หลายเดือนก่อน

    thanks dude