Feeding categorical data to classifier Suppose I have the dataset in the following format:
col1    col2     col3      col4         col5 (to be predicted)
12      13       4         primary      label1
1       15       2         secondary    label2
5       7        8         primary      label3
14      12       44        college      label4

col5 needs to be predicted for some test data using col1, col2, col3 and col4
During training, col1, col2, col3 can be feeded as such in an array to the classifier but how to feed col4. I am aware that this is categorical and need to be converted to numeric type, but even after assigning some number, it will still remain as nominal type.
So if primary=1, secondary=2 and college=3, the numbers 1,2 and 3 cant be compared as per their magnitude because they are still like labels, with no numerical significance.
So how should I proceed after this step... should they be normalized ? or any further should be done ?
 A: In R just encode it as 1, 2, 3 and mark it as a factor. 
In python you could use one hot encoding. This means creating a new variable for each label, and then setting to one one of these variables. For example primary would become 1 0 0, secondary 0 1 0, college 0 0 1.
Since the labels also represent values on an interval scale, one could try to encode the labels 1, 2, 3 (and in R not mark it as a factor) to see if the model competes accuracy wise. A bit of fiddling with other numbers might also give a good prediction. In this case accuracy is chosen over cleanliness, or a good justification should be given.   
A: If you are using python, your data should probably be in a pandas.DataFrame object:
import pandas as pd
df = pd.read_cvs(data, sep=' ')  # there are lots of read options, hit tab after pd.read
df = df.drop(['col5'])           # Drop the target column before the next step

From there you can use one-hot style encoding by the get_dummies() function:
df = pd.get_dummies(test_dat)
This splits each categorical column by feature and replaces it one new column for each feature in a given column. If the index (i.e. row) contains the value its column was split from, then you'll see a 1, else you'll see a zero. 
This is useful when your classifier needs numerical data, however not all classifiers will need numerical data, so be sure to check that.
