How to transform categorical features of a data set into numbers?
Show older comments
I'm doing preprocessing of Data set and my task is to transform categorical features into numeric.
I am using NSL_KDD datasets.
In that, 3 columns are said to be in categorical form
For e.g. My variables looke like....
protocol_type service flag
tcp ftp_data SF
udp other SF
tcp private S0
I need to change into
protocol_type service flag
1 20 9
2 44 9
1 49 5
In the dataset,
Feature 'protocol_type' has 3 categories
Feature 'service' has 64 categories
Feature 'flag' has 11 categories
Accepted Answer
More Answers (0)
Categories
Find more on Descriptive Statistics in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!