Hi Sylvain,
the Code is in the answer above, I missed to directly reply to your comment.
Some additional information:
In my full setup I am running this model for different datasets with different numbers of classes. The number of empty rows in the preds array ranges from 30%-90%. And here is the interesting relationship that I found: The number of empty rows divided by the number of classes was always 188. Not sure yet, what this means…