Chapter 3 and 4 Machine learning with R