Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit

STATS 3DS3 Winter 2023

ASSIGNMENT 4

Submit through Avenue to Learn.

Due before 11pm on Friday, March 17th.

Your assignment must conform to the Assignment Standards listed below.

Assignments submitted up to 24 hours late will incur a 30% penalty.

Assignments submitted more than 24 hours late will receive a zero grade.

Answer all questions.  Not all questions carry equal marks.

All graphs must be labelled (including axes).

1.  (2 MARKS)

(a) What is the main difference between K-means and K-medoids clustering? (b) What is the main limitation of both K-means and K-medoids clustering?

2.  (3 MARKS)

You wish to apply a classification model to your dataset, and you want to measure the prediction performance of the model.

(a) Why would it be a good idea to use cross-validation?

(b) Outline how a dataset is partitioned during cross-validation.

(c) Define K”in K-fold cross-validation, (i.e. what does it represent?)

3.  (2 MARKS) Consider the four silhouette plots shown below:

(a) What is the best number of clusters to choose and why?

(b) What is the worst number of clusters to choose and why?


4.  (13 MARKS) Consider the iris dataset in R and answer ALL the questions below: First remove the Species column from the dataset (note: you night need it later).

(a)    i. Apply k-medoids clustering to the dataset for k=3.

ii. Produce a Silhouette plot for the clusters.

iii. Produce a classification table of results. (Your goal is to predict Species).

iv. What is the mis-classification rate?

v. What is the ARI?

(b)    i. Apply k-medoids clustering to the dataset for k=2.

ii. Produce a classification table of results.

iii. What is the ARI?

(c)    i. Apply k-medoids clustering to the dataset for k=4.

ii. Produce a classification table of results.

iii. What is the ARI?

iv. Which value of k (which cluster size) gave the best result, according to the ARI?


Assignment Standards

• LATEX is strongly recommended but not strictly required. The use of Markdown in R studio is also recommended.

• Submit your assignment as one .pdf document. All R code should be included and  organized  either  at  the  end  of the  assignment  or  inline  (if using  R

Markdown).

• Eleven-point font (times or similar) must be used with 1.5 line spacing and margins of at least 1 inch all around.

• Do not include a title page. The title and your name should be printed at the top of the first page.

Various tools, including publicly available internet tools, may be used by the instructor to check the originality of submitted work.