Skip to content

Commit 6b5e978

Browse files
committed
Rebuild dev docs at master=34a97ec
1 parent e7de78b commit 6b5e978

File tree

252 files changed

+1368
-1332
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

252 files changed

+1368
-1332
lines changed

dev/_downloads/plot_gmm.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@
4646
dpgmm = mixture.DPGMM(n_components=5, covariance_type='full')
4747
dpgmm.fit(X)
4848

49-
color_iter = itertools.cycle(['r', 'g', 'b', 'c', 'm'])
49+
color_iter = itertools.cycle(['navy', 'c', 'cornflowerblue', 'gold',
50+
'darkorange'])
5051

5152
for i, (clf, title) in enumerate([(gmm, 'GMM'),
5253
(dpgmm, 'Dirichlet Process GMM')]):

dev/_downloads/plot_gmm_classifier.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,9 @@
3838
from sklearn.mixture import GMM
3939

4040

41+
colors = ['navy', 'turquoise', 'darkorange']
4142
def make_ellipses(gmm, ax):
42-
for n, color in enumerate('rgb'):
43+
for n, color in enumerate(colors):
4344
v, w = np.linalg.eigh(gmm._get_covars()[n][:2, :2])
4445
u = w[0] / np.linalg.norm(w[0])
4546
angle = np.arctan2(u[1], u[0])
@@ -91,14 +92,15 @@ def make_ellipses(gmm, ax):
9192
h = plt.subplot(2, n_classifiers / 2, index + 1)
9293
make_ellipses(classifier, h)
9394

94-
for n, color in enumerate('rgb'):
95+
for n, color in enumerate(colors):
9596
data = iris.data[iris.target == n]
96-
plt.scatter(data[:, 0], data[:, 1], 0.8, color=color,
97+
plt.scatter(data[:, 0], data[:, 1], s=0.8, color=color,
9798
label=iris.target_names[n])
9899
# Plot the test data with crosses
99-
for n, color in enumerate('rgb'):
100+
for n, color in enumerate(colors):
100101
data = X_test[y_test == n]
101-
plt.plot(data[:, 0], data[:, 1], 'x', color=color)
102+
print(color)
103+
plt.scatter(data[:, 0], data[:, 1], marker='x', color=color)
102104

103105
y_train_pred = classifier.predict(X_train)
104106
train_accuracy = np.mean(y_train_pred.ravel() == y_train.ravel()) * 100

dev/_downloads/plot_gmm_selection.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@
4949
best_gmm = gmm
5050

5151
bic = np.array(bic)
52-
color_iter = itertools.cycle(['k', 'r', 'g', 'b', 'c', 'm', 'y'])
52+
color_iter = itertools.cycle(['navy', 'turquoise', 'cornflowerblue',
53+
'darkorange'])
5354
clf = best_gmm
5455
bars = []
5556

dev/_downloads/plot_gmm_sin.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,8 @@
3737
X[i, 0] = x + np.random.normal(0, 0.1)
3838
X[i, 1] = 3 * (np.sin(x) + np.random.normal(0, .2))
3939

40-
41-
color_iter = itertools.cycle(['r', 'g', 'b', 'c', 'm'])
42-
40+
color_iter = itertools.cycle(['navy', 'turquoise', 'cornflowerblue',
41+
'darkorange'])
4342

4443
for i, (clf, title) in enumerate([
4544
(mixture.GMM(n_components=10, covariance_type='full', n_iter=100),
@@ -63,7 +62,7 @@
6362
# components.
6463
if not np.any(Y_ == i):
6564
continue
66-
plt.scatter(X[Y_ == i, 0], X[Y_ == i, 1], .8, color=color)
65+
plt.scatter(X[Y_ == i, 0], X[Y_ == i, 1], color=color, s=4)
6766

6867
# Plot an ellipse to show the Gaussian component
6968
angle = np.arctan(u[1] / u[0])

dev/_images/plot_gmm.png

378 Bytes
Loading

dev/_images/plot_gmm1.png

378 Bytes
Loading

dev/_images/plot_gmm_001.png

8.05 KB
Loading

dev/_images/plot_gmm_0011.png

8.05 KB
Loading

dev/_images/plot_gmm_classifier.png

-1.18 KB
Loading

dev/_images/plot_gmm_classifier1.png

-1.18 KB
Loading

0 commit comments

Comments
 (0)