Skip to content

Commit eedc188

Browse files
authored
Merge pull request #899 from Kaggle/add-rapids-test
Add tests for cuml & cudf to prevent regression.
2 parents 8f1b140 + 0133624 commit eedc188

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

tests/test_rapids.py

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

0 commit comments

Comments
 (0)