Int Y_predict[N,K];

the previous code is int Y_predict[N,K];

should I change it to array[N,K] int Y_predict; or matrix[N,K] int Y_predict;?

The first one is correct

There’s a similar discussion in How to declare a integer-valued matrix? - #4 by Xavier_La_Rochelle

Thanks. @WardBrian