Posts

Showing posts with the label Dummy Variables

Encoding categorical data

In some data set there may be categorical data. For example we can consider following data set. Country     Age     Salary USA            35        $62,000 UK              25        $58,000 Canada        40        $69,000 USA            40        $78,000 UK              30        $64,000 Canada        30        $61,000 If we consider the country column, it can be categorized by country. We are going to categorize it by giving USA=1, UK=2 and Canada=3. * Note: Since we are going to build mathematical model, we can't deal with data like row values in Country column. Therefore we convert them to numerical values. Country     Age    ...