reconstrue / single_cell

Single cell analysis tools built to run on Jupyter, especially Colab
http://reconstrue.com
Apache License 2.0
1 stars 0 forks source link

Rapids: DBSCAN #29

Open JohnTigue opened 4 years ago

JohnTigue commented 4 years ago

dbscan_demo.ipynb is from rapidsai/notebooks repo.

https://github.com/rapidsai/cuml

As an example, the following Python snippet loads input and computes DBSCAN clusters, all on GPU.

import cudf
from cuml.cluster import DBSCAN

# Create and populate a GPU DataFrame
gdf_float = cudf.DataFrame()
gdf_float['0'] = [1.0, 2.0, 5.0]
gdf_float['1'] = [4.0, 2.0, 1.0]
gdf_float['2'] = [4.0, 2.0, 1.0]

# Setup and fit clusters
dbscan_float = DBSCAN(eps=1.0, min_samples=1)
dbscan_float.fit(gdf_float)

print(dbscan_float.labels_)