Q1) [5 points] Using the MapReduce model, obtain the matrix multiplication of A and B. Both matrices are given below. You should use at least two mappers and two reducers. The number of mappers and reducers is not needed to be equal. You may use any number of mappers (two or more) and any number of reducers (two or more). Also, write a program using any programming language to implement the MapReduce matrix multiplication.
A |
B |
|||||
6 |
9 |
8 |
1 |
20 |
7 |
|
15 |
4 |
10 |
3 |
18 |
13 |
|
2 |
11 |
|||||
12 |
5 |
Write a report showing all the steps of MapReduce model including the following sections:
Important notes:
Q2) [5 points] Write a program (with any programming language) to train and build a decision tree model using the following labeled dataset so that the model can predict whether in the future the tennis court will be occupied or not.
Day |
Outlook |
Temperature |
Humidity |
Wind |
Occupied |
D1 |
Sunny |
Hot |
High |
Weak |
No |
D2 |
Sunny |
Hot |
High |
Strong |
No |
D3 |
Overcast |
Hot |
High |
Weak |
Yes |
D4 |
Rain |
Mild |
High |
Weak |
Yes |
D5 |
Rain |
Cool |
Normal |
Weak |
Yes |
D6 |
Rain |
Cool |
Normal |
Strong |
No |
D7 |
Overcast |
Cool |
Normal |
Strong |
Yes |
D8 |
Sunny |
Mild |
High |
Weak |
No |
D9 |
Sunny |
Cool |
Normal |
Weak |
Yes |
D10 |
Rain |
Mild |
Normal |
Weak |
Yes |
D11 |
Sunny |
Mild |
Normal |
Strong |
Yes |
D12 |
Overcast |
Mild |
High |
Strong |
Yes |
D13 |
Overcast |
Hot |
Normal |
Weak |
Yes |
D14 |
Rain |
Mild |
High |
Strong |
No |
Then, write a program to build only the first level of the decision tree (that is to find the first branch of the tree) using MapReduce. You must use multiple mappers and reducers assuming your dataset is stored in chunks at multiple nodes as follows:
Node 1 |
|||||
Day |
Outlook |
Temperature |
Humidity |
Wind |
Occupied |
D1 |
Sunny |
Hot |
High |
Weak |
No |
D2 |
Sunny |
Hot |
High |
Strong |
No |
D3 |
Overcast |
Hot |
High |
Weak |
Yes |
D4 |
Rain |
Mild |
High |
Weak |
Yes |
D5 |
Rain |
Cool |
Normal |
Weak |
Yes |
Node 2 |
|||||
Day |
Outlook |
Temperature |
Humidity |
Wind |
Occupied |
D6 |
Rain |
Cool |
Normal |
Strong |
No |
D7 |
Overcast |
Cool |
Normal |
Strong |
Yes |
D8 |
Sunny |
Mild |
High |
Weak |
No |
D9 |
Sunny |
Cool |
Normal |
Weak |
Yes |
D10 |
Rain |
Mild |
Normal |
Weak |
Yes |
Node 3 |
|||||
Day |
Outlook |
Temperature |
Humidity |
Wind |
Occupied |
D11 |
Sunny |
Mild |
Normal |
Strong |
Yes |
D12 |
Overcast |
Mild |
High |
Strong |
Yes |
D13 |
Overcast |
Hot |
Normal |
Weak |
Yes |
D14 |
Rain |
Mild |
High |
Strong |
No |
Write a report showing all the steps of the Decision tree and MapReduce Models including the following sections:
Important notes: