Hello, I would like to get a leave-one out prediction matrix.
I have a create a model and represented as a score-model. Next step is generate a leave-one out prediction matrix.
Have: scored model, j-dimension prediction data set.
1. i=1
2. drop jth row from prediction data set, the prediction dataset will be j-1
3. call scored model to get prediction results (j-1 dimension)
4. i+1
5. loop will be finished once i=j
A simple j=5 will be like this:
id | x1…...xn | y1 | y2 | y3 | y4 | y5 |
1 | | n/a | p21 | p31 | p41 | p51 |
2 | | p12 | n/a | p32 | p42 | p52 |
3 | | p13 | p23 | n/a | p43 | p53 |
4 | | p14 | p24 | p34 | n/a | p54 |
5 | | p15 | p25 | p35 | p45 | n/a |
*n/a means that row has been dropped for prediction, so no prediction available, but still should be included in the results table.
would you please help on this codes? really appreciated that if the results can be generated as matrix shown in table above? really apricated!