Unsupervised Learning in R
Hank Roark
Senior Data Scientist at Boeing
# Fitting hierarchical clustering models using different methods
hclust.complete <- hclust(d, method = "complete")
hclust.average <- hclust(d, method = "average")
hclust.single <- hclust(d, method = "single")
# Check if scaling is necessary
colMeans(x)
-0.1337828 0.0594019
apply(x, 2, sd)
1.974376 2.112357
# Produce new matrix with columns of mean of 0 and sd of 1
scaled_x <- scale(x)
colMeans(scaled_x)
2.775558e-17 3.330669e-17
apply(scaled_x, 2, sd)
1 1
Unsupervised Learning in R