appendix-a

Appendix A. Solutions to the exercises

 

Chapter 2: Types of machine learning

For the questions in this chapter, your answers don’t need to match mine. If you have different ideas for models used in these applications, they might be great! I encourage you to look them up in the literature, and if they don’t exist, try to implement them.

Exercise 2.1

For each of the following scenarios, state if it is an example of supervised or unsupervised learning. Explain your answers. In cases of ambiguity, pick one and explain why you picked it.

  1. A recommendation system on a social network that recommends potential friends to a user
  2. A system in a news site that divides the news into topics
  3. The Google autocomplete feature for sentences
  4. A recommendation system on an online retailer that recommends to users what to buy based on their past purchasing history
  5. A system in a credit card company that captures fraudulent transactions

Solution

Depending on how you interpreted the problem and the dataset, each of these can be considered an example of supervised or unsupervised learning. It is completely OK (and encouraged!) to have different answers, as long as the reasoning behind them is correct.

Chapter 3: Drawing a line close to our points: Linear regression

Chapter 4: Optimizing the training process: Underfitting, overfitting, testing, and regularization

Chapter 5: Using lines to split our points: The perceptron algorithm

Chapter 6: A continuous approach to splitting points: Logistic classifiers

Chapter 7: How do you measure classification models? Accuracy and its friends

Chapter 8: Using probability to its maximum: The naive Bayes model

Chapter 9: Splitting data by asking questions: Decision trees

Chapter 10: Combining building blocks to gain more power: Neural networks

Chapter 11: Finding boundaries with style: Support vector machines and the kernel method

Chapter 12: Combining models to maximize results: Ensemble learning

Chapter 13: Putting it all in practice: A real-life example of data engineering and machine learning