Implemented bayesian learning from data