Optimisation based approaches for machine learning