Every problem in the chapter beside the book’s answer, a chapter at a time as you scroll.

Chapter 6: Decision-Making Using Machine Learning Basics

5 problems · 0 figures

6-1 §6.2 source ↗

You are working with a dataset containing information about customer purchases at an online retail store. Each data point represents a customer and includes features such as age, gender, location, browsing history, and purchase history. Your task is to segment the customers into distinct groups based on their purchasing behavior in order to personalize marketing strategies. Which of the following machine learning techniques is best suited for this scenario?
  1. a.
    linear or multiple linear regression
  2. b.
    logistic or multiple logistic regression
  3. c.
    k-means clustering
  4. d.
    naïve Bayes classification

Answer

C. k-means clustering

Quantitative Problem 6.1 §6.1 source ↗

 
a.
Consider the data in the following table representing world record fastest times for the 100 m sprint and the year in which each occurred, from 1912 through 2002:
Using software such as Excel, Python, or similar tools, the regression line can be found. For this data, the linear model would be y ^ = − 0.00769 x + 10.55 , where x is years since 1900. Compute the MAE, MAPE, MSE, and RMSE for this model.
b.
Use the model to predict the world record fastest time for the 100 m spring in 2023. In August of 2023, Noah Lyles ran the 100 m sprint in 9.83 seconds. How does your prediction compare to this value?
Table 6.10 in the book ↗
Year Time
1912 10.6
1921 10.4
1930 10.3
1936 10.2
1956 10.1
1960 10
1968 9.95
1983 9.93
1988 9.92
1991 9.9
1991 9.86
1994 9.85
1996 9.84
1999 9.79
100-Meter Spring Records

Answer (2 parts)

a.
MAE = 0.0415. MAPE = 0.41%. MSE = 0.003126. RMSE = 0.0559.
b.
9.60. This is only about 2.3% off from the actual value of 9.83.

Quantitative Problem 6.2 §6.2 source ↗

If today is a cloudy day, then there is 68% chance of rain tomorrow. If today is not cloudy, then there is only 15% chance of rain tomorrow. Build a discrete logistic regression model based on this data.

Answer

1 1 + e 1.735 − 2.488 x

Quantitative Problem 6.3 §6.4 source ↗

Compute the information contained in the events.
a.
Obtaining a head and a tail on a flip of two fair coins
b.
Obtaining all heads on the flip of three fair coins
c.
Rolling 10 fair 6-sided dice and obtaining all 1s

Answer (3 parts)

a.
1
b.
3
c.
25.85

Quantitative Problem 6.4 §6.4 source ↗

Compute the entropy of the following discrete random variables.
a.
The distribution X whose values are given in the following table.
b.
The binomial distribution with p = 1 / 3 and n = 4 . Recall, the binomial distribution is defined by:
P ( x ) = ( n x ) p x ( 1 − p ) n − x
Table 6.11 in the book ↗
X 1 2 3 4
p ( x ) 0.7 0.15 0.05 0.05
Distribution X Values

Answer (2 parts)

a.
1.203
b.
1.919

Loading chapter 7…

Problems and answers are adapted from Principles of Data Science by Shaun V. Ault, Soohyun Nam Liao and Larry Musolino, OpenStax, and are used under the CC BY-NC-SA 4.0 licence. Access for free at https://openstax.org/books/principles-data-science/pages/1-introduction. Illustrations: Copyright Rice University, OpenStax, under CC BY-NC-SA 4.0 license. This adaptation is released under the same licence, is non-commercial, and is neither affiliated with nor endorsed by OpenStax or Rice University.