# TwoCircles Dataset

I am analysing an article dealing with: "Semi-supervised Graph Clustering: A Kernel Approach" I need to reproduct the figure 1 in page 7. http://www.cs.utexas.edu/users/inderjit/public_papers/kernel_icml.pdf

Thanks everyone

• Do you need the exact same dataset, or just something similar? – tomp Jan 18 '16 at 23:44
• Just something similar. – Kened Yassine Jan 19 '16 at 0:04

You could generate a similar dataset in Python using scikit-learn's make_circles function.

from sklearn.datasets import make_circles
import matplotlib.pyplot as plt

n_samples = 400

samples, labels = make_circles(n_samples=n_samples, factor=.3, noise=.05)

bluecircle = samples[labels==0]
redcircle  = samples[labels==1]

plt.figure()
plt.scatter(bluecircle[:, 0], bluecircle[:, 1], c='b', marker='o', s=10)
plt.scatter(redcircle[:, 0], redcircle[:, 1], c='r', marker='+', s=30)
plt.show()


In Matlab you could could generate the dataset with something like:

n = 200;
step = 1/n;
ratio = 0.4;

ang=0:step:2*pi;

hold on;

% blue circle
idx = randsample(length([xp;yp]),n);