模糊 C 均值算法可用于 Python 吗?
我在 3 维空间中有一些点,想将它们聚集起来。我知道Python的模块“cluster”,但它只有K-Means。您知道具有 FCM(模糊 C 均值)的模块吗?
(如果你知道其他一些与聚类相关的 python 模块,你可以将它们命名为额外的奖励。但重要的问题是 python 中的 FCM 算法。)
Matlab
它似乎相当在 Matlab 中易于使用 FCM(示例)。 Python 没有这样的功能吗?
NumPy、SciPy 和 Sage
我在 NumPy、SciPy 或 圣人。我已经下载了文档并进行了搜索。没有结果
Python-cluster
看来 cluster 模块将在下一个版本中添加模糊 C-Means(请参阅路线图)。但我现在需要它
I have some dots in a 3 dimensional space and would like to cluster them. I know Pythons module "cluster", but it has only K-Means. Do you know a module which has FCM (Fuzzy C-Means)?
(If you know some other python modules which are related to clustering you could name them as a bonus. But the important question is the one for a FCM-algorithm in python.)
Matlab
It seems to be quite easy to use FCM in Matlab (example). Isn't something like this available for Python?
NumPy, SciPy and Sage
I didn't find FCM in NumPy, SciPy or Sage. I've downloaded the documentation and searched for it. No results
Python-cluster
It seems like the cluster module will add fuzzy C-Means with the next version (see Roadmap). But I need it now
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
PEACH 将提供一些模糊 C-Means 功能:
http://code.google.com/p/peach/
但是没有似乎没有任何可用的文档,因为维基是空的。 将 FCM 与 PEACH 结合使用的示例 可以在其网站上找到。
PEACH will provide some Fuzzy C-Means functionality:
http://code.google.com/p/peach/
However there doesn't seem to be any usable documentation as the wiki is empty. An example for using FCM with PEACH can be found on its website.
查看 scikit-fuzzy 包。它具有非常基本的模糊逻辑功能,包括模糊 C 均值聚类。
Have a look at scikit-fuzzy package. It has the very basic fuzzy logic functionality, including fuzzy c-means clustering.
Python
PyPI 中有一个 fuzzy-c-means 包。查看链接: fuzzy-c-means Python
这是最简单的方法在Python中使用FCM。希望有帮助。
Python
There is a fuzzy-c-means package in the PyPI. Check out the link : fuzzy-c-means Python
This is the simplest way to use FCM in python. Hope it helps.
我从头开始使用 K++ 初始化(使用固定种子和 5 个质心。将其调整到所需的质心数量应该不会太困难):
我知道它不是很 Pythonic,但我希望它可以完整的模糊 C 均值算法的起点。我认为当数据不易分离时(例如,当“t-SNE 可视化”将所有数据显示在一起而不是显示清楚分开的组时),“软聚类”是可行的方法。在这种情况下,强制数据严格属于只有一个聚类可能是危险的)。我会尝试使用 m = 1.1 到 m = 2.0,这样您就可以看到模糊参数如何影响相关矩阵。
I have done it from scratch, using K++ initialization (with fixed seeds and 5 centroids. It should't be too difficult to addapt it to your desired number of centroids):
I know it is not very pythonic, but I hope it can be a starting point for your complete fuzzy C means algorithm. I think that "soft clustering" is the way to go when data is not easily separable (for example, when "t-SNE visualization" show all data together instead of showing groups clearly separated. In this case, forcing data to pertain strictly to only one clustering can be dangerous). I would give a try with m = 1.1, to m = 2.0, so you can see how the fuzzy parameter affects to the pertenence matrix.