()
| 106 | |
| 107 | |
| 108 | def main(): |
| 109 | X = get_simple_data() |
| 110 | |
| 111 | # what does it look like without clustering? |
| 112 | plt.scatter(X[:,0], X[:,1]) |
| 113 | plt.show() |
| 114 | |
| 115 | K = 3 # luckily, we already know this |
| 116 | plot_k_means(X, K, beta=1.0, show_plots=True) |
| 117 | |
| 118 | K = 3 # luckily, we already know this |
| 119 | plot_k_means(X, K, beta=3.0, show_plots=True) |
| 120 | |
| 121 | K = 3 # luckily, we already know this |
| 122 | plot_k_means(X, K, beta=10.0, show_plots=True) |
| 123 | |
| 124 | K = 5 # what happens if we choose a "bad" K? |
| 125 | plot_k_means(X, K, max_iter=30, show_plots=True) |
| 126 | |
| 127 | K = 5 # what happens if we change beta? |
| 128 | plot_k_means(X, K, max_iter=30, beta=0.3, show_plots=True) |
| 129 | |
| 130 | |
| 131 | if __name__ == '__main__': |
no test coverage detected