MATLAB - generate confusion matrix from classifier
问题 I have some test data and labels: testZ = [0.25, 0.29, 0.62, 0.27, 0.82, 1.18, 0.93, 0.54, 0.78, 0.31, 1.11, 1.08, 1.02]; testY = [1 1 1 1 1 2 2 2 2 2 2 2 2]; I then sort them: [sZ, ind] = sort(testZ); %%Sorts Z, and gets indexes of Z sY = testY(ind); %%Sorts Y by index [N, n] = size(testZ'); This will then give the sorted Y data. At each element of the sorted Y data, I want to classify each point to the left as being of type 1 and everything to the right being class 2; This will then be