Fixed bug for predictions due to inappropriate usage of function sample in R.