I'm trying to run the lines of code below but I keep getting this error: TypeError: '(['Latitude'], ['Longitude'])' is an invalid key
# Make KMeans model from Longitude & Latitude and get clusters
from sklearn.cluster import KMeans
X_train_lat_long = train_df[['Latitude'], ['Longitude']].to_numpy()
kmeans = KMeans(n_clusters=4).fit(X_train_lat_long)
kmeans.labels_
source https://stackoverflow.com/questions/74055373/make-kmeans-model-from-longitude-latitude-and-get-clusters
Comments
Post a Comment