$27
ASSIGNMENT 2
Q1. CLUSTER VISUALIZATION BY MDS (50 MARKS)
You are given a data file that contains a sample survey result (regarding whether/how smartphone
use influence family life) in form of a csv file (a2.csv). The qs.pdf contains the detailed information of
the survey questions.
Your task is to apply MDS to find a scatterplot of a 5 dimensional dataset [Q64, Q44,Q37,Q35,Q34].
You must edit A2MDS.html to complete this assignment. You are already given the mds.js and
numeric.js that compute the MDS-coordinates for you. You dont have to worry about them at all.
If you look at the top part of the html file, then you will find out that these files are already included
in your project. So keep them along with your html (in the same directory).
You will first need to produce the squared distance matrix (see the lecture slide example). Represent it as a 2d array. Each entry i,j of the distance matrix needs to be filled with a distance between
the response of person i and person j.
If everything is correct, you can refresh your browser to see a scatterplot, where the colors of each
point is assigned based on the Q9age. You can see that the older age group forming small clusters,
whereas younger groups have high variance in their responses.
SUBMISSION INSTRUCTION
Submit the solution as Q1.html and a screenshot of the plot generated.
Q2. CLUSTER VISUALIZATION BY PCA (20 MARKS)
Your task is to apply PCA to find a scatterplot of a 5 dimensional dataset [Q64, Q44,Q37,Q35,Q34].
You must edit A2PCA.html to complete this assignment.
If everything is correct, you can refresh your browser to see a scatterplot, where the colors of each
point is assigned based on the age. This will be slightly different than the plot of Q2, but I think the
clusters will look only slightly better. You can see that the older age group forming small clusters,
whereas younger people have high variability in their responses.
SUBMISSION INSTRUCTION
Submit the solution as Q2.html and a screenshot of the plot generated.
Submission Deadline: See Moodle 1