Python代写-COMP10200

COMP10200: Sample Test 2 Questions
Sam Scott, Mohawk College, Fall 2019
Knowledge and Understanding ___ / 29
These questions test your basic knowledge of machine learning concepts When developing a machine
learning system, why do we split the data into training and testing sets? Explain the role of each of these
sets.
1. What does it mean to say that the perceptron learning algorithm is a linear classifier? Explain (using
a diagram if necessary) why the perceptron is a linear classifier. [3]

2. Both perceptron and multi-layer perceptron require multiple epochs to learn a task. What is an
epoch, and why do we need more than one? [2]

2

3. List one advantage and one disadvantage to using a higher learning rate in a perceptron or multi-
layer perceptron. [2]

4. Why is it a good idea to start a multi-layer perceptron with random weight values? Why not just use
0 weights to start? [3]

5. List 3 different activation functions that are commonly used in a multi-layer perceptron. [3]

6. What is the name of the learning algorithm used for multi-layer perceptron? [1]

3

7. Explain how a multi-layer perceptron can be used for a classification task with 10 possible labels.
Why couldn’t a perceptron be used in this way? [3]

8. Compare Regression and Classification. Describe one main similarity and one main difference
between these two types of machine learning tasks. [2]

Similarity:

Difference:

9. What is “linear” about a Linear Regression, and what does it mean to say that it’s linear? [2]

What’s Linear:

What it means:

4

10. Describe one important similarity and one important difference between the classification and
clustering tasks in machine learning. [2]

Similarity:

Difference:

11. Name three different ways of calculating similarity for a clustering algorithm. [2]

a. _________________

b. _________________

c. _________________

5

12. The k-Means clustering algorithm uses “centroids” to form its clusters. What is a centroid, and how
does the k-Means algorithm use them to determine which data points belong to which clusters? [2]

What is a centroid:

How k-Means determines clusters:

13. Describe how you could determine the best k value for k-Means on a given set of data. [2]

6

Application ____ / 28
The questions in this section ask you to apply your knowledge of machine learning techniques.
14. Consider the sample data below, describing a set of sculptures drawn from a larger database of
10 000 sculptures. For each sculpture the length, width, height, weight, artist, and audience reaction
were recorded. Would this data be suitable for a clustering task? How about classification or
numerical forecasting? In each case, state whether or not the data could be used, and explain how it
could be used (i.e. describe the task, features, outputs, etc.) [6]
Reaction Artist Length Width Height Weight
NEGATIVE Rodin 6 50 33 96
NEGATIVE Picasso 68 80 70 2
NEUTRAL Donatello 100 44 10 1
POSITIVE Rodin 62 20 10 20
NEUTRAL Picasso 73 27 5 86
NEGATIVE Picasso 93 19 95 52
NEUTRAL Donatello 17 25 61 68
NEUTRAL Michaelangelo 36 18 45 15

Classification:

Clustering:

Regression:

7

15. Consider a regression task with 3 features. Your linear regression model has assigned weights of
3.07 to Feature 1, -2.05 to Feature 2, and 0.02 to Feature 3. Use this information to make
predictions for the previously unseen data below, rounded to two decimal places. Make sure that
you show all of your work. [4]
Example Feature 1 Feature 2 Feature 3 Predicted Value
1 -9 2 120 _______
2 3 8 220 _______
3 10 0 150 _______

16. Using your predictions from exercise 1 and the target values below, compute the total Residual Sum
Squared Error rounded to two decimal places. Make sure that you show all of your work. [3]
Example Target
1 -10.23
2 -3.11
3 15.99

8

17. Use the scatterplot below to simulate one iteration of the k-Means algorithm for k=2. The two
initial, randomly-placed centroids are shown as large squares.

a. Draw approximate boundaries around the points that will be assigned to each of the two
centroids. Explain below what criteria you used to decide where to draw the boundaries. [2]

b. Now show approximately where each centroid will be moved to for the second iteration.
Explain below how you decided where to move each centroid. [2]

9

18. Given the inputs and the connection weights for the multi-layer perceptron below, fill in the output
value for all the hidden units and the output unit (you can write the output values inside each unit).
The output function is rectified linear (ReLU) as shown below. Make sure you show all your work. [5]

0.5
0.1
-2
1
-1
3
-2
1
0.5
-0.5
10

19. Consider the perceptron shown below.

a. Write the equation for the decision boundary of this perceptron. [2]

b. The perceptron is presented with inputs 0.5 and 1.0. These inputs cause it to output a 0, but
the target was 1. Use the perceptron learning rule to modify the weights and threshold, and
show the new values for each. Show all your work. [4]

0.2
-0.1
t=0.3
Learning Rate = 0.05
0.5
1.0