From the course: Vibe Coding for Data Analysts
Unlock this course with a free trial
Join today to access over 25,200 courses taught by industry experts.
Encoding categorical variables
From the course: Vibe Coding for Data Analysts
Encoding categorical variables
- Let's get genre in on the vibes. Categorical features can play a huge role in machine learning models, but need special treatment before we can use them. In a typical workflow, we might perform one-hot encoding on a categorical feature. This gives us a nice set of 01 dummy variables that a model can actually use. This is a standard task, so vibe coding should work pretty well. There are, however, a few ways to do it, so I'm excited to see what an LOM might suggest. Use categorical feature in coding for genre. This is amazing. Let's keep this and talk about it. It is used the get dummies function from Pandas for genre, which is exactly what we would want it to do. I have no doubt that this is going to work as expected, but still, let's take a look at it. We see that what we have are our genre alternative through genre rock, fantastic. It has gone a step further though, and not only dummy coded those or one-hot encoded those depending on what world you come from, but it has combined…