Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我使用 K-Means 聚类算法将我的数据分为 4 个部分。我将其可视化,但现在我需要每个集群作为数据框。有什么办法吗?
如果您使用SKlearn进行聚类,则可以使用它对每个聚类predict的每个数据点进行分类并将其保存到字典中(例如)。
predict
然后您可以使用Pandas的from_records方法将字典转换为 DataFrame。
from_records