# Looking for 2D artificial data to demonstrate properties of clustering algorithms

I am looking for datasets of 2 dimensional datapoints (each datapoint is a vector of two values (x,y)) following different distributions and forms. Code to generate such data would also be helpful. I want to use them to plot / visualise how some clustering algorithms perform. Here are some examples:

-
I vote for cw ;) –  steffen Feb 20 '12 at 12:53
A similar question in lines of specific datasets has been closed here : stats.stackexchange.com/questions/38928/… –  PraneethVepakomma Dec 22 '12 at 18:09

## migrated from stackoverflow.comFeb 20 '12 at 7:47

This question came from our site for professional and enthusiast programmers.

R comes with a lot of datasets, and it looks like it would not be a big deal to reproduce most of the examples you cited with few lines of code. You may also find the mlbench package useful, in particular synthetic datasets starting with mlbench.*. Some illustrations are given below.

You will find additional examples by looking at the Cluster Task View on CRAN. For example, the fpc package has a built-in generator for "face-shaped" clustered benchmark datasets (rFace).

Similar considerations apply to Python, where you will find interesting benchmark tests and datasets for clustering with the scikit-learn.

The UCI Machine Learning Repository hosts a lot of datasets as well, but you're better off simulating data yourself with the language of your choice.

-

Here are some datasets designed exactly for this task:

-
(+1) Thanks for the link. –  chl Feb 20 '12 at 15:51

Here is a customizable cluster generator. It only addresses a certain class of data sets, but it can surely be used for cluster algorithm investigations.

Here is an example of the kind of clusters it can create:

Cluster affiliation is saved in a text file. The code is open source under MIT license.

-

This Matlab script generates 2D data for clustering. It accepts several parameters so that the generated data is within user requirements.

-

ELKI comes with a couple of data sets (check also the unit tests, they contain many more than those on the web site, along with parameter settings).

It also includes a fairly flexible data generator.

-