Model selection for the LS-SVM. Application to handwriting recognition