(X, Y, n_components, index, title)
| 83 | |
| 84 | |
| 85 | def plot_samples(X, Y, n_components, index, title): |
| 86 | plt.subplot(5, 1, 4 + index) |
| 87 | for i, color in zip(range(n_components), color_iter): |
| 88 | # as the DP will not use every component it has access to |
| 89 | # unless it needs it, we shouldn't plot the redundant |
| 90 | # components. |
| 91 | if not np.any(Y == i): |
| 92 | continue |
| 93 | plt.scatter(X[Y == i, 0], X[Y == i, 1], 0.8, color=color) |
| 94 | |
| 95 | plt.xlim(-6.0, 4.0 * np.pi - 6.0) |
| 96 | plt.ylim(-5.0, 5.0) |
| 97 | plt.title(title) |
| 98 | plt.xticks(()) |
| 99 | plt.yticks(()) |
| 100 | |
| 101 | |
| 102 | # Parameters |
no outgoing calls
no test coverage detected
searching dependent graphs…