diff --git a/algorithms/__init__.py b/fuzzy_clust_algos/__init__.py similarity index 100% rename from algorithms/__init__.py rename to fuzzy_clust_algos/__init__.py diff --git a/algorithms/fcm.py b/fuzzy_clust_algos/fcm.py similarity index 100% rename from algorithms/fcm.py rename to fuzzy_clust_algos/fcm.py diff --git a/algorithms/gk.py b/fuzzy_clust_algos/gk.py similarity index 96% rename from algorithms/gk.py rename to fuzzy_clust_algos/gk.py index 0b5a518..cd8f221 100644 --- a/algorithms/gk.py +++ b/fuzzy_clust_algos/gk.py @@ -71,6 +71,10 @@ def next_u(self, d): return denominator_ def predict(self, z): + u = self.predict_proba(z) + return np.argmax(u, axis=0) + + def predict_proba(self, z): if len(z.shape) == 1: z = np.expand_dims(z, axis=0) @@ -78,5 +82,4 @@ def predict(self, z): if len(dist.shape) == 1: dist = np.expand_dims(dist, axis=0) - u = self.next_u(dist) - return np.argmax(u, axis=0) + return self.next_u(dist) diff --git a/setup.py b/setup.py new file mode 100755 index 0000000..570007c --- /dev/null +++ b/setup.py @@ -0,0 +1,14 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +from setuptools import setup, find_packages + + +setup(name='fuzzy_clust_algos', + version="1.0", + description='Fuzzy Clustering Algorithms.', + packages=find_packages(), + install_requires=[ + 'numpy', + 'scipy', + ], + ) diff --git a/ui.py b/ui.py index 7d9d22f..4e009b0 100755 --- a/ui.py +++ b/ui.py @@ -8,9 +8,9 @@ from PyQt5.QtCore import Qt from PyQt5.QtWidgets import QFileSystemModel -from algorithms.fcm import FCM -from algorithms.gk import GK from file_path_manager import FilePathManager +from fuzzy_clust_algos.fcm import FCM +from fuzzy_clust_algos.gk import GK FormClass = uic.loadUiType("ui.ui")[0]