MATLAB Answers

How to Use "Categorical Array" to organize data for Machine Learning

3 views (last 30 days)
Riyasat
Riyasat on 1 Dec 2015
Edited: Riyasat on 1 Dec 2015
Hello,
Presently I am working on a Project. I have 9 (Nine) classes of data. Each Class has 8 Different training files(raw data) from which I am extracting 16 Features. Thus, putting it in a single Matrix, I'm getting a 8x16 Numeric Array for Each class.
Finally, I concatenate all 9 (nine), 8x16 arrays in column and get a 72x16 table. Now I want a 17th column at the end, which should be a categorical column. But I don't want to do this Manually at the end, because my data length might change and I would've to adapt.
Here, in the figure I manually did it with Repmat function and entered a new table column, because I knew which row belonged to which class. but can I do it automatically while forming the rows at the first place? Again, is there a way to Create this categorical column from the row and column indexing of a Numeric Array. I'm very confused with categorical arrays. Thanks For your help.

  0 Comments

Sign in to comment.

Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!