Skip to content

Commit

Permalink
new visualizations added for Michael
Browse files Browse the repository at this point in the history
  • Loading branch information
dainis-boumber committed Feb 4, 2018
1 parent 773738c commit 2ca1480
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 2 deletions.
4 changes: 2 additions & 2 deletions complexity.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,8 @@ def main():

# experiments.append('moons')
# datasets.append((u.hastie(1000), u.hastie(1000)))
datasets.append((make_gaussian_quantiles(n_samples=500, n_features=10, n_classes=3),
make_gaussian_quantiles(n_samples=500, n_features=10, n_classes=3)))
datasets.append((make_gaussian_quantiles(cov=0.5, n_samples=50, n_features=10, n_classes=2),
make_gaussian_quantiles(n_samples=50, n_features=10, n_classes=2)))
experiments.append('gauus')

active(classifiers=clfs, datasets=datasets, experiments=experiments)
Expand Down
28 changes: 28 additions & 0 deletions visuals.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import matplotlib.pyplot as plt
from sklearn.datasets import make_blobs
import numpy as np

Xs, ys = make_blobs(300, centers=[[0, 0], [0, 1]], cluster_std=0.1)
Xt, yt = make_blobs(300, centers=[[1, -1], [1, 0]], cluster_std=0.2)

figure = plt.figure(figsize=(27, 13))
grid_size = (1, 2)
ax = plt.subplot2grid(grid_size, (0, 0))

ax.set_title('Dist 1')
X1, y1 = make_blobs(300, centers=[[0, 0], [0, 1]], cluster_std=0.1)
X2, y2 = make_blobs(300, centers=[[1, -1], [1, 0]], cluster_std=0.1)
X=np.vstack((X1,X2))
y=np.hstack((y1,y2))
ax.scatter(X[:,0], X[:,1], c=y, cmap='cool', alpha=0.4)
ax = plt.subplot2grid(grid_size, (0, 1))

ax.set_title('Dist 2')
X1, y1 = make_blobs(300, centers=[[0, 0.5], [0, 1]], cluster_std=0.1)
X2, y2 = make_blobs(300, centers=[[1, -1], [1, 0]], cluster_std=0.2)
X3, y3 = make_blobs(300, centers=[[0.4, 0.9], [0, 1]], cluster_std=0.06)
X=np.vstack((X1,X2,X3))
y=np.hstack((y1,y2,y3))
plt.scatter(X[:,0], X[:,1], c=y, cmap='cool', alpha=0.4)
figure.savefig(filename='vis/idea.png')
plt.show()

0 comments on commit 2ca1480

Please sign in to comment.