Naive Bayes and Bayesian Linear Regression from scratch, classification of MNIST and CIFAR10 datasets