Machine Learning with Scikit-Learn - [Part 39]

in #machine-learning7 years ago

This machine learning tutorial is all about label encoding. Since we are dealing with scikit-learn here, we are going to work on the very classical iris dataset in which flowers are labeled into three categories:

  • setosa
  • versicolor
  • virginica

We are going to encode them the following way: 0 => setosa, 1 => versicolor, 2 => virginica. We are using the LabelEncoder in scikit-learn, which does the encoding automatically.

To verify the encoding, we will be creating more labels of the same in a Python list, and then apply our encoder over them. Ultimately, we'll verify by printing out the encoded list and see if it corresponds with the labels.

Label Encoding is a preprocessing method that is used in many machine learning projects as it makes the training process more efficiently. Please see the video below for the complete tutorial.


To stay in touch with me, follow @cristi


Cristi Vlad Self-Experimenter and Author

Sort:  

Great tutorial! Thanks for taking the time to share it with the steemit community!

Coin Marketplace

STEEM 0.26
TRX 0.20
JST 0.038
BTC 97158.43
ETH 3589.50
USDT 1.00
SBD 3.86