Skip to content

Commit 6903caf

Browse files
committed
Pushing the docs for revision for branch: master, commit 8f199fe4f59e4a7d76e8e764cdc231071b84f974
1 parent 2edbd26 commit 6903caf

File tree

806 files changed

+2797
-2797
lines changed

Some content is hidden

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

806 files changed

+2797
-2797
lines changed

dev/_downloads/plot_gmm_covariances.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -47,14 +47,14 @@
4747
def make_ellipses(gmm, ax):
4848
for n, color in enumerate(colors):
4949
if gmm.covariance_type == 'full':
50-
covars = gmm.covariances_[n][:2, :2]
50+
covariances = gmm.covariances_[n][:2, :2]
5151
elif gmm.covariance_type == 'tied':
52-
covars = gmm.covariances_[:2, :2]
52+
covariances = gmm.covariances_[:2, :2]
5353
elif gmm.covariance_type == 'diag':
54-
covars = np.diag(gmm.covariances_[n][:2])
54+
covariances = np.diag(gmm.covariances_[n][:2])
5555
elif gmm.covariance_type == 'spherical':
56-
covars = np.eye(gmm.means_.shape[1]) * gmm.covariances_[n]
57-
v, w = np.linalg.eigh(covars)
56+
covariances = np.eye(gmm.means_.shape[1]) * gmm.covariances_[n]
57+
v, w = np.linalg.eigh(covariances)
5858
u = w[0] / np.linalg.norm(w[0])
5959
angle = np.arctan2(u[1], u[0])
6060
angle = 180 * angle / np.pi # convert to degrees
@@ -82,9 +82,9 @@ def make_ellipses(gmm, ax):
8282
n_classes = len(np.unique(y_train))
8383

8484
# Try GMMs using different types of covariances.
85-
estimators = dict((covar_type, GaussianMixture(n_components=n_classes,
86-
covariance_type=covar_type, max_iter=20))
87-
for covar_type in ['spherical', 'diag', 'tied', 'full'])
85+
estimators = dict((cov_type, GaussianMixture(n_components=n_classes,
86+
covariance_type=cov_type, max_iter=20, random_state=0))
87+
for cov_type in ['spherical', 'diag', 'tied', 'full'])
8888

8989
n_estimators = len(estimators)
9090

dev/_downloads/plot_gmm_selection.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,9 @@
7575
# Plot the winner
7676
splot = plt.subplot(2, 1, 2)
7777
Y_ = clf.predict(X)
78-
for i, (mean, covar, color) in enumerate(zip(clf.means_, clf.covariances_,
79-
color_iter)):
80-
v, w = linalg.eigh(covar)
78+
for i, (mean, cov, color) in enumerate(zip(clf.means_, clf.covariances_,
79+
color_iter)):
80+
v, w = linalg.eigh(cov)
8181
if not np.any(Y_ == i):
8282
continue
8383
plt.scatter(X[Y_ == i, 0], X[Y_ == i, 1], .8, color=color)
-35 Bytes
-35 Bytes
108 Bytes
108 Bytes
62 Bytes
-203 Bytes
-203 Bytes

0 commit comments

Comments
 (0)