Beispiel #1
0
 def test_copy(self):
     np.random.seed(0)
     clf = KMeans()
     scikitplot.clustering_factory(clf)
     ax = clf.plot_silhouette(self.X)
     assert not hasattr(clf, "cluster_centers_")
     ax = clf.plot_silhouette(self.X, copy=False)
     assert hasattr(clf, "cluster_centers_")
Beispiel #2
0
 def test_copy(self):
     np.random.seed(0)
     clf = KMeans()
     scikitplot.clustering_factory(clf)
     ax = clf.plot_silhouette(self.X)
     assert not hasattr(clf, "cluster_centers_")
     ax = clf.plot_silhouette(self.X, copy=False)
     assert hasattr(clf, "cluster_centers_")
Beispiel #3
0
 def test_ax(self):
     np.random.seed(0)
     clf = KMeans()
     scikitplot.clustering_factory(clf)
     fig, ax = plt.subplots(1, 1)
     out_ax = clf.plot_silhouette(self.X)
     assert ax is not out_ax
     out_ax = clf.plot_silhouette(self.X, ax=ax)
     assert ax is out_ax
Beispiel #4
0
 def test_ax(self):
     np.random.seed(0)
     clf = KMeans()
     scikitplot.clustering_factory(clf)
     fig, ax = plt.subplots(1, 1)
     out_ax = clf.plot_silhouette(self.X)
     assert ax is not out_ax
     out_ax = clf.plot_silhouette(self.X, ax=ax)
     assert ax is out_ax
Beispiel #5
0
 def test_cmap(self):
     np.random.seed(0)
     clf = KMeans()
     scikitplot.clustering_factory(clf)
     ax = clf.plot_silhouette(self.X, cmap='Spectral')
     ax = clf.plot_silhouette(self.X, cmap=plt.cm.Spectral)
Beispiel #6
0
 def test_cmap(self):
     np.random.seed(0)
     clf = KMeans()
     scikitplot.clustering_factory(clf)
     ax = clf.plot_silhouette(self.X, cmap='Spectral')
     ax = clf.plot_silhouette(self.X, cmap=plt.cm.Spectral)