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!

 Akzeptierte Antwort

Cris LaPierre
Cris LaPierre am 17 Aug. 2022
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 Kommentare

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.
thank you Cris!

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Deep Learning Toolbox finden Sie in Hilfe-Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by