Compare commits

..

No commits in common. "619c6ecd15894d8e50e7b75fea38eb14826ceae9" and "e9d5f7629fdac279b08dd811526fa128fe91e99d" have entirely different histories.

7 changed files with 9 additions and 67 deletions

57
.gitignore vendored
View File

@ -1,57 +0,0 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
# C extensions
*.so
# Distribution / packaging
.Python
env/
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
*.egg-info/
.installed.cfg
*.egg
# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec
# Installer logs
pip-log.txt
pip-delete-this-directory.txt
# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*,cover
# Translations
*.mo
*.pot
# Django stuff:
*.log
# Sphinx documentation
docs/_build/
# PyBuilder
target/

View File

@ -104,7 +104,7 @@ pyFTS/models/seasonal/common.py
pyFTS/models/seasonal/msfts.py pyFTS/models/seasonal/msfts.py
pyFTS/models/seasonal/partitioner.py pyFTS/models/seasonal/partitioner.py
pyFTS/models/seasonal/sfts.py pyFTS/models/seasonal/sfts.py
pyFTS/partitioners/KMeans.py pyFTS/partitioners/CMeans.py
pyFTS/partitioners/Entropy.py pyFTS/partitioners/Entropy.py
pyFTS/partitioners/FCM.py pyFTS/partitioners/FCM.py
pyFTS/partitioners/Grid.py pyFTS/partitioners/Grid.py

View File

@ -38,7 +38,7 @@ Fuzzy Time Series (FTS) are non parametric methods for time series forecasting b
2. **Universe of Discourse Partitioning**: This is the most important step. Here, the range of values of the numerical time series *Y(t)* will be splited in overlapped intervals and for each interval will be created a Fuzzy Set. This step is performed by pyFTS.partition module and its classes (for instance GridPartitioner, EntropyPartitioner, etc). The main parameters are: 2. **Universe of Discourse Partitioning**: This is the most important step. Here, the range of values of the numerical time series *Y(t)* will be splited in overlapped intervals and for each interval will be created a Fuzzy Set. This step is performed by pyFTS.partition module and its classes (for instance GridPartitioner, EntropyPartitioner, etc). The main parameters are:
- the number of intervals - the number of intervals
- which fuzzy membership function (on [pyFTS.common.Membership](https://github.com/PYFTS/pyFTS/blob/master/pyFTS/common/Membership.py)) - which fuzzy membership function (on [pyFTS.common.Membership](https://github.com/PYFTS/pyFTS/blob/master/pyFTS/common/Membership.py))
- partition scheme ([GridPartitioner](https://github.com/PYFTS/pyFTS/blob/master/pyFTS/partitioners/Grid.py), [EntropyPartitioner](https://github.com/PYFTS/pyFTS/blob/master/pyFTS/partitioners/Entropy.py)[3], [FCMPartitioner](https://github.com/PYFTS/pyFTS/blob/master/pyFTS/partitioners/FCM.py), [KMeansPartitioner](https://github.com/PYFTS/pyFTS/blob/master/pyFTS/partitioners/KMeans.py), [HuarngPartitioner](https://github.com/PYFTS/pyFTS/blob/master/pyFTS/partitioners/Huarng.py)[4]) - partition scheme ([GridPartitioner](https://github.com/PYFTS/pyFTS/blob/master/pyFTS/partitioners/Grid.py), [EntropyPartitioner](https://github.com/PYFTS/pyFTS/blob/master/pyFTS/partitioners/Entropy.py)[3], [FCMPartitioner](https://github.com/PYFTS/pyFTS/blob/master/pyFTS/partitioners/FCM.py), [CMeansPartitioner](https://github.com/PYFTS/pyFTS/blob/master/pyFTS/partitioners/CMeans.py), [HuarngPartitioner](https://github.com/PYFTS/pyFTS/blob/master/pyFTS/partitioners/Huarng.py)[4])
Check out the jupyter notebook on [notebooks/Partitioners.ipynb](https://github.com/PYFTS/notebooks/blob/master/Partitioners.ipynb) for sample codes. Check out the jupyter notebook on [notebooks/Partitioners.ipynb](https://github.com/PYFTS/notebooks/blob/master/Partitioners.ipynb) for sample codes.

View File

@ -28,10 +28,10 @@ pyFTS.partitioners.Class module
:undoc-members: :undoc-members:
:show-inheritance: :show-inheritance:
pyFTS.partitioners.KMeans module pyFTS.partitioners.CMeans module
-------------------------------- --------------------------------
.. automodule:: pyFTS.partitioners.KMeans .. automodule:: pyFTS.partitioners.CMeans
:members: :members:
:undoc-members: :undoc-members:
:show-inheritance: :show-inheritance:

View File

@ -14,7 +14,7 @@ def distance(x, y):
return math.sqrt(tmp) return math.sqrt(tmp)
def k_means(k, dados, tam): def c_means(k, dados, tam):
# Инициализирует центроиды, выбирая случайные элементы из множества # Инициализирует центроиды, выбирая случайные элементы из множества
centroides = [dados[rnd.randint(0, len(dados)-1)] for kk in range(0, k)] centroides = [dados[rnd.randint(0, len(dados)-1)] for kk in range(0, k)]
@ -77,16 +77,16 @@ def k_means(k, dados, tam):
return centroides return centroides
class KMeansPartitioner(partitioner.Partitioner): class CMeansPartitioner(partitioner.Partitioner):
def __init__(self, **kwargs): def __init__(self, **kwargs):
super(KMeansPartitioner, self).__init__(name="KMeans", **kwargs) super(CMeansPartitioner, self).__init__(name="CMeans", **kwargs)
def build(self, data): def build(self, data):
sets = {} sets = {}
kwargs = {'type': self.type, 'variable': self.variable} kwargs = {'type': self.type, 'variable': self.variable}
centroides = k_means(self.partitions, data, 1) centroides = c_means(self.partitions, data, 1)
centroides = [v[0] for v in centroides] centroides = [v[0] for v in centroides]
centroides.append(self.max) centroides.append(self.max)
centroides.append(self.min) centroides.append(self.min)

View File

@ -11,7 +11,7 @@ from mpl_toolkits.mplot3d import Axes3D
import datetime import datetime
import pandas as pd import pandas as pd
from pyFTS.partitioners import Grid, KMeans, FCM, Entropy from pyFTS.partitioners import Grid, CMeans, FCM, Entropy
from pyFTS.common import FLR, FuzzySet, Membership, Transformations, Util, fts from pyFTS.common import FLR, FuzzySet, Membership, Transformations, Util, fts
from pyFTS import sfts from pyFTS import sfts
from pyFTS.models import msfts from pyFTS.models import msfts

View File

@ -26,7 +26,6 @@ setuptools.setup(
'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.8', 'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.10', 'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Intended Audience :: Science/Research', 'Intended Audience :: Science/Research',
'Intended Audience :: Developers', 'Intended Audience :: Developers',
'Intended Audience :: Education', 'Intended Audience :: Education',