From 57dd9e33b75938deac5524b8233b28e7b55ef1fb Mon Sep 17 00:00:00 2001 From: Ben Glocker Date: Fri, 28 Feb 2020 20:19:50 +0000 Subject: [PATCH] replaced deprecated matplotlib.mlab.normpdf with scipy.stats.norm.pdf --- 05-Clustering-and-PCA.ipynb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/05-Clustering-and-PCA.ipynb b/05-Clustering-and-PCA.ipynb index 700e589..e0aa311 100644 --- a/05-Clustering-and-PCA.ipynb +++ b/05-Clustering-and-PCA.ipynb @@ -362,14 +362,14 @@ "metadata": {}, "outputs": [], "source": [ - "import matplotlib.mlab as mlab\n", + "from scipy.stats import norm\n", "\n", "def plot_gmm(x, gmm):\n", " omega = gmm.weights_\n", " mu = gmm.means_\n", " sigma = np.sqrt(gmm.covariances_)\n", " for ind in range(0,omega.shape[0]): \n", - " plt.plot(x,omega[ind]*mlab.normpdf(x, mu[ind], sigma[ind]), linewidth=2, label='GMM Component '+str(ind))\n", + " plt.plot(x,omega[ind]*norm.pdf(x, mu[ind], sigma[ind]), linewidth=2, label='GMM Component '+str(ind))\n", "\n", "plt.figure(figsize=(10, 4), dpi=100)\n", "plt.hist(X, bins=num_bins, density=True, range=(lim_low, lim_high), label='Intensity histogram', color='lightgray');\n", -- GitLab