Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- samp <- sample(1:60000, 1)
- sampleimage <- mnistdata$X[samp,]
- allimages <- mnistdata$X[1:60000, ]
- distances <- apply(allimages, 1, eucdist, y=sampleimage)
- ...
- eucdist <- function(x, y) {
- dist <- sqrt(sum((x-y)^2))
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement