logistic regresion for handwriting recognition