Skip to content

Commit 03a1178

Browse files
committed
Add smoke test for sklearnex
sklearnex was added in #1135 http://227237481
1 parent 66a12ac commit 03a1178

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

tests/test_sklearnex.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import unittest
2+
3+
import numpy as np
4+
5+
from sklearn.cluster import DBSCAN
6+
7+
class TestSklearnex(unittest.TestCase):
8+
def test_dbscan(self):
9+
from sklearnex import patch_sklearn
10+
patch_sklearn()
11+
X = np.array([[1., 2.], [2., 2.], [2., 3.],
12+
[8., 7.], [8., 8.], [25., 80.]], dtype=np.float32)
13+
14+
clustering = DBSCAN(eps=3, min_samples=2).fit(X)
15+
np.testing.assert_array_equal(np.array([0, 0, 0, 1, 1, -1]), clustering.labels_)

0 commit comments

Comments
 (0)