Cheat Sheet-Building Unsupervised Learning Models
Cheat Sheet-Building Unsupervised Learning Models
K-Means K-Means is a centroid-based clustering algorithm that groups data from sklearn.cluster import KMeans
clustering into k clusters. kmeans = KMeans(n_clusters=3)
Pros: Efficient, simple to implement.
Cons: Sensitive to initial cluster centroids.
about:blank 1/3
5/23/25, 7:49 AM about:blank
import plotly.express as px
fig = px.scatter_3d(df, x='x', y='y', z='z')
fig.show()
gdf = gdf.to_crs(epsg=3857)
about:blank 2/3
5/23/25, 7:49 AM about:blank
Author
Jeff Grossman
Abhishek Gagneja
about:blank 3/3