Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@dantegd
Created April 28, 2020 15:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dantegd/e15afdaceb78a44ec1e9cf7735b63027 to your computer and use it in GitHub Desktop.
Save dantegd/e15afdaceb78a44ec1e9cf7735b63027 to your computer and use it in GitHub Desktop.
Default input format type mirroring behavior of cuML
import cuml
import cudf
df = cudf.DataFrame()
df[1] = [1.0, 2.0, 5.0]
df[2] = [4.0, 2.0. 1.0]
df[3] = [4.0, 2.0. 1.0]
kmeans = cuml.KMeans(n_clusters=2)
kmeans.fit(df)
print(type(kmeans.labels_))
# <class 'cudf.core.series.Series'>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment