<h1>pyFTS Quick Start<aclass="headerlink"href="#pyfts-quick-start"title="Permalink to this headline">¶</a></h1>
<divclass="section"id="how-to-install-pyfts">
<h2>How to install pyFTS?<aclass="headerlink"href="#how-to-install-pyfts"title="Permalink to this headline">¶</a></h2>
<imgalt="https://img.shields.io/badge/Made%20with-Python-1f425f.svg"src="https://img.shields.io/badge/Made%20with-Python-1f425f.svg"/><p>Before of all, pyFTS was developed and tested with Python 3.6. To install pyFTS using pip tool</p>
<h2>What are Fuzzy Time Series (FTS)?<aclass="headerlink"href="#what-are-fuzzy-time-series-fts"title="Permalink to this headline">¶</a></h2>
<p>Fuzzy Time Series (FTS) are non parametric methods for time series forecasting based on Fuzzy Theory. The original method was proposed by [1] and improved later by many researchers. The general approach of the FTS methods, based on [2] is listed below:</p>
<li><p><strong>Data preprocessing</strong>: Data transformation functions contained at <aclass="reference external"href="https://github.com/PYFTS/pyFTS/blob/master/pyFTS/common/Transformations.py">pyFTS.common.Transformations</a>, like differentiation, Box-Cox, scaling and normalization.</p></li>
<li><p><strong>Universe of Discourse Partitioning</strong>: This is the most important step. Here, the range of values of the numerical time series <em>Y(t)</em> 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:</p></li>
<li><p>which fuzzy membership function (on <aclass="reference external"href="https://github.com/PYFTS/pyFTS/blob/master/pyFTS/common/Membership.py">pyFTS.common.Membership</a>)</p></li>
<p>Check out the jupyter notebook on <aclass="reference external"href="https://github.com/PYFTS/notebooks/blob/master/Partitioners.ipynb">notebooks/Partitioners.ipynb</a> for sample codes.</p>
<li><p><strong>Data Fuzzyfication</strong>: Each data point of the numerical time series <em>Y(t)</em> will be translated to a fuzzy representation (usually one or more fuzzy sets), and then a fuzzy time series <em>F(t)</em> is created.</p></li>
<p>4. <strong>Generation of Fuzzy Rules</strong>: In this step the temporal transition rules are created. These rules depends on the method and their characteristics:
- <em>order</em>: the number of time lags used on forecasting
- <em>weights</em>: the weighted models introduce weights on fuzzy rules for smoothing
- <em>seasonality</em>: seasonality models
- <em>steps ahead</em>: the number of steps ahed to predict. Almost all standard methods are based on one-step-ahead forecasting
- <em>forecasting type</em>: Almost all standard methods are point-based, but pyFTS also provides intervalar and probabilistic forecasting methods.</p>
<li><p><strong>Forecasting</strong>: The forecasting step takes a sample (with minimum length equal to the model’s order) and generate a fuzzy outputs (fuzzy set(s)) for the next time ahead.</p></li>
<li><p><strong>Defuzzyfication</strong>: This step transform the fuzzy forecast into a real number.</p></li>
<li><p><strong>Data postprocessing</strong>: The inverse operations of step 1.</p></li>
<p>There is nothing better than good code examples to start. <aclass="reference external"href="https://github.com/PYFTS/notebooks">Then check out the demo Jupyter Notebooks of the implemented method os pyFTS!</a>.</p>
<p>A Google Colab example can also be found <aclass="reference external"href="https://drive.google.com/file/d/1zRBCHXOawwgmzjEoKBgmvBqkIrKxuaz9/view?usp=sharing">here</a>.</p>
<h2>A short tutorial on Fuzzy Time Series<aclass="headerlink"href="#a-short-tutorial-on-fuzzy-time-series"title="Permalink to this headline">¶</a></h2>
<p>Part I: <aclass="reference external"href="https://towardsdatascience.com/a-short-tutorial-on-fuzzy-time-series-dcc6d4eb1b15">Introduction to the Fuzzy Logic, Fuzzy Time Series and the pyFTS library</a>.</p>
<p>Part II: <aclass="reference external"href="https://towardsdatascience.com/a-short-tutorial-on-fuzzy-time-series-part-ii-with-an-case-study-on-solar-energy-bda362ecca6d">High order, weighted and multivariate methods and a case study of solar energy forecasting.</a>.</p>
<p>Part III: <aclass="reference external"href="https://towardsdatascience.com/a-short-tutorial-on-fuzzy-time-series-part-iii-69445dff83fb">Interval and probabilistic forecasting, non-stationary time series, concept drifts and time variant models.</a>.</p>