split data in train and test sets in a very specific way

Hey guys!
I am trying to design a neural network (via fitcnet) to classify subjects into three classes. There is a txt file that consists of 1092 rows and 14 collums (1092 x 14). The 14th collumn has the class of the sets either A, B or C and I specificly want the first 450 x 14 of them to be the training set and the rest of them to be the test set. Is there any way to do that?
Thank you in advance!

 Accepted Answer

The change to make, then, is that you manually create your partition instead of using cvpartition.
dataTrain = mydata(1:450,:);
dataTest = mydata(451:end,:);

3 Comments

Omg thank you, it was easier than I thought !
What if i also want to manually creat a vallidation data set. For example the first 450 rows as training set, the next 50 rows as vallidation data set and the remainings as a testset. Is it based on the same reasoning?
Follow the same process. If you need help with indexing an array, see Ch 5 of MATLAB Onramp.

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!