Created
March 6, 2024 17:54
-
-
Save quantra-go-algo/2d3d8732cd8194907bec022a6fac9f63 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Import the libraries | |
from cuml.cluster import KMeans | |
import cudf | |
# Generate sample data | |
data = cudf.DataFrame() | |
data['feature1'] = cp.random.rand(1000) | |
data['feature2'] = cp.random.rand(1000) | |
# Perform KMeans clustering | |
kmeans = KMeans(n_clusters=3) | |
kmeans.fit(data) | |
labels = kmeans.predict(data) | |
print(labels) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment