Predictive Analytics and Machine Learning
Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit
Exam practice exercises
Predictive Analytics and Machine Learning
Things to keep in mind
• Today’s practice questions reflect the style of SOME questions in the exam.
• It does not imply that different style of questions will not be asked.
• Difficulty does not necessarily reflect the difficulty of questions in the exam.
• This practice is just intended to further help you understand the methods.
• You must still study and understand the content of the whole unit. Not just practice the questions in this lecture.
Example 1
A hospital has determined that the probability that emergency room (ER) patients have heart disease is given as
Pr(yi = 1|xi ) = g(4 + 0.02Agei − 0.04MaxHRi ).
Where MaxHR denotes the maximum heart rate of the patient measured in a span of two minutes. When
the probability that a patient has heart disease is greater that 80%, the patient is immediately seen by a doctor. A 38 year old patient has been recently admitted to the ER. For what values of MaxHR would this patient need to be seen immediately by a doctor?
Example 2
The data set in the plot below consists of the two predictors Walks and HmRun for 10 Baseball players.
HmRun |
We want to fit a regression tree to this data in order to predict salary. We want to consider a tree with two leaves (or terminal nodes). The annual salary for these players is
X |
Salary |
-Mike Heath |
650 |
-John Russell |
155 |
-Pete Incaviglia |
172 |
-Glenn Davis |
215 |
-Frank White |
750 |
-Rafael Santana |
250 |
-Chili Davis |
815 |
-Herm Winningham |
90 |
-Robby Thompson |
140 |
-Joe Carter |
250 |
1. According to the overall SSE measure, which of the following is the best tree partition for this data?
Partition 1 = {j = Walks, s = 50}; Partition 2 = {j = Walks, s = 35}; Partition 3 = {j =
HmRun, s = 10}; Partition 4 = {j = HmRun, s = 20}.
2. Using the optimal partition, what is the predicted salary for the player John Doe who has produced
15 home runs and a total number of 55 walks?
Example 3
1. The figure below defines a neural network in R and presents some output in the R console window. Produce a network diagram of the neural network. Be explicit about the values of the weights and biases.
2. Based on the diagram, what are the values for the vectors β 1 and β 2 ?
3. Use the neural network in question 1 to compute a prediction when xi1 = 1, xi2 = 3 and xi3 = −2 (show your workings on a piece of paper).
4. Discuss whether this neural network should be used for regression or classification.
2022-05-19