In the traditional approach to problem solving with machine learning, the developer typically selects from amongst the many machine learning algorithms developed over the last few decades. In this talk we describe an alternative methodology for applying machine learning, in which a bespoke solution is formulated for each new application. The solution is expressed through a compact modelling language and the corresponding custom machine learning code is then generated automatically. This model-based approach offers several advantages, including the opportunity to create highly tailored models for specific scenarios, rapid prototyping and comparison of a range of alternative models, and transparency of functionality. The first part of the talk will present the principles and ideas behind model-based machine learning and the second part of the talk will be a short tutorial on Infer.NET which is a framework for model-based machine learning.