+ 4

Pandas Pandas Pandas project help

In DS with python last project, what do we do and how to do it? I have 2 clusters but I’m not understanding the further problem that needs to be solved? Here’s my try: help please n = int(input()) X = [] for i in range(n): X.append([float(x) for x in input().split()]) from sklearn.preprocessing import StandardScaler from sklearn.cluster import KMeans import numpy as np scale = StandardScaler() scale.fit(X) X_scaled = scale.transform(X) kmeans = KMeans(n_clusters=2) kmeans.fit(X_scaled)

20th Dec 2020, 11:03 AM
BatOchir Artur
BatOchir Artur - avatar
7 ответов
+ 7
Hi, I solved it, see my profile 😆😆😆 If you like it, please give it a like!!! https://www.sololearn.com/Profile/14725897 https://code.sololearn.com/cA18A6a7a205/#
25th Dec 2020, 11:52 PM
Edward Finkelstein
Edward Finkelstein - avatar
+ 1
It's quite easy to misunderstand that task. The explanations to the task are a little bit confusing.
7th Jan 2021, 5:00 PM
Jan
Jan - avatar
+ 1
Hi! I’ll offer another decision for you with implemented DS tools (kmeans and numpy) https://code.sololearn.com/cN83G8vbPnKY/?ref=app
5th Feb 2021, 2:36 PM
Aleksandr Bundyuk
Aleksandr Bundyuk - avatar
+ 1
No, it actually works on the mobile too. It just crashed on the mobile because I typed the sample input wrong, so I decided to use a PC instead. My fingers and the touch buttons on a mobile are not the best friends.😂
5th Feb 2021, 5:13 PM
Jan
Jan - avatar
0
Alexandr Bundyuk - -> I tested your code with the "Sample Input" from the explanation of the task, and it actually came out with the same "Sample Output" from the task in the first run, and it was also the same in the second run. I tested it on a PC and not on the mobile.
5th Feb 2021, 4:52 PM
Jan
Jan - avatar
0
So perhaps it is mobile issue
5th Feb 2021, 4:59 PM
Aleksandr Bundyuk
Aleksandr Bundyuk - avatar
0
Hirani Pranav you should not use kmeans from sklearn. Just calculate distances and new centroids.
15th Apr 2021, 11:07 AM
Михаил Иванов
Михаил Иванов - avatar