diff --git a/Andrew Ng Stanford Coursera/Week 04/ex3/predictOneVsAll.m b/Andrew Ng Stanford Coursera/Week 04/ex3/predictOneVsAll.m index 2c85556..68b83e4 100644 --- a/Andrew Ng Stanford Coursera/Week 04/ex3/predictOneVsAll.m +++ b/Andrew Ng Stanford Coursera/Week 04/ex3/predictOneVsAll.m @@ -32,8 +32,15 @@ % temp = (X*all_theta'); % p(:) = max(temp,[],2); -h_theta = (X * all_theta'); -p = max(h_theta, [], 2); +%h_theta = (X * all_theta'); +%p = max(h_theta, [], 2); + + pro = X * all_theta'; + % m * num_labels + kind = max(pro, [], 2); + for i = 1: m + p(i) = find(pro(i,:) == kind(i)); +end % temp is of dimension 5000x10