Chapter 3. Building Models with Distance Metrics