Suppose I have a dataset of size(10000, 45). One of the features in the dataset is activity_type in which the values vary from 1 to 15 as shown below:
df = pd.read_csv('actTrain.csv') df['activity_type'].head()
The output of the above code is as:
0 1 1 1 2 2 3 1 4 3 Name: activity_type, dtype: int64
Will encoding the activity_type in the above code using OneHotEncoder in sklearn will improve the model in anyway? Is it necessary to encode that feature. And if yes, which should I choose : LabelEncoder or OneHotEnocder? Thanks in advance.