Problem 58887. Neural Net: Best Index of Prediction array
The final ouput of a neural net application is a Prediction matrix/vector,P, that gives the probability of the input being of a set of N classes represented by the columns.
For the XOR function the input matrix is [0 0;0 1;1 0;1 1] with an expected output vector of [0;1;1;0]. Ouput of Zero would be represented by a higher likelihood in column 1 than column 2 of the Prediction matrix.
Given a P matrix [m,n] where there are m cases and n possible outcomes return peak value for each case and the index of the most likely outcome.
[case_peak,case_idx]=Prediction(P)
if P was [0.1 0.5 0.9;0.2 0.8 0.4] (2 cases with 3 possible outcomes 1:3) return case_peak=[0.9;0.8] and case_idx=[3;2]
Solution Stats
Solution Comments
Show commentsProblem Recent Solvers12
Suggested Problems
-
It dseon't mettar waht oedrr the lrettes in a wrod are.
1879 Solvers
-
Sum all integers from 1 to 2^n
15688 Solvers
-
Maintain shape of logical-index mask
70 Solvers
-
Matrix indexing with two vectors of indices
726 Solvers
-
Generate a vector like 1,2,2,3,3,3,4,4,4,4
11752 Solvers
More from this Author308
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!