Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong resulting picture #86

Open
agent18 opened this issue Feb 14, 2019 · 1 comment
Open

Wrong resulting picture #86

agent18 opened this issue Feb 14, 2019 · 1 comment

Comments

@agent18
Copy link

agent18 commented Feb 14, 2019

Please correct this. Its in the coursera slides as well. kmeansObj2$cluster needs to be used instead of kmeansObj$cluster. Like me many people spent time to understand what it was supposed to do, when it is a really simple thing

Heatmaps

set.seed(1234)
dataMatrix <- as.matrix(dataFrame)[sample(1:12), ]
kmeansObj2 <- kmeans(dataMatrix, centers = 3)
par(mfrow = c(1, 2), mar = c(2, 4, 0.1, 0.1))
image(t(dataMatrix)[, nrow(dataMatrix):1], yaxt = "n")
image(t(dataMatrix)[, order(kmeansObj2$cluster)], yaxt = "n")
@agent18
Copy link
Author

agent18 commented Feb 14, 2019

From this part: https://github.com/jtleek/modules/tree/master/04_ExploratoryAnalysis/kmeansClustering; Sorry I don't know the proper way of submitting requests!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant