Pattern recognition and statistical learning in stochastic mechanics