Skip to content

Commit 0219b1a

Browse files
committed
Add tests for cuml & cudf to prevent regresssion.
http://b/144522678
1 parent 8f1b140 commit 0219b1a

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

tests/test_rapids.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import unittest
2+
3+
import cudf
4+
from cuml.cluster import DBSCAN
5+
6+
from common import gpu_test
7+
8+
9+
class TestRapids(unittest.TestCase):
10+
def test_dbscan(self):
11+
# Create and populate a GPU DataFrame
12+
gdf_float = cudf.DataFrame()
13+
gdf_float['0'] = [1.0, 2.0, 5.0]
14+
gdf_float['1'] = [4.0, 2.0, 1.0]
15+
gdf_float['2'] = [4.0, 2.0, 1.0]
16+
17+
# Setup and fit clusters
18+
dbscan_float = DBSCAN(eps=1.0, min_samples=1)
19+
dbscan_float.fit(gdf_float)
20+
21+
self.assertEqual(3, dbscan_float.labels_.size)

0 commit comments

Comments
 (0)