data we know from that logistic regression makes predictionsyusing the following formulay [ [ [ [ [px[pb where [iand are coefficients learned from the training set and [iare the input features this formula makes sense when [iare numbersbut not when [ is "mastersor "bachelorsclearly we need to represent our data in some different way when applying logistic regression the next section will explain how we can overcome this problem one-hot-encoding (dummy variablesby far the most common way to represent categorical variables is using the one-hotencoding or one-out-of- encodingalso known as dummy variables the idea behind dummy variables is to replace categorical variable with one or more new features that can have the values and the values and make sense in the formula for linear binary classification (and for all other models in scikit-learn)and we can represent any number of categories by introducing one new feature per categoryas described here let' say for the workclass feature we have possible values of "government employee""private employee""self employed"and "self employed incorpo ratedto encode these four possible valueswe create four new featurescalled "gov ernment employee""private employee""self employed"and "self employed incorporateda feature is if workclass for this person has the corresponding value and otherwiseso exactly one of the four new features will be for each data point this is why this is called one-hot or one-out-of- encoding the principle is illustrated in table - single feature is encoded using four new features when using this data in machine learning algorithmwe would drop the original workclass feature and only keep the - features table - encoding the workclass feature using one-hot encoding workclass government employee government employee private employee self employed self employed incorporated private employee self employed self employed incorporated categorical variables