Algorithm of Pattern Recognition and Machine Learning