def test_fit_vs_sk_iris(self): X = load_iris().data model = KMeans(n_gpus=1, n_clusters=4, random_state=1234).fit(X) h2o_labels = model.predict(X) sk_lables = model.sklearn_predict(X) assert all(h2o_labels == sk_lables)
def test_transform_iris(self): X = load_iris().data model = KMeans(n_gpus=1, n_clusters=4, random_state=1234567).fit(X) labels_from_trans = list( map(lambda x: np.argmin(x), model.transform(X))) assert all(labels_from_trans == model.predict(X))
def test_transform_iris(self): X = load_iris().data model = KMeans(n_gpus=1, n_clusters=4, random_state=1234567).fit(X) labels_from_trans = list( map(lambda x: np.argmin(x), model.transform(X)) ) assert all(labels_from_trans == model.predict(X))
def test_predict_iris(self): X = load_iris().data model = KMeans(n_gpus=1, n_clusters=4, random_state=123456).fit(X) assert all(model.labels_ == model.predict(X))
def test_predict_iris(self, order): X = np.asanyarray(load_iris().data, order=order) model = KMeans(n_gpus=1, n_clusters=4, random_state=123456).fit(X) assert all(model.labels_ == model.predict(X))