An implementation of the prediction strength algorithm from Tibshirani, Walther, Botstein, and Brown's "Cluster validation by prediction strength".
R
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
examples
README.md
prediction-strength.R
simulations.R

README.md

About

An implementation of the prediction strength algorithm from Tibshirani, Walther, Botstein, and Brown's "Cluster validation by prediction strength". A description of the algorithm can be found here.

Examples

	# Three clusters in 2 dimensions
	x = c(rnorm(20, mean = 0), rnorm(20, mean = 3), rnorm(20, mean = 5))
	y = c(rnorm(20, mean = 0), rnorm(20, mean = 5), rnorm(20, mean = 0))
	data = cbind(x, y)

	png("examples/3_clusters_2d.png")
	qplot(x, y)
	dev.off()

3 clusters in 2 dimensions

	png("examples/3_clusters_2d_ps.png")
	prediction_strength(data)
	dev.off()

3 clusters in 2 dimensions

	# Four clusters in 3 dimensions
	x = c(rnorm(20, mean = 0), rnorm(20, mean = 3), rnorm(20, mean = 5), rnorm(20, mean = -10))
	y = rnorm(80, mean = 0)
	z = c(rnorm(40, mean = -5), rnorm(40, mean = 0))
	data = cbind(x, y, z)

	png("examples/4_clusters_3d.png")
	scatterplot3d(x, y, z)
	dev.off()

4 clusters in 3 dimensions

	png("examples/4_clusters_3d_ps.png")
	prediction_strength(data)
	dev.off()

4 clusters in 3 dimensions