Question: BUAN 6 2 0 Data Science Foundations Designed by: Dr . Roy Jafari Programing Assignmnet # 6 Fill in your name first: - Name: -

BUAN 620 Data Science Foundations
Designed by: Dr. Roy Jafari
Programing Assignmnet #6
Fill in your name first:
-Name:
-Redlands Email ID:
In [1]: import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
import seaborn as sns
Chapter 13- Excercise 8
In this exercise, we would like to use the dataset Cereals.csv. This dataset contains rows of information about different cereal products. We would like to perform clustering analysis on this dataset, first using K-means and then using PCA. Perform the following steps.
In [2]: cereal_df = pd.read_csv('Cereals.csv')
cereal_df.head()
\table[[,name,mfr,type,calories,protein,fat,sodium,fiber,carbo,sugars,potass,vitamins,shelf,weight,cups,rating],[0,100%?Bran,N,C,70,4,1,130,10.0,5.0,6.0,280.0,25,3,1.0,0.33,68.402973],[1,100%?NaturalBran,Q,C,120,3,5,15,2.0,8.0,8.0,135.0,0,3,1.0,1.00,33.983679],[2,All-Bran,K,C,70,4,1,260,9.0,7.0,5.0,320.0,25,3,1.0,0.33,59.425505],[3,All-Bran_with_Extra_Fiber,K,C,50,4,0,140,14.0,8.0,0.0,330.0,25,3,1.0,0.50,93.704912],[4,Almond_Delight,R,C,110,2,2,200,1.0,14.0,8.0,NaN,25,3,1.0,0.75,34.384843]]
a. Impute a central tendency of the attribute for all the missing values.
In []:
b. What central tendency did you choose and why?
In []:
c. Why did we impute using the central tendency? why not other methods? Answer by commenting on how the data will b e used next (clustering).
name,mfr,type,calories,protein,fat,sodium,fiber,carbo,sugars,potass,vitamins,shelf,weight,cups,rating
100%_Bran,N,C,70,4,1,130,10,5,6,280,25,3,1,0.33,68.402973
100%_Natural_Bran,Q,C,120,3,5,15,2,8,8,135,0,3,1,1,33.983679
All-Bran,K,C,70,4,1,260,9,7,5,320,25,3,1,0.33,59.425505
All-Bran_with_Extra_Fiber,K,C,50,4,0,140,14,8,0,330,25,3,1,0.5,93.704912
Almond_Delight,R,C,110,2,2,200,1,14,8,,25,3,1,0.75,34.384843
Apple_Cinnamon_Cheerios,G,C,110,2,2,180,1.5,10.5,10,70,25,1,1,0.75,29.509541
Apple_Jacks,K,C,110,2,0,125,1,11,14,30,25,2,1,1,33.174094
Basic_4,G,C,130,3,2,210,2,18,8,100,25,3,1.33,0.75,37.038562
Bran_Chex,R,C,90,2,1,200,4,15,6,125,25,1,1,0.67,49.120253
Bran_Flakes,P,C,90,3,0,210,5,13,5,190,25,3,1,0.67,53.313813
Cap'n'Crunch,Q,C,120,1,2,220,0,12,12,35,25,2,1,0.75,18.042851
Cheerios,G,C,110,6,2,290,2,17,1,105,25,1,1,1.25,50.764999
Cinnamon_Toast_Crunch,G,C,120,1,3,210,0,13,9,45,25,2,1,0.75,19.823573
Clusters,G,C,110,3,2,140,2,13,7,105,25,3,1,0.5,40.400208
Cocoa_Puffs,G,C,110,1,1,180,0,12,13,55,25,2,1,1,22.736446
Corn_Chex,R,C,110,2,0,280,0,22,3,25,25,1,1,1,41.445019
Corn_Flakes,K,C,100,2,0,290,1,21,2,35,25,1,1,1,45.863324
Corn_Pops,K,C,110,1,0,90,1,13,12,20,25,2,1,1,35.782791
Count_Chocula,G,C,110,1,1,180,0,12,13,65,25,2,1,1,22.396513
Cracklin'_Oat_Bran,K,C,110,3,3,140,4,10,7,160,25,3,1,0.5,40.448772
Cream_of_Wheat_(Quick),N,H,100,3,0,80,1,21,0,,0,2,1,1,64.533816
Crispix,K,C,110,2,0,220,1,21,3,30,25,3,1,1,46.895644
Crispy_Wheat_&_Raisins,G,C,100,2,1,140,2,11,10,120,25,3,1,0.75,36.176196
Double_Chex,R,C,100,2,0,190,1,18,5,80,25,3,1,0.75,44.330856
Froot_Loops,K,C,110,2,1,125,1,11,13,30,25,2,1,1,32.207582
Frosted_Flakes,K,C,110,1,0,20

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 Databases Questions!