slipting sata manually into train, validation and test sets, then using fitcnet and testing accuracy
3 views (last 30 days)
So, I am trying to design a neural network to classify subjects into three classes via fitcnet. 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 , the next 150 x 14 to be the validation data and the rest of them to be the test set. Here is my code:
clc; clear all;
creditrating = readtable("STATSTOTAL.txt");
creditrating = removevars(creditrating,"Row");
creditrating.class = categorical(creditrating.class, ...
rng("default") % For reproducibility of the partition
creditTrain = creditrating(1:450 ,:);
creditVal=creditrating (451:600, :);
creditTest= creditrating (601:end, :);
It works fine!
****The thing is, how do I use the fitcnet function and how do I test the accuracy now that I have the three sets?
Without the validation data I did this following the example in matlab-help:
Mdl = fitcnet(creditTrain,"class")
testAccuracy = 1 - loss(Mdl,creditTest,"class", ...
But how do i change them now?
Thank you in advance!!