Question: Using R coding 2 . The data set in nutrients.txt contains nutrients in 2 7 different kinds of food. ( 2 5 Credits ) (

Using R coding 2. The data set in nutrients.txt contains nutrients in 27 different kinds of food. (25 Credits)
(a) Apply K-means clustering with 4 clusters and show the cluster assignment of each food (please sort by cluster label, not the food name, using the sort() function) and the withincluster sum of squares of each cluster. (10 Credits)
(b) Apply agglomerative hierarchical clustering based on single-linkage, complete linkage, and average linkage algorithms. Plot the dendrograms for all three algorithms. (15 Credits)
Appendix
More information on the Pima Indians Diabetes Data Set
Number of Instances: 768
Number of Attributes: 8 plus class
Description of Each Attribute: (all numeric-valued)
1. Number of times pregnant
2. Plasma glucose concentration a 2 hours in an oral glucose tolerance test
3. Diastolic blood pressure ( mm Hg )
4. Triceps skin fold thickness (mm)
5.2-Hour serum insulin (\(\mathrm{mu}\mathrm{U/ml}\))
6. Body mass index (weight in \(\mathrm{kg}/\)(height in m\()^{\wedge}2\))
7. Diabetes pedigree function
8. Age (years)
9. Class variable (0 or 1)
The diagnostic, binary-valued variable investigated is whether the patient shows signs of diabetes according to World Health Organization criteria (i.e., if the 2 hour post-load plasma glucose was at least \(200\mathrm{mg}/\mathrm{dl}\) at any survey examination or if found during routine medical care). The population lives near Phoenix, Arizona, USA.
Using R coding 2 . The data set in nutrients.txt

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!