Generate a matrix which contains 70% of the data from another matrix
Show older comments
I am trying to define a matrix to be used as training data to be a subset (70%) of another matrix (100%). The remaining 30% will be used to validate the model that I will apply to the 70%. I am writing a script to do this automatically.
So basically say I have a 100 rows, I want to generate a matrix with 70 rows, and this could be from row 1 to row 70 and contain all the columns. However I don't know the amount of rows in each matrix because I have different sets of data to apply my script to.
What would be a way to go about this? Any help is appreciated.
Accepted Answer
More Answers (0)
Categories
Find more on Logical 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!