<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8">
<meta name="generator" content="pdf2htmlEX">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<link rel="stylesheet" href="https://static.pudn.com/base/css/base.min.css">
<link rel="stylesheet" href="https://static.pudn.com/base/css/fancy.min.css">
<link rel="stylesheet" href="https://static.pudn.com/prod/directory_preview_static/627356a240256a40ce296817/raw.css">
<script src="https://static.pudn.com/base/js/compatibility.min.js"></script>
<script src="https://static.pudn.com/base/js/pdf2htmlEX.min.js"></script>
<script>
try{
pdf2htmlEX.defaultViewer = new pdf2htmlEX.Viewer({});
}catch(e){}
</script>
<title></title>
</head>
<body>
<div id="sidebar" style="display: none">
<div id="outline">
</div>
</div>
<div id="pf1" class="pf w0 h0" data-page-no="1"><div class="pc pc1 w0 h0"><img class="bi x0 y0 w1 h1" alt="" src="https://static.pudn.com/prod/directory_preview_static/627356a240256a40ce296817/bg1.jpg"><div class="c x0 y1 w2 h2"><div class="t m0 x1 h3 y2 ff1 fs0 fc0 sc0 ls0 ws0">Shreyaa Saravanan</div><div class="t m0 x2 h3 y3 ff1 fs0 fc0 sc0 ls0 ws0">18BCE1183</div><div class="t m0 x1 h3 y4 ff1 fs0 fc0 sc0 ls0 ws0">Dr. Paabiraman V</div><div class="t m0 x3 h3 y5 ff1 fs0 fc0 sc0 ls0 ws0">Data Visualizaon Lab </div><div class="t m0 x4 h3 y6 ff1 fs0 fc0 sc0 ls0 ws0">Exercise 4- KMeans Clustering</div><div class="t m0 x5 h4 y7 ff1 fs0 fc0 sc0 ls0 ws0">Dataset:<span class="ff2"> USCereals</span></div><div class="t m0 x5 h3 y8 ff1 fs0 fc0 sc0 ls0 ws0">Libraries used:</div><div class="t m0 x5 h4 y9 ff2 fs0 fc0 sc0 ls0 ws0">library(dyverse) # data manipulaon</div><div class="t m0 x5 h4 ya ff2 fs0 fc0 sc0 ls0 ws0">library(cluster) # clustering algorithms</div><div class="t m0 x5 h4 yb ff2 fs0 fc0 sc0 ls0 ws0">library(factoextra) </div><div class="t m0 x5 h4 yc ff2 fs0 fc0 sc0 ls0 ws0">library(MASS)</div><div class="t m0 x5 h3 yd ff1 fs0 fc0 sc0 ls0 ws0">Cleaning the dataset:</div><div class="t m0 x5 h4 ye ff2 fs0 fc0 sc0 ls0 ws0">data <-UScereal</div><div class="t m0 x5 h4 yf ff2 fs0 fc0 sc0 ls0 ws0">data <-na.omit(data)</div><div class="t m0 x5 h4 y10 ff2 fs0 fc0 sc0 ls0 ws0">head(UScereal)</div><div class="t m0 x5 h4 y11 ff2 fs0 fc0 sc0 ls0 ws0">df = subset(data, select = -c(mfr,vitamins) ) #columns with non-numeric val<span class="_ _0"></span>ues are dropped</div><div class="t m0 x5 h4 y12 ff2 fs0 fc0 sc0 ls0 ws0">df <- scale(df)</div></div></div><div class="pi" data-data='{"ctm":[1.611850,0.000000,0.000000,1.611850,0.000000,0.000000]}'></div></div>
</body>
</html>