October 2017
Beginner to intermediate
572 pages
26h 1m
English
Perform the following steps to cluster digits with different clustering techniques:
> install.packages("png")
> library(png)
> img2 = readPNG("handwriting.png", TRUE)
> img3 = img2[,nrow(img2):1]
> b = cbind(as.integer(which(img3 < -1) %% 28), which(img3 < -1) / 28)
> plot(b, xlim=c(1,28), ylim=c(1,28))

> set.seed(18) > fit = kmeans(b, 2) > plot(b, col=fit$cluster) > plot(b, ...
Read now
Unlock full access