Leverage categorical data

I wonder how categorical data can be used, not in sentence or image classification. Is there an example? For example, the characteristic data used in the Titanic.

The standard technique is to represent categorical data via “one-hot” encoding, where you present a set of numbers where one is 1 and all the rest are 0.

1 Like

Is there any example? I posted a question because I couldn’t see it on GitHub.


There are a couple of techniques generally we follow to handle categorical data

  1. One-hot Encoding: Converts the categorical data into numeric data by splitting the column into multiple columns. The numbers are replaced by 1s and 0s, depending on which column has what value.

  2. Label Encoding: Converting each value in a column into a number.

Please refer to One hot encoding vs label encoding in Machine Learning article may help you!

Thank you!

1 Like

Great! But I wanted to see an example of one-hot encoding implemented in Kotlin!