I want to recover my data after K-means clustering on a scaled dataset with MinMaxScaler, here is a sample of my code
copy_df=scaled_df.copy()
kmeans = KMeans(n_clusters=3, random_state=42)
kmeans.fit(features)
copy_df['Cluster'] = kmeans.predict(features)
The scaler was saved;
I tried something like: x = scaler.inverse_transform(x)
My copy_df should have one more column compared to my scaled_df ( the Cluster number )
I guess that's why I'm getting :
ValueError: operands could not be broadcast together with shapes (3,5) (4,) (3,5)
How could I recover my data?
I need to get the real data of my clusters or the mean of each feature.