R Unsupervised Flashcards

1
Q

what is the metric you should use to select the number of clusters

A

tot.withinss

access this by km.out$tot.withinss

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

function for kmeans

A
kmeans(data.frame, k, nstart = 50)
#just have nstart = 50 is a good idea.
part of base package
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

function for pca

A
prcomp()
pca = prcomp(USArrests, scale = T)   
# always do scale = T when different scales
part of base package
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

plot the first 2 principal components with loading vectors

A

biplot(pca, scale = 0)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly