Converting target values into form appropriate for Neural Network Classificaton

I have a dataset in which class attribute has string values like normal,neptune,smurf etc against every tuple. I want to train a neural network to classify inputs into one of these target values. I want to convert these string class values into form like [0 0 1] [0 1 0] [1 0 0] means if the class is smurf then its [0 0 1] if its neptune then its [1 0 0]. Can someone tell how to do this in matlab.

 Accepted Answer

1. See the patternnet help and documentation examples
help patternnet
doc patternnet
Search the NEWSGROUP and ANSWERS for my patternnet posts
greg patternnet
Hope this helps.
Thank you for formally accepting my answer
Greg

3 Comments

Thanks Greg. I converted my target values using ind2vec function. Now what happen is when ever I tries to train my network (patternnet) Matlab throws me an error " Matlab encountered an internal error please close and restart" something like this. Even though I generalized classes to 5 from 23 but still same error. Please help.
What happens when you use one of the classification dataset examples in the documentation?
help nndatasets
doc nndatasets
ind2vec returned sparse double matrix so I have to convert it into full using full(s) and it worked. Thanks for your concern.

Sign in to comment.

More Answers (0)

Categories

Find more on Deep Learning Toolbox 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!