This tutorial introduces some main concepts of machine learning (ML). From an engineering point of view, the field of ML revolves around developing software that implements the scientific principle: (i) formulate a hypothesis (choose a model) about some phenomenon, (ii) collect data to test the hypothesis (validate the model) and (iii) refine the hypothesis (iterate). One important class of algorithms based on this principle are gradient descent methods which aim at iteratively refining a model which is parametrized by some ("weight") vector. A plethora of ML methods is obtained by combining different choices for the hypothesis space (model), the quality measure (loss) and the computational implementation of the model refinement (optimization method). %Many of the current systems, which are considered as (artificially) intelligent, are based on %combinations of few basic machine learning methods. After formalizing the main building blocks of an ML problem, some popular algorithmic design patterns for ML methods are discussed. This tutorial grew out of the lecture notes developed for the courses "Machine Learning: Basic Principles" and "Artificial Intelligence", which I have co-taught since 2015 at Aalto University.