function testSummary(net)

datadir = tempdir;
[~,~,XTest,YTest] = loadCIFARData(datadir);

[YPredicted,probs] = classify(net,XTest);
testError = 1 - mean(YPredicted == YTest);

NTest = numel(YTest);
testErrorSE = sqrt(testError*(1-testError)/NTest);
testError95CI = [testError - 1.96*testErrorSE, testError + 1.96*testErrorSE];

fprintf('\n******************************************\n\n');
fprintf('Test error rate: %.4f\n',testError);
fprintf('Standard error: %.4f\n',testErrorSE);
fprintf('95%% confidence interval: [%.4f, %.4f]\n',testError95CI(1),testError95CI(2));
fprintf('\n******************************************\n\n');

figure
idx = randperm(numel(YTest),9);
for i = 1:numel(idx)
    subplot(3,3,i)
    imshow(XTest(:,:,:,idx(i)));
    prob = num2str(100*max(probs(idx(i),:)),3);
    predClass = char(YPredicted(idx(i)));
    label = [predClass,', ',prob,'%'];
    title(label)
end
end