|
3 | 3 | Multi-dimensional scaling |
4 | 4 | ========================= |
5 | 5 |
|
| 6 | +An illustration of the metric and non-metric MDS on generated noisy data. |
| 7 | +
|
| 8 | +The reconstructed points using the metric MDS and non metric MDS are slightly |
| 9 | +shifted to avoid overlapping.. |
6 | 10 | """ |
7 | 11 |
|
8 | 12 | # Author: Nelle Varoquaux <[email protected]> |
|
52 | 56 | fig = plt.figure(1) |
53 | 57 | ax = plt.axes([0., 0., 1., 1.]) |
54 | 58 |
|
55 | | -plt.scatter(X_true[:, 0], X_true[:, 1], c='r', s=10) |
56 | | -plt.scatter(pos[:, 0] + 0.2, pos[:, 1] + 0.2, s=10, c='g') |
57 | | -plt.scatter(npos[:, 0] - 0.2, npos[:, 1] - 0.2, s=10, c='b') |
| 59 | +plt.scatter(X_true[:, 0], X_true[:, 1], c='r', s=20) |
| 60 | +plt.scatter(pos[:, 0] + 0.2, pos[:, 1] + 0.2, s=20, c='g') |
| 61 | +plt.scatter(npos[:, 0] - 0.2, npos[:, 1] - 0.2, s=20, c='b') |
58 | 62 | plt.legend(('True position', 'MDS', 'NMDS')) |
59 | 63 |
|
60 | 64 | similarities = similarities.max() / similarities * 100 |
|
0 commit comments