One-hot Encoding explained

Поделиться
HTML-код
  • Опубликовано: 22 янв 2025

Комментарии • 122

  • @deeplizard
    @deeplizard  7 лет назад +9

    Machine Learning / Deep Learning Tutorials for Programmers playlist: ruclips.net/p/PLZbbT5o_s2xq7LwI2y8_QtvuXZedL6tQU
    Keras Machine Learning / Deep Learning Tutorial playlist: ruclips.net/p/PLZbbT5o_s2xrwRnXk_yCPtnqqo4_u2YGL

  • @harshtiwari9588
    @harshtiwari9588 5 лет назад +58

    RUclips recommendation system must be really broken since it is not recommending me this magic!

    • @deeplizard
      @deeplizard  5 лет назад +5

      Thanks Harsh! Hopefully soon 🦎🚀

    • @audioplatform6299
      @audioplatform6299 9 месяцев назад

      They are hypocrites,, money money money,,, they have turned RUclips like a third class blog site which is flooded with ads,,,
      This video is phenomenal, thank you

  • @fazankabir2029
    @fazankabir2029 5 лет назад +28

    OMG. Such a brilliant explanation. I have been watching your videos from past almost 1 hour and couldn't stop myself to watch the next one each time. Subscribed, liked and commented. Thank you so much. You are life saver!

  • @synthstatic9889
    @synthstatic9889 3 года назад

    I'm in a coding bootcamp and this explained the concept far better than the lesson.

  • @SaidElnaffar
    @SaidElnaffar 4 года назад +2

    A very high-quality video -- I got the idea in no time. Thanks.

  • @mastermax7777
    @mastermax7777 Год назад +2

    2:40 watching starting here for those 10 seconds just clicked it for me. Thanks

  • @AlexanderTeterkin
    @AlexanderTeterkin Год назад +1

    Greatest explanation I ever heared! Thank you!

  • @odds8564
    @odds8564 2 года назад +1

    Within 3 minutes my minds been completely opened

  • @sterlinglozalee9926
    @sterlinglozalee9926 5 лет назад +2

    While the concept itself is incredibly simple, I keep hearing so many people over-complicate or not explain why it's specifically called "one-hot" encoding. Great video! Exceptionally well explained!

  • @NotBob223
    @NotBob223 7 лет назад +7

    Just went through the entire series to date and found it very helpful and easy to follow. I'm sure you have.a plan all mapped out but further topics might be in why you would want/need to add layers, how many nodes/neurons you'd want in each layer and how to optimize those (I.e. find out you don't have enough or too many), finding out when you have hit local minimums, choosing different functions such as relu, tanh, etc. You're really on a good roll here and I look forward to more!

    • @deeplizard
      @deeplizard  7 лет назад +1

      Thanks for the suggestions, Brent! I'll definitely keep these topics in mind for future videos. I'm glad you're finding the videos helpful so far!

  • @deepcodes
    @deepcodes 4 года назад +2

    Good quality of both video and blogs, Really amazed by your work!!

  • @cloudkungfu
    @cloudkungfu 4 года назад +1

    This explanation was super clear! Awesomeee

  • @broncioaguilar1757
    @broncioaguilar1757 Год назад +1

    😊perfect explanation! Loved the animals too 🐈‍⬛🐕🦎🦙 thanks!!

  • @milenaramirez1341
    @milenaramirez1341 6 лет назад +2

    Easy to understand, even for foreigners. Thanks a lot! :)

  • @ahmeddiderrahat3415
    @ahmeddiderrahat3415 3 года назад +1

    Thanks a lot. Saved my 3 hours.

  • @b_01_aditidonode43
    @b_01_aditidonode43 Месяц назад +1

    amazingly explained!!

  • @tymothylim6550
    @tymothylim6550 3 года назад +1

    Thank you so much for this video! Now I finally understand what this term means!

  • @carlasanchez4349
    @carlasanchez4349 Год назад +1

    This was great, thank you for sharing

  • @ashita1130
    @ashita1130 5 лет назад +2

    Thank you so much :) Clear and to the point explanation!!!!!

  • @galfrasian
    @galfrasian 3 года назад +1

    Thank you really cleared my concept. Big Fan

  • @cryptorick8109
    @cryptorick8109 7 лет назад +3

    Love the channel!!! Killin it! Subscribed!

  • @vatsal_gamit
    @vatsal_gamit 4 года назад +1

    Just Woow!! Thank You for this video!! Keep Doing the Good work :)

  • @Wopara
    @Wopara 6 месяцев назад +1

    Thank God I came across your channel, scientist these days just like to sound smart

  • @Shkencetari
    @Shkencetari 5 лет назад +6

    This was really well explained. Thank you very much.

  • @princendhlovu2502
    @princendhlovu2502 4 года назад +1

    You did a great job explaining!

  • @billywhite1403
    @billywhite1403 3 года назад

    great video! really good teaching, simple and engaging. bless you for making this

  • @shilpashreeshivappa8942
    @shilpashreeshivappa8942 4 года назад +1

    Very helping...Thank you.

  • @agrisuccess6698
    @agrisuccess6698 3 года назад +1

    It's really very well explained

  • @1travel29
    @1travel29 3 года назад

    That was soo helpful! Thanks so much for the animations and detail in the explaination

  • @bhang96
    @bhang96 4 года назад +8

    - One Hot encoding is one way of converting categorical data into a (sparase) vector
    - Each one hot code represent the category of the data. So that machine can interpret each word.
    - As you add more category, the length of the vector increases.

    • @John-vm2zi
      @John-vm2zi 3 года назад

      It reminds me of dummy variables.

  • @sashaslonmailerable
    @sashaslonmailerable 26 дней назад

    Great video, thanks,
    The playlist could be split into ANN and CNN, so the list is shorter and more focused.

  • @qusayhamad7243
    @qusayhamad7243 4 года назад

    thank you very much for this clear and helpful explanation.

  • @TD-ph3wb
    @TD-ph3wb 3 года назад +1

    great explanation, thanks

  • @yousraizountar5768
    @yousraizountar5768 5 лет назад +1

    this video is just amazing, thank you very much

  • @sushilarya6994
    @sushilarya6994 5 лет назад +1

    Thanks for explaining in layman terms.
    Liked and subscribed.!

  • @ujjwalkumar8173
    @ujjwalkumar8173 4 года назад +1

    To the point explanation.. Thank you for this quality content :)

  • @muhammadtalhabaig4908
    @muhammadtalhabaig4908 5 лет назад +1

    Thank you! You explain things really well! 😃

  • @1matzeplayer1
    @1matzeplayer1 2 года назад +1

    Great content!!!

  • @tribo327
    @tribo327 3 года назад

    i'm still not clear on why the image tags couldn't be encoded as numerical values just going up from 0? What is the benefit behind this?

  • @noorhassanwazir8133
    @noorhassanwazir8133 2 года назад +1

    Nice explanation

  • @MohammadMahadiHassain
    @MohammadMahadiHassain 6 лет назад +1

    best & clear explanation

  • @souravsarkar488
    @souravsarkar488 4 года назад +1

    Thanks a lot!

  • @mattbutawan8764
    @mattbutawan8764 4 года назад

    what if you want to have both categorical and continuous inputs to the same NN?

  • @arminharper510
    @arminharper510 4 года назад

    Much easier than i expected. But why can't the NN take these inputes as decimal numbers? Like 1 2 3 or as the sum of the ascii equivalents of each Character in their name?

  • @adilm9857
    @adilm9857 4 года назад +1

    well explained!!

  • @firdaousslotfi9616
    @firdaousslotfi9616 4 года назад +1

    thank you, this was really helpful !!

  • @chann2467
    @chann2467 3 года назад

    4:26 I thought [0,0,0,1] is going to be a turtle 😂. thanks again for the videos

  • @lifemystery7992
    @lifemystery7992 2 года назад

    I have a question:
    if i have 4 columns in my dataSet, so the input layer of my NN will be as [x1, x2, x3, x4] right !
    suppose we have categorical column with 4 categories...
    my imagination is, when we apply the one-hot encoding to the categorical column we will get more 4 columns for [cate1, cate2, cate3, cate4] right?
    the question is that i'm right? or it will be compressed into one label. if i'm right that's mean our input layer in the NN will be [ numerical columns + all categories ]

  • @shiva_kondapalli
    @shiva_kondapalli 5 лет назад +4

    This is an awesome Series. Clear, concise and crisp. A question though, I trained a Vgg19 network using Pytorch to classify species of flowers. The categories were 102: 0 through 101. I din't have to one hot encode them, so when do you have to do this? I get that you may want to do it when you have multiple classes for the same input. You could then read off a vector like [1 0 0 1] as 1st and 4th class. The other reason given is that the model
    may give greater weight to a higher number, so does that mean it will predict the higher integer more often, can anyone shed some light on this? I got decent results (~ 95% accuracy on validation) without one-hot encoding. Do you have to always one-hot encode? Thanks!

  • @cw9249
    @cw9249 5 лет назад +1

    great explanation

  • @leesuiping9725
    @leesuiping9725 4 года назад +1

    Well explain

  • @arshakzakaryan2773
    @arshakzakaryan2773 6 лет назад +1

    Great explanation. You mentioned about your previous video to check. Can you post the link?

    • @deeplizard
      @deeplizard  6 лет назад +1

      Yes, here you go!
      ruclips.net/video/pZoy_j3YsQg/видео.html

  • @sergijlebedyn6011
    @sergijlebedyn6011 6 лет назад +1

    brilliant explanation

  • @whalingwithishmael7751
    @whalingwithishmael7751 5 лет назад

    Do gradient boosted trees also use one hot encoding?

  • @MrAwesomenes5
    @MrAwesomenes5 5 лет назад +14

    Cool but what happens if we add a fifth elemend? How does the vector look like then?
    /s

    • @sushilarya6994
      @sushilarya6994 5 лет назад +3

      one more vector is added of 0 and 1 with length 5. it could be [0,0,0,0,1]

    • @leonardodavinci4259
      @leonardodavinci4259 4 года назад +3

      @@sushilarya6994 woooosh

  • @EerieBaguette
    @EerieBaguette 4 месяца назад +1

    pardon my stupidity, but why do we not use numbers instead of a binary vector for such classifications?
    would'nt it be more logical to use numbers instead when we have larger data sets?
    as in:
    0-dog
    1-cat
    2-lizard
    3-llama
    and so on?

  • @chawza8402
    @chawza8402 4 года назад

    is there an encoding type that uses all possible variations of binary numbers? for example, we can use 2 binary to represent 4 classes (00,01,10,11). I just thought that would make more space efficient.

  • @nuwanchathuranga7226
    @nuwanchathuranga7226 5 лет назад +1

    Good explanation, keep doing more videos :)

  • @narendraparmar1631
    @narendraparmar1631 4 года назад

    Thanks a lot😁

  • @aydinahmadli7005
    @aydinahmadli7005 6 лет назад +1

    great explanation!

  • @ylazerson
    @ylazerson 6 лет назад +1

    great video - thanks!

  • @DrKhan-hd4cd
    @DrKhan-hd4cd 6 лет назад

    what about a snake or a horse? when we use softmax the overall probability must be equal to 1. How will the neural network know to output all 0s?

    • @deeplizard
      @deeplizard  6 лет назад +2

      Hey Dr. Khan - The network will only predict classes for which it has a corresponding output class. For example, if the network only knows about dogs and cats (2 output nodes), and we pass it a snake, then the network will give corresponding probabilities only for whether it thinks the snake image is more like a dog or a cat. In the snake case, the network may output around 50% probability for dog and 50% for cat. This indicates that the network is not confident at classifying this sample, and the prediction is no better than chance, which makes sense because the image is neither a dog or cat.

  • @pmtycoon
    @pmtycoon 5 лет назад +1

    subscribed. no questions asked ;)

  • @danwe3237
    @danwe3237 5 лет назад

    I do understand one-hot-encoding but why is it necessary to use random vectors for classification instead of a random variable? Why is it not sufficient to use a mapping 1 for cat, 2 for dog, 3 for lizard and so on?

  • @Waleed-qv8eg
    @Waleed-qv8eg 6 лет назад +1

    Thumbs up!
    Thanks

  • @fernandojackson7207
    @fernandojackson7207 2 года назад

    Another great video. Just curious, though, I keep hearing that at least 80% of machine learning involves Data Cleaning. Is that the case? If so, do you have any video training on that?

  • @theone3746
    @theone3746 4 года назад

    But how do you code this?

  • @michelleli8751
    @michelleli8751 6 лет назад +2

    Thank you :D

  • @anto1756
    @anto1756 4 года назад

    What about integer Encoding?

  • @xavierloux
    @xavierloux 6 лет назад +1

    Thanks !

  • @robind999
    @robind999 6 лет назад +1

    it answered my question, thanks,

  • @gaykarsamir
    @gaykarsamir 5 лет назад +1

    Nice Video :)

  • @iulianflester
    @iulianflester 4 года назад

    When should we use this encoding? why not just simply assign dog to nr 1 cat to nr 2 and so on?

  • @tanyamalhotra9505
    @tanyamalhotra9505 4 года назад

    Hey thanks for the amazing explanation!! But could I know why we simply can't assign them integer values? For instance map dog to 0, lizard to 1, cat to 2 and so on.... Why is one hot encoding needed?

    • @shahhuzaifa2746
      @shahhuzaifa2746 3 года назад +1

      Because these names of animals are categorical variables i.e., there is no relationship between cat and dog. They are discrete names. And the same goes for the city's name e.g., Boston, New York etc. So when you encode them integer wise, it is a misrepresentation of the data, since the algorithm would interpret them as the interval variables i.e., you could 3 is bigger than 1, 2 is bigger than 1. So the algorithm will try to harness this relationship which is not correct. Therefore we encode categorical variables into one-hot encoding.

  • @karanbari5712
    @karanbari5712 6 лет назад

    What if I have features in factors( cat,dog,lizard,llama) itself like what if I want my algorithm to differentiate like black dog ,white cat, small lizard,big llama? @deeplizard

    • @deeplizard
      @deeplizard  6 лет назад +2

      Hey Karan - For this, you would need labels and output classes for each possible category. For example, rather than the class being cat, you would instead have more descriptive and granular classes like black cat, white cat, orange cat, etc.

  • @belliumm
    @belliumm 4 года назад

    What's the benefit of doing one-hot encoding as opposed to label encoding

    • @yensteel
      @yensteel 4 года назад

      Suppose cat is 1 and dog is 2, lizard is 3 and it predicts 1.5 as a single variable? Would it be reliable? Even more so, if a picture has ambiguity between dogs and lizards in the image (stupid analogy), this could pose a problem and the predictor may make an entirely incorrect prediction of a value close to 2. One hot encodings put independent, separate, equal weights for every categorical prediction. As encoding is binary, the prediction could be: [0.6, 0, 0.4] and the prediction would select the highest number, so choice 1 with the second choice 3. This is more robust because it selects the outcome it's most confident in, as the NN is a probalistic model, and each of the outcomes does not interfere with each other in an unusual way. The neural network works with numbers, and Categorical values are not really numbers. It has to be translated into a pure, numerical value that it can work with. A binary set of "yes it is" or "no it's not" array works well

  • @thespam8385
    @thespam8385 5 лет назад +1

    {
    "question": "In supervised learning, the index of the \"hot one\" corresponds to a(n):",
    "choices": [
    "Label",
    "Action",
    "Function",
    "Neuron"
    ],
    "answer": "Label",
    "creator": "Chris",
    "creationDate": "2019-12-13T04:14:11.847Z"
    }

    • @deeplizard
      @deeplizard  5 лет назад

      Thanks, Chris! Just added your question to deeplizard.com

  • @NisseOhlsen
    @NisseOhlsen 6 лет назад +1

    Great vid, thanks, subscribed.
    Now, is that lizard ([0, 0, 1]) called Elizabeth?

    • @deeplizard
      @deeplizard  6 лет назад +1

      Haha no, it's not 🦎

    • @NisseOhlsen
      @NisseOhlsen 6 лет назад +1

      @@deeplizard hadda ask....

  • @horace7763
    @horace7763 5 лет назад +1

    namemes que bonito vídeo!!

  • @LightAura
    @LightAura 4 года назад

    Shouldn't we always leave one category out when one-hot encoding? as it impacts our models by introducing correlation. Is it not always the case or was this left out not to over complicated the concept?. Thank you for the explanation and the whole series.

  • @HoustonPL
    @HoustonPL 4 года назад

    Deeplizard, I did a "deep learning" course on udemy. Your course is incomparably more thought-out, refined and the graphical side beats the hell out of all other courses. And all this for free!
    I am glad that there are such people and I hope that you will never run out of motivation to continue sharing your knowledge. All the best for you and keep up the great job.
    P.S. your voice is sexy

  • @isaquemelo8134
    @isaquemelo8134 6 лет назад

    Thank you again for these videos! I would like to know if this is the best approach for large data.. for instance, I have 10000 categories, which approach would be adequate?

    • @deeplizard
      @deeplizard  6 лет назад +1

      Hey Isaque - Yes, one-hot encoding is still be feasible for a larger category space, like the one you mentioned.

  • @silenta237
    @silenta237 6 лет назад +1

    You rock!

    • @deeplizard
      @deeplizard  6 лет назад

      Appreciate that, silenta :)

  • @bisnar1307
    @bisnar1307 5 лет назад

    Thank youuu :D

  • @asasdasasdasdasdasdasdasd
    @asasdasasdasdasdasdasdasd 7 лет назад +1

    What is an case where One-hot encoding isn't the preferred method?

    • @deeplizard
      @deeplizard  7 лет назад +3

      Hey Anton - Good question. One-hot encoding wouldn't be preferred in a scenario where your labels have a natural order to them, _and_ you want to preserve this order. If your labels were, say, height of individuals, then you may not want to one-hot encode them because, if you did, then your network wouldn't be able to extract/learn anything regarding the order.

    • @danielparrado3605
      @danielparrado3605 6 лет назад

      great explanation! Thank you

    • @neilmedina997
      @neilmedina997 6 лет назад

      i think the better explanation is one hot works better on classification rather than regression

  • @logangraham2956
    @logangraham2956 Год назад

    now i just need a vector to contain every single english world plus any words that don't exist yet or/and typos.
    it's going to be one really really long vector...
    (ya not using this method😅)

  • @Paul-qn7qv
    @Paul-qn7qv 4 года назад

    Why would you use one-hot encoding when you can use integers?
    For example, 1 maps to cat, 2 maps to dog, and 3 maps to lizard.

    • @ashwinv8305
      @ashwinv8305 4 года назад

      The normal integer encoding can be done for ordinal data. Your example does not have any ordinal relationship between them so one hot encoding is preferred.

  • @ameynaik2743
    @ameynaik2743 3 года назад

    Why is one-hot encoding used?

  • @bhz8947
    @bhz8947 3 года назад +1

    I’ve never seen something so simple so over-explained.

    • @deeplizard
      @deeplizard  3 года назад

      Yeah. It is. Big 🧠 💪

  • @hakuma2527
    @hakuma2527 4 года назад

    Why One-hot Encoding is used? Why the label can't be 1, 2 ,3 and so on?

  • @lerneninverschiedenenforme7513
    @lerneninverschiedenenforme7513 4 года назад

    Hm.. I think this is a very complex looking explanation for a very simple topic "one-hot encoding". Maybe you could add "deep learning" to the title. That way people would see, that this is not (only) a simple explanation on the very old and easy one-hot encoding.

  • @takeyoshix
    @takeyoshix 4 года назад

    No, this explanation is not complete. I would have expected to hear WHY one should use One-Hot (e.g. categorical cross-entroppy in TensorFLow) instead of ordinal category indexes (sparse categorical entropy). Following Richard Feynmans statement, "You cannot explain stuff well until you really understand it."... so I wonder if the channel owner knows what the one-hot encoding is, but not really how it could help). And one of the first question of a beginner (who sees the first set of tutorials and examples) will be, "Why one-hot [ 1, 0, 0 ] and not just [ 0, 1, 2 ] (ordinal)??". (In terms of TensorFlow training, e.g. CNN on an multi-category image dataset like CIFAR or MNIST, both approaches are possible, but which one would yield a better NN performance? Would there be a difference at all?)

  • @rrestoring_faith
    @rrestoring_faith Год назад +1

    This is not specific to neural networks. Other than that good work.

  • @ernststravoblofeld
    @ernststravoblofeld 2 месяца назад

    You sure you want to say length and not dimension? The length of a vecter is its magnitude.

  • @mosca-tse-tse
    @mosca-tse-tse 4 года назад

    All 6 minutes could have been easily squeezed to 6 seconds by saying that the labels are passed in a vector. OK, max 30 secs. The term one-hot is not explained btw.

  • @swaekim9402
    @swaekim9402 3 года назад +2

    can you please replace my professor

  • @grimonce
    @grimonce 5 лет назад

    (...) who came up with this name?

  • @blackshirtsquad7883
    @blackshirtsquad7883 5 лет назад

    I love the channel. Kinda dislike this video tho :O .... it's not complicated what you're saying. This should be a two minute video, not drawn out to six.

  • @Danny-sj6es
    @Danny-sj6es 5 лет назад

    Spent too much time talking about how categories map to the vectors and not enough time on why you one hot encoding even matters. Like, why don't we just assign a number for each categories rather than making it a vector?

  • @s3arajgupta
    @s3arajgupta 3 года назад +1

    OMG. Such a brilliant explanation. I have been watching your videos for almost 3 hours and couldn't stop myself to watch the next one each time. Subscribed, liked and commented. Thank you so much.