Documentation update

This commit is contained in:
Petrônio Cândido 2018-11-13 12:11:49 -02:00
parent 5b2b5ece55
commit dc7dccb5e3
48 changed files with 1768 additions and 202 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -111,6 +111,8 @@
<li><a href="pyFTS/data/mackey_glass.html">pyFTS.data.mackey_glass</a></li>
<li><a href="pyFTS/data/rossler.html">pyFTS.data.rossler</a></li>
<li><a href="pyFTS/data/sunspots.html">pyFTS.data.sunspots</a></li>
<li><a href="pyFTS/hyperparam/GridSearch.html">pyFTS.hyperparam.GridSearch</a></li>
<li><a href="pyFTS/hyperparam/Util.html">pyFTS.hyperparam.Util</a></li>
<li><a href="pyFTS/models/chen.html">pyFTS.models.chen</a></li>
<li><a href="pyFTS/models/cheng.html">pyFTS.models.cheng</a></li>
<li><a href="pyFTS/models/ensemble/ensemble.html">pyFTS.models.ensemble.ensemble</a></li>
@ -121,10 +123,12 @@
<li><a href="pyFTS/models/incremental/Retrainer.html">pyFTS.models.incremental.Retrainer</a></li>
<li><a href="pyFTS/models/ismailefendi.html">pyFTS.models.ismailefendi</a></li>
<li><a href="pyFTS/models/multivariate/FLR.html">pyFTS.models.multivariate.FLR</a></li>
<li><a href="pyFTS/models/multivariate/cmvfts.html">pyFTS.models.multivariate.cmvfts</a></li>
<li><a href="pyFTS/models/multivariate/common.html">pyFTS.models.multivariate.common</a></li>
<li><a href="pyFTS/models/multivariate/flrg.html">pyFTS.models.multivariate.flrg</a></li>
<li><a href="pyFTS/models/multivariate/mvfts.html">pyFTS.models.multivariate.mvfts</a></li>
<li><a href="pyFTS/models/multivariate/variable.html">pyFTS.models.multivariate.variable</a></li>
<li><a href="pyFTS/models/multivariate/wmvfts.html">pyFTS.models.multivariate.wmvfts</a></li>
<li><a href="pyFTS/models/nonstationary/common.html">pyFTS.models.nonstationary.common</a></li>
<li><a href="pyFTS/models/nonstationary/cvfts.html">pyFTS.models.nonstationary.cvfts</a></li>
<li><a href="pyFTS/models/nonstationary/flrg.html">pyFTS.models.nonstationary.flrg</a></li>

View File

@ -419,7 +419,10 @@
<span class="k">if</span> <span class="ow">not</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">forecasts</span><span class="p">,</span> <span class="p">(</span><span class="nb">list</span><span class="p">,</span> <span class="n">np</span><span class="o">.</span><span class="n">ndarray</span><span class="p">)):</span>
<span class="n">forecasts</span> <span class="o">=</span> <span class="p">[</span><span class="n">forecasts</span><span class="p">]</span>
<span class="n">forecasts</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">array</span><span class="p">(</span><span class="n">forecasts</span><span class="p">[:</span><span class="o">-</span><span class="mi">1</span><span class="p">])</span>
<span class="k">if</span> <span class="nb">len</span><span class="p">(</span><span class="n">forecasts</span><span class="p">)</span> <span class="o">!=</span> <span class="nb">len</span><span class="p">(</span><span class="n">ndata</span><span class="p">)</span> <span class="o">-</span> <span class="n">model</span><span class="o">.</span><span class="n">max_lag</span><span class="p">:</span>
<span class="n">forecasts</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">array</span><span class="p">(</span><span class="n">forecasts</span><span class="p">[:</span><span class="o">-</span><span class="mi">1</span><span class="p">])</span>
<span class="k">else</span><span class="p">:</span>
<span class="n">forecasts</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">array</span><span class="p">(</span><span class="n">forecasts</span><span class="p">)</span>
<span class="n">ret</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">np</span><span class="o">.</span><span class="n">round</span><span class="p">(</span><span class="n">rmse</span><span class="p">(</span><span class="n">ndata</span><span class="p">[</span><span class="n">model</span><span class="o">.</span><span class="n">max_lag</span><span class="p">:],</span> <span class="n">forecasts</span><span class="p">),</span> <span class="mi">2</span><span class="p">))</span>
<span class="n">ret</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">np</span><span class="o">.</span><span class="n">round</span><span class="p">(</span><span class="n">mape</span><span class="p">(</span><span class="n">ndata</span><span class="p">[</span><span class="n">model</span><span class="o">.</span><span class="n">max_lag</span><span class="p">:],</span> <span class="n">forecasts</span><span class="p">),</span> <span class="mi">2</span><span class="p">))</span>

View File

@ -93,6 +93,7 @@
<span class="kn">from</span> <span class="nn">pyFTS.probabilistic</span> <span class="k">import</span> <span class="n">ProbabilityDistribution</span>
<span class="kn">from</span> <span class="nn">pyFTS.common</span> <span class="k">import</span> <span class="n">Transformations</span>
<span class="kn">from</span> <span class="nn">pyFTS.models</span> <span class="k">import</span> <span class="n">song</span><span class="p">,</span> <span class="n">chen</span><span class="p">,</span> <span class="n">yu</span><span class="p">,</span> <span class="n">ismailefendi</span><span class="p">,</span> <span class="n">sadaei</span><span class="p">,</span> <span class="n">hofts</span><span class="p">,</span> <span class="n">pwfts</span><span class="p">,</span> <span class="n">ifts</span><span class="p">,</span> <span class="n">cheng</span><span class="p">,</span> <span class="n">hwang</span>
<span class="kn">from</span> <span class="nn">pyFTS.models.multivariate</span> <span class="k">import</span> <span class="n">mvfts</span><span class="p">,</span> <span class="n">wmvfts</span><span class="p">,</span> <span class="n">cmvfts</span>
<span class="kn">from</span> <span class="nn">pyFTS.models.ensemble</span> <span class="k">import</span> <span class="n">ensemble</span>
<span class="kn">from</span> <span class="nn">pyFTS.benchmarks</span> <span class="k">import</span> <span class="n">Measures</span><span class="p">,</span> <span class="n">naive</span><span class="p">,</span> <span class="n">arima</span><span class="p">,</span> <span class="n">ResidualAnalysis</span><span class="p">,</span> <span class="n">quantreg</span><span class="p">,</span> <span class="n">knn</span>
<span class="kn">from</span> <span class="nn">pyFTS.benchmarks</span> <span class="k">import</span> <span class="n">Util</span> <span class="k">as</span> <span class="n">bUtil</span>
@ -131,10 +132,16 @@
<div class="viewcode-block" id="get_point_methods"><a class="viewcode-back" href="../../../pyFTS.benchmarks.html#pyFTS.benchmarks.benchmarks.get_point_methods">[docs]</a><span class="k">def</span> <span class="nf">get_point_methods</span><span class="p">():</span>
<span class="sd">&quot;&quot;&quot;Return all FTS methods for point forecasting&quot;&quot;&quot;</span>
<span class="k">return</span> <span class="p">[</span><span class="n">song</span><span class="o">.</span><span class="n">ConventionalFTS</span><span class="p">,</span> <span class="n">chen</span><span class="o">.</span><span class="n">ConventionalFTS</span><span class="p">,</span> <span class="n">yu</span><span class="o">.</span><span class="n">WeightedFTS</span><span class="p">,</span> <span class="n">ismailefendi</span><span class="o">.</span><span class="n">ImprovedWeightedFTS</span><span class="p">,</span>
<span class="n">cheng</span><span class="o">.</span><span class="n">TrendWeightedFTS</span><span class="p">,</span> <span class="n">sadaei</span><span class="o">.</span><span class="n">ExponentialyWeightedFTS</span><span class="p">,</span> <span class="n">hofts</span><span class="o">.</span><span class="n">HighOrderFTS</span><span class="p">,</span> <span class="n">hwang</span><span class="o">.</span><span class="n">HighOrderFTS</span><span class="p">,</span>
<span class="n">cheng</span><span class="o">.</span><span class="n">TrendWeightedFTS</span><span class="p">,</span> <span class="n">sadaei</span><span class="o">.</span><span class="n">ExponentialyWeightedFTS</span><span class="p">,</span>
<span class="n">hofts</span><span class="o">.</span><span class="n">HighOrderFTS</span><span class="p">,</span> <span class="n">hofts</span><span class="o">.</span><span class="n">WeightedHighOrderFTS</span><span class="p">,</span> <span class="n">hwang</span><span class="o">.</span><span class="n">HighOrderFTS</span><span class="p">,</span>
<span class="n">pwfts</span><span class="o">.</span><span class="n">ProbabilisticWeightedFTS</span><span class="p">]</span></div>
<div class="viewcode-block" id="get_point_multivariate_methods"><a class="viewcode-back" href="../../../pyFTS.benchmarks.html#pyFTS.benchmarks.benchmarks.get_point_multivariate_methods">[docs]</a><span class="k">def</span> <span class="nf">get_point_multivariate_methods</span><span class="p">():</span>
<span class="sd">&quot;&quot;&quot;Return all multivariate FTS methods por point forecasting&quot;&quot;&quot;</span>
<span class="k">return</span> <span class="p">[</span><span class="n">mvfts</span><span class="o">.</span><span class="n">MVFTS</span><span class="p">,</span> <span class="n">wmvfts</span><span class="o">.</span><span class="n">WeightedMVFTS</span><span class="p">,</span> <span class="n">cmvfts</span><span class="o">.</span><span class="n">ClusteredMVFTS</span><span class="p">]</span></div>
<div class="viewcode-block" id="get_benchmark_interval_methods"><a class="viewcode-back" href="../../../pyFTS.benchmarks.html#pyFTS.benchmarks.benchmarks.get_benchmark_interval_methods">[docs]</a><span class="k">def</span> <span class="nf">get_benchmark_interval_methods</span><span class="p">():</span>
<span class="sd">&quot;&quot;&quot;Return all non FTS methods for point_to_interval forecasting&quot;&quot;&quot;</span>
<span class="k">return</span> <span class="p">[</span> <span class="n">arima</span><span class="o">.</span><span class="n">ARIMA</span><span class="p">,</span> <span class="n">quantreg</span><span class="o">.</span><span class="n">QuantileRegression</span><span class="p">]</span></div>

View File

@ -85,12 +85,14 @@
<span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Composite Fuzzy Set</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">name</span><span class="p">,</span> <span class="n">superset</span><span class="o">=</span><span class="kc">False</span><span class="p">):</span>
<span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">name</span><span class="p">,</span> <span class="n">superset</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Create an empty composite fuzzy set</span>
<span class="sd"> :param name: fuzzy set name</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="nb">super</span><span class="p">(</span><span class="n">FuzzySet</span><span class="p">,</span> <span class="bp">self</span><span class="p">)</span><span class="o">.</span><span class="fm">__init__</span><span class="p">(</span><span class="n">name</span><span class="p">,</span> <span class="kc">None</span><span class="p">,</span> <span class="kc">None</span><span class="p">,</span> <span class="kc">None</span><span class="p">,</span> <span class="nb">type</span><span class="o">=</span><span class="s1">&#39;composite&#39;</span><span class="p">)</span>
<span class="k">if</span> <span class="s1">&#39;type&#39;</span> <span class="ow">in</span> <span class="n">kwargs</span><span class="p">:</span>
<span class="n">kwargs</span><span class="o">.</span><span class="n">pop</span><span class="p">(</span><span class="s1">&#39;type&#39;</span><span class="p">)</span>
<span class="nb">super</span><span class="p">(</span><span class="n">FuzzySet</span><span class="p">,</span> <span class="bp">self</span><span class="p">)</span><span class="o">.</span><span class="fm">__init__</span><span class="p">(</span><span class="n">name</span><span class="p">,</span> <span class="kc">None</span><span class="p">,</span> <span class="kc">None</span><span class="p">,</span> <span class="kc">None</span><span class="p">,</span> <span class="nb">type</span><span class="o">=</span><span class="s1">&#39;composite&#39;</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">)</span>
<span class="bp">self</span><span class="o">.</span><span class="n">superset</span> <span class="o">=</span> <span class="n">superset</span>
<span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">superset</span><span class="p">:</span>
<span class="bp">self</span><span class="o">.</span><span class="n">sets</span> <span class="o">=</span> <span class="p">[]</span>

View File

@ -274,10 +274,13 @@
<span class="k">if</span> <span class="n">ordered_sets</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span>
<span class="n">ordered_sets</span> <span class="o">=</span> <span class="n">set_ordered</span><span class="p">(</span><span class="n">fuzzy_sets</span><span class="p">)</span>
<span class="n">fs</span> <span class="o">=</span> <span class="p">[</span><span class="n">ordered_sets</span><span class="p">[</span><span class="n">ix</span><span class="p">]</span>
<span class="k">for</span> <span class="n">ix</span> <span class="ow">in</span> <span class="n">__binary_search</span><span class="p">(</span><span class="n">inst</span><span class="p">,</span> <span class="n">fuzzy_sets</span><span class="p">,</span> <span class="n">ordered_sets</span><span class="p">)</span>
<span class="k">if</span> <span class="n">fuzzy_sets</span><span class="p">[</span><span class="n">ordered_sets</span><span class="p">[</span><span class="n">ix</span><span class="p">]]</span><span class="o">.</span><span class="n">membership</span><span class="p">(</span><span class="n">inst</span><span class="p">)</span> <span class="o">&gt;</span> <span class="n">alpha_cut</span><span class="p">]</span>
<span class="k">return</span> <span class="n">fs</span></div>
<span class="k">try</span><span class="p">:</span>
<span class="n">fs</span> <span class="o">=</span> <span class="p">[</span><span class="n">ordered_sets</span><span class="p">[</span><span class="n">ix</span><span class="p">]</span>
<span class="k">for</span> <span class="n">ix</span> <span class="ow">in</span> <span class="n">__binary_search</span><span class="p">(</span><span class="n">inst</span><span class="p">,</span> <span class="n">fuzzy_sets</span><span class="p">,</span> <span class="n">ordered_sets</span><span class="p">)</span>
<span class="k">if</span> <span class="n">fuzzy_sets</span><span class="p">[</span><span class="n">ordered_sets</span><span class="p">[</span><span class="n">ix</span><span class="p">]]</span><span class="o">.</span><span class="n">membership</span><span class="p">(</span><span class="n">inst</span><span class="p">)</span> <span class="o">&gt;</span> <span class="n">alpha_cut</span><span class="p">]</span>
<span class="k">return</span> <span class="n">fs</span>
<span class="k">except</span> <span class="ne">Exception</span> <span class="k">as</span> <span class="n">ex</span><span class="p">:</span>
<span class="k">raise</span> <span class="n">ex</span></div>
<div class="viewcode-block" id="get_maximum_membership_fuzzyset"><a class="viewcode-back" href="../../../pyFTS.common.html#pyFTS.common.FuzzySet.get_maximum_membership_fuzzyset">[docs]</a><span class="k">def</span> <span class="nf">get_maximum_membership_fuzzyset</span><span class="p">(</span><span class="n">inst</span><span class="p">,</span> <span class="n">fuzzy_sets</span><span class="p">,</span> <span class="n">ordered_sets</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span>

View File

@ -307,7 +307,6 @@
<span class="k">return</span> <span class="n">model</span></div>
<div class="viewcode-block" id="distributed_train"><a class="viewcode-back" href="../../../pyFTS.common.html#pyFTS.common.Util.distributed_train">[docs]</a><span class="k">def</span> <span class="nf">distributed_train</span><span class="p">(</span><span class="n">model</span><span class="p">,</span> <span class="n">train_method</span><span class="p">,</span> <span class="n">nodes</span><span class="p">,</span> <span class="n">fts_method</span><span class="p">,</span> <span class="n">data</span><span class="p">,</span> <span class="n">num_batches</span><span class="o">=</span><span class="mi">10</span><span class="p">,</span>
<span class="n">train_parameters</span><span class="o">=</span><span class="p">{},</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
<span class="kn">import</span> <span class="nn">dispy</span><span class="o">,</span> <span class="nn">dispy.httpd</span><span class="o">,</span> <span class="nn">datetime</span>

View File

@ -168,6 +168,9 @@
<span class="sd"> :keyword distributed: boolean, indicate if the forecasting procedure will be distributed in a dispy cluster</span>
<span class="sd"> :keyword nodes: a list with the dispy cluster nodes addresses</span>
<span class="sd"> :keyword explain: try to explain, step by step, the one-step-ahead point forecasting result given the input data.</span>
<span class="sd"> :keyword generators: for multivariate methods on multi step ahead forecasting, generators is a dict where the keys</span>
<span class="sd"> are the variables names (except the target_variable) and the values are lambda functions that</span>
<span class="sd"> accept one value (the actual value of the variable) and return the next value.</span>
<span class="sd"> :return: a numpy array with the forecasted data</span>
<span class="sd"> &quot;&quot;&quot;</span>
@ -261,10 +264,12 @@
<span class="sd"> :param data: time series data with the minimal length equal to the max_lag of the model</span>
<span class="sd"> :param steps: the number of steps ahead to forecast</span>
<span class="sd"> :param kwargs: model specific parameters</span>
<span class="sd"> :keyword start: in the multi step forecasting, the index of the data where to start forecasting</span>
<span class="sd"> :return: a list with the forecasted values</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">data</span><span class="p">,</span> <span class="n">np</span><span class="o">.</span><span class="n">ndarray</span><span class="p">):</span>
<span class="n">data</span> <span class="o">=</span> <span class="n">data</span><span class="o">.</span><span class="n">tolist</span><span class="p">()</span>

View File

@ -0,0 +1,227 @@
<!doctype html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="X-UA-Compatible" content="IE=Edge" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-55120145-3']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
<title>pyFTS.hyperparam.GridSearch &#8212; pyFTS 1.2.3 documentation</title>
<link rel="stylesheet" href="../../../_static/bizstyle.css" type="text/css" />
<link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
<script type="text/javascript" src="../../../_static/documentation_options.js"></script>
<script type="text/javascript" src="../../../_static/jquery.js"></script>
<script type="text/javascript" src="../../../_static/underscore.js"></script>
<script type="text/javascript" src="../../../_static/doctools.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
<script type="text/javascript" src="../../../_static/bizstyle.js"></script>
<link rel="index" title="Index" href="../../../genindex.html" />
<link rel="search" title="Search" href="../../../search.html" />
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<!--[if lt IE 9]>
<script type="text/javascript" src="_static/css3-mediaqueries.js"></script>
<![endif]-->
</head><body>
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="../../../genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="../../../py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="nav-item nav-item-0"><a href="../../../index.html">pyFTS 1.2.3 documentation</a> &#187;</li>
<li class="nav-item nav-item-1"><a href="../../index.html" accesskey="U">Module code</a> &#187;</li>
</ul>
</div>
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebarwrapper">
<p class="logo"><a href="../../../index.html">
<img class="logo" src="../../../_static/logo_heading2.png" alt="Logo"/>
</a></p>
<div id="searchbox" style="display: none" role="search">
<h3>Quick search</h3>
<div class="searchformwrapper">
<form class="search" action="../../../search.html" method="get">
<input type="text" name="q" />
<input type="submit" value="Go" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
</div>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<h1>Source code for pyFTS.hyperparam.GridSearch</h1><div class="highlight"><pre>
<span></span>
<span class="kn">from</span> <span class="nn">pyFTS.common</span> <span class="k">import</span> <span class="n">Util</span><span class="p">,</span> <span class="n">Membership</span>
<span class="kn">from</span> <span class="nn">pyFTS.models</span> <span class="k">import</span> <span class="n">hofts</span>
<span class="kn">from</span> <span class="nn">pyFTS.partitioners</span> <span class="k">import</span> <span class="n">Grid</span><span class="p">,</span> <span class="n">Entropy</span>
<span class="kn">from</span> <span class="nn">pyFTS.benchmarks</span> <span class="k">import</span> <span class="n">Measures</span>
<span class="kn">from</span> <span class="nn">pyFTS.hyperparam</span> <span class="k">import</span> <span class="n">Util</span> <span class="k">as</span> <span class="n">hUtil</span>
<span class="kn">import</span> <span class="nn">numpy</span> <span class="k">as</span> <span class="nn">np</span>
<span class="kn">import</span> <span class="nn">dispy</span>
<span class="kn">from</span> <span class="nn">itertools</span> <span class="k">import</span> <span class="n">product</span>
<div class="viewcode-block" id="dict_individual"><a class="viewcode-back" href="../../../pyFTS.hyperparam.html#pyFTS.hyperparam.GridSearch.dict_individual">[docs]</a><span class="k">def</span> <span class="nf">dict_individual</span><span class="p">(</span><span class="n">mf</span><span class="p">,</span> <span class="n">partitioner</span><span class="p">,</span> <span class="n">partitions</span><span class="p">,</span> <span class="n">order</span><span class="p">,</span> <span class="n">lags</span><span class="p">,</span> <span class="n">alpha_cut</span><span class="p">):</span>
<span class="k">return</span> <span class="p">{</span>
<span class="s1">&#39;mf&#39;</span><span class="p">:</span> <span class="n">mf</span><span class="p">,</span>
<span class="s1">&#39;partitioner&#39;</span><span class="p">:</span> <span class="n">partitioner</span><span class="p">,</span>
<span class="s1">&#39;npart&#39;</span><span class="p">:</span> <span class="n">partitions</span><span class="p">,</span>
<span class="s1">&#39;alpha&#39;</span><span class="p">:</span> <span class="n">alpha_cut</span><span class="p">,</span>
<span class="s1">&#39;order&#39;</span><span class="p">:</span> <span class="n">order</span><span class="p">,</span>
<span class="s1">&#39;lags&#39;</span><span class="p">:</span> <span class="n">lags</span>
<span class="p">}</span></div>
<div class="viewcode-block" id="metodo_cluster"><a class="viewcode-back" href="../../../pyFTS.hyperparam.html#pyFTS.hyperparam.GridSearch.metodo_cluster">[docs]</a><span class="k">def</span> <span class="nf">metodo_cluster</span><span class="p">(</span><span class="n">individual</span><span class="p">,</span> <span class="n">train</span><span class="p">,</span> <span class="n">test</span><span class="p">):</span>
<span class="kn">from</span> <span class="nn">pyFTS.common</span> <span class="k">import</span> <span class="n">Util</span><span class="p">,</span> <span class="n">Membership</span>
<span class="kn">from</span> <span class="nn">pyFTS.models</span> <span class="k">import</span> <span class="n">hofts</span>
<span class="kn">from</span> <span class="nn">pyFTS.partitioners</span> <span class="k">import</span> <span class="n">Grid</span><span class="p">,</span> <span class="n">Entropy</span>
<span class="kn">from</span> <span class="nn">pyFTS.benchmarks</span> <span class="k">import</span> <span class="n">Measures</span>
<span class="k">if</span> <span class="n">individual</span><span class="p">[</span><span class="s1">&#39;mf&#39;</span><span class="p">]</span> <span class="o">==</span> <span class="mi">1</span><span class="p">:</span>
<span class="n">mf</span> <span class="o">=</span> <span class="n">Membership</span><span class="o">.</span><span class="n">trimf</span>
<span class="k">elif</span> <span class="n">individual</span><span class="p">[</span><span class="s1">&#39;mf&#39;</span><span class="p">]</span> <span class="o">==</span> <span class="mi">2</span><span class="p">:</span>
<span class="n">mf</span> <span class="o">=</span> <span class="n">Membership</span><span class="o">.</span><span class="n">trapmf</span>
<span class="k">elif</span> <span class="n">individual</span><span class="p">[</span><span class="s1">&#39;mf&#39;</span><span class="p">]</span> <span class="o">==</span> <span class="mi">3</span> <span class="ow">and</span> <span class="n">individual</span><span class="p">[</span><span class="s1">&#39;partitioner&#39;</span><span class="p">]</span> <span class="o">!=</span> <span class="mi">2</span><span class="p">:</span>
<span class="n">mf</span> <span class="o">=</span> <span class="n">Membership</span><span class="o">.</span><span class="n">gaussmf</span>
<span class="k">else</span><span class="p">:</span>
<span class="n">mf</span> <span class="o">=</span> <span class="n">Membership</span><span class="o">.</span><span class="n">trimf</span>
<span class="k">if</span> <span class="n">individual</span><span class="p">[</span><span class="s1">&#39;partitioner&#39;</span><span class="p">]</span> <span class="o">==</span> <span class="mi">1</span><span class="p">:</span>
<span class="n">partitioner</span> <span class="o">=</span> <span class="n">Grid</span><span class="o">.</span><span class="n">GridPartitioner</span><span class="p">(</span><span class="n">data</span><span class="o">=</span><span class="n">train</span><span class="p">,</span> <span class="n">npart</span><span class="o">=</span><span class="n">individual</span><span class="p">[</span><span class="s1">&#39;npart&#39;</span><span class="p">],</span> <span class="n">func</span><span class="o">=</span><span class="n">mf</span><span class="p">)</span>
<span class="k">elif</span> <span class="n">individual</span><span class="p">[</span><span class="s1">&#39;partitioner&#39;</span><span class="p">]</span> <span class="o">==</span> <span class="mi">2</span><span class="p">:</span>
<span class="n">npart</span> <span class="o">=</span> <span class="n">individual</span><span class="p">[</span><span class="s1">&#39;npart&#39;</span><span class="p">]</span> <span class="k">if</span> <span class="n">individual</span><span class="p">[</span><span class="s1">&#39;npart&#39;</span><span class="p">]</span> <span class="o">&gt;</span> <span class="mi">10</span> <span class="k">else</span> <span class="mi">10</span>
<span class="n">partitioner</span> <span class="o">=</span> <span class="n">Entropy</span><span class="o">.</span><span class="n">EntropyPartitioner</span><span class="p">(</span><span class="n">data</span><span class="o">=</span><span class="n">train</span><span class="p">,</span> <span class="n">npart</span><span class="o">=</span><span class="n">npart</span><span class="p">,</span> <span class="n">func</span><span class="o">=</span><span class="n">mf</span><span class="p">)</span>
<span class="n">model</span> <span class="o">=</span> <span class="n">hofts</span><span class="o">.</span><span class="n">HighOrderFTS</span><span class="p">(</span><span class="n">partitioner</span><span class="o">=</span><span class="n">partitioner</span><span class="p">,</span>
<span class="n">lags</span><span class="o">=</span><span class="n">individual</span><span class="p">[</span><span class="s1">&#39;lags&#39;</span><span class="p">],</span>
<span class="n">alpha_cut</span><span class="o">=</span><span class="n">individual</span><span class="p">[</span><span class="s1">&#39;alpha&#39;</span><span class="p">],</span>
<span class="n">order</span><span class="o">=</span><span class="n">individual</span><span class="p">[</span><span class="s1">&#39;order&#39;</span><span class="p">])</span>
<span class="n">model</span><span class="o">.</span><span class="n">fit</span><span class="p">(</span><span class="n">train</span><span class="p">)</span>
<span class="n">rmse</span><span class="p">,</span> <span class="n">mape</span><span class="p">,</span> <span class="n">u</span> <span class="o">=</span> <span class="n">Measures</span><span class="o">.</span><span class="n">get_point_statistics</span><span class="p">(</span><span class="n">test</span><span class="p">,</span> <span class="n">model</span><span class="p">)</span>
<span class="k">return</span> <span class="n">individual</span><span class="p">,</span> <span class="n">rmse</span></div>
<div class="viewcode-block" id="execute"><a class="viewcode-back" href="../../../pyFTS.hyperparam.html#pyFTS.hyperparam.GridSearch.execute">[docs]</a><span class="k">def</span> <span class="nf">execute</span><span class="p">(</span><span class="n">hyperparams</span><span class="p">,</span> <span class="n">datasetname</span><span class="p">,</span> <span class="n">train</span><span class="p">,</span> <span class="n">test</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
<span class="n">nodes</span> <span class="o">=</span> <span class="n">kwargs</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">&#39;nodes&#39;</span><span class="p">,[</span><span class="s1">&#39;127.0.0.1&#39;</span><span class="p">])</span>
<span class="n">individuals</span> <span class="o">=</span> <span class="p">[]</span>
<span class="k">if</span> <span class="s1">&#39;lags&#39;</span> <span class="ow">in</span> <span class="n">hyperparams</span><span class="p">:</span>
<span class="n">lags</span> <span class="o">=</span> <span class="n">hyperparams</span><span class="o">.</span><span class="n">pop</span><span class="p">(</span><span class="s1">&#39;lags&#39;</span><span class="p">)</span>
<span class="k">else</span><span class="p">:</span>
<span class="n">lags</span> <span class="o">=</span> <span class="p">[</span><span class="n">k</span> <span class="k">for</span> <span class="n">k</span> <span class="ow">in</span> <span class="n">np</span><span class="o">.</span><span class="n">arange</span><span class="p">(</span><span class="mi">50</span><span class="p">)]</span>
<span class="n">keys_sorted</span> <span class="o">=</span> <span class="p">[</span><span class="n">k</span> <span class="k">for</span> <span class="n">k</span> <span class="ow">in</span> <span class="nb">sorted</span><span class="p">(</span><span class="n">hyperparams</span><span class="o">.</span><span class="n">keys</span><span class="p">())]</span>
<span class="n">index</span> <span class="o">=</span> <span class="p">{}</span>
<span class="k">for</span> <span class="n">k</span> <span class="ow">in</span> <span class="n">np</span><span class="o">.</span><span class="n">arange</span><span class="p">(</span><span class="nb">len</span><span class="p">(</span><span class="n">keys_sorted</span><span class="p">)):</span>
<span class="n">index</span><span class="p">[</span><span class="n">keys_sorted</span><span class="p">[</span><span class="n">k</span><span class="p">]]</span> <span class="o">=</span> <span class="n">k</span>
<span class="n">hp_values</span> <span class="o">=</span> <span class="p">[</span>
<span class="p">[</span><span class="n">v</span> <span class="k">for</span> <span class="n">v</span> <span class="ow">in</span> <span class="n">hyperparams</span><span class="p">[</span><span class="n">hp</span><span class="p">]]</span>
<span class="k">for</span> <span class="n">hp</span> <span class="ow">in</span> <span class="n">keys_sorted</span>
<span class="p">]</span>
<span class="k">for</span> <span class="n">instance</span> <span class="ow">in</span> <span class="n">product</span><span class="p">(</span><span class="o">*</span><span class="n">hp_values</span><span class="p">):</span>
<span class="n">partitions</span> <span class="o">=</span> <span class="n">instance</span><span class="p">[</span><span class="n">index</span><span class="p">[</span><span class="s1">&#39;partitions&#39;</span><span class="p">]]</span>
<span class="n">partitioner</span> <span class="o">=</span> <span class="n">instance</span><span class="p">[</span><span class="n">index</span><span class="p">[</span><span class="s1">&#39;partitioner&#39;</span><span class="p">]]</span>
<span class="n">mf</span> <span class="o">=</span> <span class="n">instance</span><span class="p">[</span><span class="n">index</span><span class="p">[</span><span class="s1">&#39;mf&#39;</span><span class="p">]]</span>
<span class="n">alpha_cut</span> <span class="o">=</span> <span class="n">instance</span><span class="p">[</span><span class="n">index</span><span class="p">[</span><span class="s1">&#39;alpha&#39;</span><span class="p">]]</span>
<span class="n">order</span> <span class="o">=</span> <span class="n">instance</span><span class="p">[</span><span class="n">index</span><span class="p">[</span><span class="s1">&#39;order&#39;</span><span class="p">]]</span>
<span class="k">for</span> <span class="n">lag1</span> <span class="ow">in</span> <span class="n">lags</span><span class="p">:</span> <span class="c1"># o é o lag1</span>
<span class="n">_lags</span> <span class="o">=</span> <span class="p">[</span><span class="n">lag1</span><span class="p">]</span>
<span class="k">if</span> <span class="n">order</span> <span class="o">&gt;</span> <span class="mi">1</span><span class="p">:</span>
<span class="k">for</span> <span class="n">lag2</span> <span class="ow">in</span> <span class="n">lags</span><span class="p">:</span> <span class="c1"># o é o lag1</span>
<span class="n">_lags2</span> <span class="o">=</span> <span class="p">[</span><span class="n">lag1</span><span class="p">,</span> <span class="n">lag1</span><span class="o">+</span><span class="n">lag2</span><span class="p">]</span>
<span class="k">if</span> <span class="n">order</span> <span class="o">&gt;</span> <span class="mi">2</span><span class="p">:</span>
<span class="k">for</span> <span class="n">lag3</span> <span class="ow">in</span> <span class="n">lags</span><span class="p">:</span> <span class="c1"># o é o lag1</span>
<span class="n">_lags3</span> <span class="o">=</span> <span class="p">[</span><span class="n">lag1</span><span class="p">,</span> <span class="n">lag1</span> <span class="o">+</span> <span class="n">lag2</span><span class="p">,</span> <span class="n">lag1</span> <span class="o">+</span> <span class="n">lag2</span><span class="o">+</span><span class="n">lag3</span> <span class="p">]</span>
<span class="n">individuals</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">dict_individual</span><span class="p">(</span><span class="n">mf</span><span class="p">,</span> <span class="n">partitioner</span><span class="p">,</span> <span class="n">partitions</span><span class="p">,</span> <span class="n">order</span><span class="p">,</span> <span class="n">_lags3</span><span class="p">,</span> <span class="n">alpha_cut</span><span class="p">))</span>
<span class="k">else</span><span class="p">:</span>
<span class="n">individuals</span><span class="o">.</span><span class="n">append</span><span class="p">(</span>
<span class="n">dict_individual</span><span class="p">(</span><span class="n">mf</span><span class="p">,</span> <span class="n">partitioner</span><span class="p">,</span> <span class="n">partitions</span><span class="p">,</span> <span class="n">order</span><span class="p">,</span> <span class="n">_lags2</span><span class="p">,</span> <span class="n">alpha_cut</span><span class="p">))</span>
<span class="k">else</span><span class="p">:</span>
<span class="n">individuals</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">dict_individual</span><span class="p">(</span><span class="n">mf</span><span class="p">,</span> <span class="n">partitioner</span><span class="p">,</span> <span class="n">partitions</span><span class="p">,</span> <span class="n">order</span><span class="p">,</span> <span class="n">_lags</span><span class="p">,</span> <span class="n">alpha_cut</span><span class="p">))</span>
<span class="n">cluster</span><span class="p">,</span> <span class="n">http_server</span> <span class="o">=</span> <span class="n">Util</span><span class="o">.</span><span class="n">start_dispy_cluster</span><span class="p">(</span><span class="n">metodo_cluster</span><span class="p">,</span> <span class="n">nodes</span><span class="o">=</span><span class="n">nodes</span><span class="p">)</span>
<span class="n">jobs</span> <span class="o">=</span> <span class="p">[]</span>
<span class="k">for</span> <span class="n">ind</span> <span class="ow">in</span> <span class="n">individuals</span><span class="p">:</span>
<span class="n">job</span> <span class="o">=</span> <span class="n">cluster</span><span class="o">.</span><span class="n">submit</span><span class="p">(</span><span class="n">ind</span><span class="p">,</span> <span class="n">train</span><span class="p">,</span> <span class="n">test</span><span class="p">)</span>
<span class="n">jobs</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">job</span><span class="p">)</span>
<span class="n">conn</span> <span class="o">=</span> <span class="n">hUtil</span><span class="o">.</span><span class="n">open_hyperparam_db</span><span class="p">(</span><span class="s1">&#39;hyperparam.db&#39;</span><span class="p">)</span>
<span class="k">for</span> <span class="n">job</span> <span class="ow">in</span> <span class="n">jobs</span><span class="p">:</span>
<span class="n">result</span><span class="p">,</span> <span class="n">rmse</span> <span class="o">=</span> <span class="n">job</span><span class="p">()</span>
<span class="k">if</span> <span class="n">job</span><span class="o">.</span><span class="n">status</span> <span class="o">==</span> <span class="n">dispy</span><span class="o">.</span><span class="n">DispyJob</span><span class="o">.</span><span class="n">Finished</span> <span class="ow">and</span> <span class="n">result</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span>
<span class="nb">print</span><span class="p">(</span><span class="n">result</span><span class="p">)</span>
<span class="n">record</span> <span class="o">=</span> <span class="p">(</span><span class="n">datasetname</span><span class="p">,</span> <span class="s1">&#39;GridSearch&#39;</span><span class="p">,</span> <span class="s1">&#39;HOFTS&#39;</span><span class="p">,</span> <span class="kc">None</span><span class="p">,</span> <span class="n">result</span><span class="p">[</span><span class="s1">&#39;mf&#39;</span><span class="p">],</span>
<span class="n">result</span><span class="p">[</span><span class="s1">&#39;order&#39;</span><span class="p">],</span> <span class="n">result</span><span class="p">[</span><span class="s1">&#39;partitioner&#39;</span><span class="p">],</span> <span class="n">result</span><span class="p">[</span><span class="s1">&#39;npart&#39;</span><span class="p">],</span>
<span class="n">result</span><span class="p">[</span><span class="s1">&#39;alpha&#39;</span><span class="p">],</span> <span class="nb">str</span><span class="p">(</span><span class="n">result</span><span class="p">[</span><span class="s1">&#39;lags&#39;</span><span class="p">]),</span> <span class="s1">&#39;rmse&#39;</span><span class="p">,</span> <span class="n">rmse</span><span class="p">)</span>
<span class="n">hUtil</span><span class="o">.</span><span class="n">insert_hyperparam</span><span class="p">(</span><span class="n">record</span><span class="p">,</span> <span class="n">conn</span><span class="p">)</span>
<span class="k">else</span><span class="p">:</span>
<span class="nb">print</span><span class="p">(</span><span class="n">job</span><span class="o">.</span><span class="n">exception</span><span class="p">)</span>
<span class="nb">print</span><span class="p">(</span><span class="n">job</span><span class="o">.</span><span class="n">stdout</span><span class="p">)</span>
<span class="n">Util</span><span class="o">.</span><span class="n">stop_dispy_cluster</span><span class="p">(</span><span class="n">cluster</span><span class="p">,</span> <span class="n">http_server</span><span class="p">)</span></div>
</pre></div>
</div>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="../../../genindex.html" title="General Index"
>index</a></li>
<li class="right" >
<a href="../../../py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="nav-item nav-item-0"><a href="../../../index.html">pyFTS 1.2.3 documentation</a> &#187;</li>
<li class="nav-item nav-item-1"><a href="../../index.html" >Module code</a> &#187;</li>
</ul>
</div>
<div class="footer" role="contentinfo">
&#169; Copyright 2018, Machine Intelligence and Data Science Laboratory - UFMG - Brazil.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.7.2.
</div>
</body>
</html>

View File

@ -0,0 +1,169 @@
<!doctype html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="X-UA-Compatible" content="IE=Edge" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-55120145-3']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
<title>pyFTS.hyperparam.Util &#8212; pyFTS 1.2.3 documentation</title>
<link rel="stylesheet" href="../../../_static/bizstyle.css" type="text/css" />
<link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
<script type="text/javascript" src="../../../_static/documentation_options.js"></script>
<script type="text/javascript" src="../../../_static/jquery.js"></script>
<script type="text/javascript" src="../../../_static/underscore.js"></script>
<script type="text/javascript" src="../../../_static/doctools.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
<script type="text/javascript" src="../../../_static/bizstyle.js"></script>
<link rel="index" title="Index" href="../../../genindex.html" />
<link rel="search" title="Search" href="../../../search.html" />
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<!--[if lt IE 9]>
<script type="text/javascript" src="_static/css3-mediaqueries.js"></script>
<![endif]-->
</head><body>
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="../../../genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="../../../py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="nav-item nav-item-0"><a href="../../../index.html">pyFTS 1.2.3 documentation</a> &#187;</li>
<li class="nav-item nav-item-1"><a href="../../index.html" accesskey="U">Module code</a> &#187;</li>
</ul>
</div>
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebarwrapper">
<p class="logo"><a href="../../../index.html">
<img class="logo" src="../../../_static/logo_heading2.png" alt="Logo"/>
</a></p>
<div id="searchbox" style="display: none" role="search">
<h3>Quick search</h3>
<div class="searchformwrapper">
<form class="search" action="../../../search.html" method="get">
<input type="text" name="q" />
<input type="submit" value="Go" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
</div>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<h1>Source code for pyFTS.hyperparam.Util</h1><div class="highlight"><pre>
<span></span><span class="sd">&quot;&quot;&quot;</span>
<span class="sd">Common facilities for hyperparameter tunning</span>
<span class="sd">&quot;&quot;&quot;</span>
<span class="kn">import</span> <span class="nn">sqlite3</span>
<div class="viewcode-block" id="open_hyperparam_db"><a class="viewcode-back" href="../../../pyFTS.hyperparam.html#pyFTS.hyperparam.Util.open_hyperparam_db">[docs]</a><span class="k">def</span> <span class="nf">open_hyperparam_db</span><span class="p">(</span><span class="n">name</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Open a connection with a Sqlite database designed to store benchmark results.</span>
<span class="sd"> :param name: database filenem</span>
<span class="sd"> :return: a sqlite3 database connection</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="n">conn</span> <span class="o">=</span> <span class="n">sqlite3</span><span class="o">.</span><span class="n">connect</span><span class="p">(</span><span class="n">name</span><span class="p">)</span>
<span class="c1">#performance optimizations</span>
<span class="n">conn</span><span class="o">.</span><span class="n">execute</span><span class="p">(</span><span class="s2">&quot;PRAGMA journal_mode = WAL&quot;</span><span class="p">)</span>
<span class="n">conn</span><span class="o">.</span><span class="n">execute</span><span class="p">(</span><span class="s2">&quot;PRAGMA synchronous = NORMAL&quot;</span><span class="p">)</span>
<span class="n">create_hyperparam_tables</span><span class="p">(</span><span class="n">conn</span><span class="p">)</span>
<span class="k">return</span> <span class="n">conn</span></div>
<div class="viewcode-block" id="create_hyperparam_tables"><a class="viewcode-back" href="../../../pyFTS.hyperparam.html#pyFTS.hyperparam.Util.create_hyperparam_tables">[docs]</a><span class="k">def</span> <span class="nf">create_hyperparam_tables</span><span class="p">(</span><span class="n">conn</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Create a sqlite3 table designed to store benchmark results.</span>
<span class="sd"> :param conn: a sqlite3 database connection</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="n">c</span> <span class="o">=</span> <span class="n">conn</span><span class="o">.</span><span class="n">cursor</span><span class="p">()</span>
<span class="n">c</span><span class="o">.</span><span class="n">execute</span><span class="p">(</span><span class="s1">&#39;&#39;&#39;CREATE TABLE if not exists hyperparam(</span>
<span class="s1"> ID integer primary key, Date int, Dataset text, Tag text, </span>
<span class="s1"> Model text, Transformation text, mf text, &#39;Order&#39; int, </span>
<span class="s1"> Partitioner text, Partitions int, alpha real, lags text, </span>
<span class="s1"> Measure text, Value real)&#39;&#39;&#39;</span><span class="p">)</span>
<span class="n">conn</span><span class="o">.</span><span class="n">commit</span><span class="p">()</span></div>
<div class="viewcode-block" id="insert_hyperparam"><a class="viewcode-back" href="../../../pyFTS.hyperparam.html#pyFTS.hyperparam.Util.insert_hyperparam">[docs]</a><span class="k">def</span> <span class="nf">insert_hyperparam</span><span class="p">(</span><span class="n">data</span><span class="p">,</span> <span class="n">conn</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Insert benchmark data on database</span>
<span class="sd"> :param data: a tuple with the benchmark data with format:</span>
<span class="sd"> Dataset: Identify on which dataset the dataset was performed</span>
<span class="sd"> Tag: a user defined word that indentify a benchmark set</span>
<span class="sd"> Model: FTS model</span>
<span class="sd"> Transformation: The name of data transformation, if one was used</span>
<span class="sd"> mf: membership function</span>
<span class="sd"> Order: the order of the FTS method</span>
<span class="sd"> Partitioner: UoD partitioning scheme</span>
<span class="sd"> Partitions: Number of partitions</span>
<span class="sd"> alpha: alpha cut</span>
<span class="sd"> lags: lags</span>
<span class="sd"> Measure: accuracy measure</span>
<span class="sd"> Value: the measure value</span>
<span class="sd"> :param conn: a sqlite3 database connection</span>
<span class="sd"> :return:</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="n">c</span> <span class="o">=</span> <span class="n">conn</span><span class="o">.</span><span class="n">cursor</span><span class="p">()</span>
<span class="n">c</span><span class="o">.</span><span class="n">execute</span><span class="p">(</span><span class="s2">&quot;INSERT INTO hyperparam(Date, Dataset, Tag, Model, &quot;</span>
<span class="o">+</span> <span class="s2">&quot;Transformation, mf, &#39;Order&#39;, Partitioner, Partitions, &quot;</span>
<span class="o">+</span> <span class="s2">&quot;alpha, lags, Measure, Value) &quot;</span>
<span class="o">+</span> <span class="s2">&quot;VALUES(datetime(&#39;now&#39;),?,?,?,?,?,?,?,?,?,?,?,?)&quot;</span><span class="p">,</span> <span class="n">data</span><span class="p">)</span>
<span class="n">conn</span><span class="o">.</span><span class="n">commit</span><span class="p">()</span></div>
</pre></div>
</div>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="../../../genindex.html" title="General Index"
>index</a></li>
<li class="right" >
<a href="../../../py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="nav-item nav-item-0"><a href="../../../index.html">pyFTS 1.2.3 documentation</a> &#187;</li>
<li class="nav-item nav-item-1"><a href="../../index.html" >Module code</a> &#187;</li>
</ul>
</div>
<div class="footer" role="contentinfo">
&#169; Copyright 2018, Machine Intelligence and Data Science Laboratory - UFMG - Brazil.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.7.2.
</div>
</body>
</html>

View File

@ -110,6 +110,48 @@
<span class="k">return</span> <span class="nb">len</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">RHS</span><span class="p">)</span></div>
<div class="viewcode-block" id="WeightedHighOrderFLRG"><a class="viewcode-back" href="../../../pyFTS.models.html#pyFTS.models.hofts.WeightedHighOrderFLRG">[docs]</a><span class="k">class</span> <span class="nc">WeightedHighOrderFLRG</span><span class="p">(</span><span class="n">flrg</span><span class="o">.</span><span class="n">FLRG</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;Weighted High Order Fuzzy Logical Relationship Group&quot;&quot;&quot;</span>
<span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">order</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
<span class="nb">super</span><span class="p">(</span><span class="n">WeightedHighOrderFLRG</span><span class="p">,</span> <span class="bp">self</span><span class="p">)</span><span class="o">.</span><span class="fm">__init__</span><span class="p">(</span><span class="n">order</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">)</span>
<span class="bp">self</span><span class="o">.</span><span class="n">LHS</span> <span class="o">=</span> <span class="p">[]</span>
<span class="bp">self</span><span class="o">.</span><span class="n">RHS</span> <span class="o">=</span> <span class="p">{}</span>
<span class="bp">self</span><span class="o">.</span><span class="n">count</span> <span class="o">=</span> <span class="mf">0.0</span>
<span class="bp">self</span><span class="o">.</span><span class="n">strlhs</span> <span class="o">=</span> <span class="s2">&quot;&quot;</span>
<span class="bp">self</span><span class="o">.</span><span class="n">w</span> <span class="o">=</span> <span class="kc">None</span>
<div class="viewcode-block" id="WeightedHighOrderFLRG.append_rhs"><a class="viewcode-back" href="../../../pyFTS.models.html#pyFTS.models.hofts.WeightedHighOrderFLRG.append_rhs">[docs]</a> <span class="k">def</span> <span class="nf">append_rhs</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">fset</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
<span class="k">if</span> <span class="n">fset</span> <span class="ow">not</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">RHS</span><span class="p">:</span>
<span class="bp">self</span><span class="o">.</span><span class="n">RHS</span><span class="p">[</span><span class="n">fset</span><span class="p">]</span> <span class="o">=</span> <span class="mf">1.0</span>
<span class="k">else</span><span class="p">:</span>
<span class="bp">self</span><span class="o">.</span><span class="n">RHS</span><span class="p">[</span><span class="n">fset</span><span class="p">]</span> <span class="o">+=</span> <span class="mf">1.0</span>
<span class="bp">self</span><span class="o">.</span><span class="n">count</span> <span class="o">+=</span> <span class="mf">1.0</span></div>
<div class="viewcode-block" id="WeightedHighOrderFLRG.append_lhs"><a class="viewcode-back" href="../../../pyFTS.models.html#pyFTS.models.hofts.WeightedHighOrderFLRG.append_lhs">[docs]</a> <span class="k">def</span> <span class="nf">append_lhs</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">c</span><span class="p">):</span>
<span class="bp">self</span><span class="o">.</span><span class="n">LHS</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">c</span><span class="p">)</span></div>
<div class="viewcode-block" id="WeightedHighOrderFLRG.weights"><a class="viewcode-back" href="../../../pyFTS.models.html#pyFTS.models.hofts.WeightedHighOrderFLRG.weights">[docs]</a> <span class="k">def</span> <span class="nf">weights</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">w</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span>
<span class="bp">self</span><span class="o">.</span><span class="n">w</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">array</span><span class="p">([</span><span class="bp">self</span><span class="o">.</span><span class="n">RHS</span><span class="p">[</span><span class="n">c</span><span class="p">]</span> <span class="o">/</span> <span class="bp">self</span><span class="o">.</span><span class="n">count</span> <span class="k">for</span> <span class="n">c</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">RHS</span><span class="o">.</span><span class="n">keys</span><span class="p">()])</span>
<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">w</span></div>
<div class="viewcode-block" id="WeightedHighOrderFLRG.get_midpoint"><a class="viewcode-back" href="../../../pyFTS.models.html#pyFTS.models.hofts.WeightedHighOrderFLRG.get_midpoint">[docs]</a> <span class="k">def</span> <span class="nf">get_midpoint</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">sets</span><span class="p">):</span>
<span class="n">mp</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">array</span><span class="p">([</span><span class="n">sets</span><span class="p">[</span><span class="n">c</span><span class="p">]</span><span class="o">.</span><span class="n">centroid</span> <span class="k">for</span> <span class="n">c</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">RHS</span><span class="o">.</span><span class="n">keys</span><span class="p">()])</span>
<span class="k">return</span> <span class="n">mp</span><span class="o">.</span><span class="n">dot</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">weights</span><span class="p">())</span></div>
<span class="k">def</span> <span class="nf">__str__</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="n">_str</span> <span class="o">=</span> <span class="s2">&quot;&quot;</span>
<span class="k">for</span> <span class="n">k</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">RHS</span><span class="o">.</span><span class="n">keys</span><span class="p">():</span>
<span class="n">_str</span> <span class="o">+=</span> <span class="s2">&quot;, &quot;</span> <span class="k">if</span> <span class="nb">len</span><span class="p">(</span><span class="n">_str</span><span class="p">)</span> <span class="o">&gt;</span> <span class="mi">0</span> <span class="k">else</span> <span class="s2">&quot;&quot;</span>
<span class="n">_str</span> <span class="o">+=</span> <span class="n">k</span> <span class="o">+</span> <span class="s2">&quot; (&quot;</span> <span class="o">+</span> <span class="nb">str</span><span class="p">(</span><span class="nb">round</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">RHS</span><span class="p">[</span><span class="n">k</span><span class="p">]</span> <span class="o">/</span> <span class="bp">self</span><span class="o">.</span><span class="n">count</span><span class="p">,</span> <span class="mi">3</span><span class="p">))</span> <span class="o">+</span> <span class="s2">&quot;)&quot;</span>
<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">get_key</span><span class="p">()</span> <span class="o">+</span> <span class="s2">&quot; -&gt; &quot;</span> <span class="o">+</span> <span class="n">_str</span>
<span class="k">def</span> <span class="nf">__len__</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="k">return</span> <span class="nb">len</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">RHS</span><span class="p">)</span></div>
<div class="viewcode-block" id="HighOrderFTS"><a class="viewcode-back" href="../../../pyFTS.models.html#pyFTS.models.hofts.HighOrderFTS">[docs]</a><span class="k">class</span> <span class="nc">HighOrderFTS</span><span class="p">(</span><span class="n">fts</span><span class="o">.</span><span class="n">FTS</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;Conventional High Order Fuzzy Time Series&quot;&quot;&quot;</span>
<span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
@ -137,13 +179,19 @@
<span class="bp">self</span><span class="o">.</span><span class="n">lags</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">arange</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">order</span><span class="o">+</span><span class="mi">1</span><span class="p">)</span></div>
<div class="viewcode-block" id="HighOrderFTS.generate_lhs_flrg"><a class="viewcode-back" href="../../../pyFTS.models.html#pyFTS.models.hofts.HighOrderFTS.generate_lhs_flrg">[docs]</a> <span class="k">def</span> <span class="nf">generate_lhs_flrg</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">sample</span><span class="p">,</span> <span class="n">explain</span><span class="o">=</span><span class="kc">False</span><span class="p">):</span>
<span class="n">nsample</span> <span class="o">=</span> <span class="p">[</span><span class="n">FuzzySet</span><span class="o">.</span><span class="n">fuzzyfy</span><span class="p">(</span><span class="n">k</span><span class="p">,</span> <span class="n">partitioner</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">partitioner</span><span class="p">,</span> <span class="n">mode</span><span class="o">=</span><span class="s2">&quot;sets&quot;</span><span class="p">,</span> <span class="n">alpha_cut</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">alpha_cut</span><span class="p">)</span>
<span class="k">for</span> <span class="n">k</span> <span class="ow">in</span> <span class="n">sample</span><span class="p">]</span>
<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">generate_lhs_flrg_fuzzyfied</span><span class="p">(</span><span class="n">nsample</span><span class="p">,</span> <span class="n">explain</span><span class="p">)</span></div>
<div class="viewcode-block" id="HighOrderFTS.generate_lhs_flrg_fuzzyfied"><a class="viewcode-back" href="../../../pyFTS.models.html#pyFTS.models.hofts.HighOrderFTS.generate_lhs_flrg_fuzzyfied">[docs]</a> <span class="k">def</span> <span class="nf">generate_lhs_flrg_fuzzyfied</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">sample</span><span class="p">,</span> <span class="n">explain</span><span class="o">=</span><span class="kc">False</span><span class="p">):</span>
<span class="n">lags</span> <span class="o">=</span> <span class="p">{}</span>
<span class="n">flrgs</span> <span class="o">=</span> <span class="p">[]</span>
<span class="k">for</span> <span class="n">ct</span><span class="p">,</span> <span class="n">o</span> <span class="ow">in</span> <span class="nb">enumerate</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">lags</span><span class="p">):</span>
<span class="n">lhs</span> <span class="o">=</span> <span class="n">FuzzySet</span><span class="o">.</span><span class="n">fuzzyfy</span><span class="p">(</span><span class="n">sample</span><span class="p">[</span><span class="n">o</span><span class="o">-</span><span class="mi">1</span><span class="p">],</span> <span class="n">partitioner</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">partitioner</span><span class="p">,</span> <span class="n">mode</span><span class="o">=</span><span class="s2">&quot;sets&quot;</span><span class="p">,</span> <span class="n">alpha_cut</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">alpha_cut</span><span class="p">)</span>
<span class="n">lags</span><span class="p">[</span><span class="n">ct</span><span class="p">]</span> <span class="o">=</span> <span class="n">lhs</span>
<span class="n">lags</span><span class="p">[</span><span class="n">ct</span><span class="p">]</span> <span class="o">=</span> <span class="n">sample</span><span class="p">[</span><span class="n">o</span><span class="o">-</span><span class="mi">1</span><span class="p">]</span>
<span class="k">if</span> <span class="n">explain</span><span class="p">:</span>
<span class="nb">print</span><span class="p">(</span><span class="s2">&quot;</span><span class="se">\t</span><span class="s2"> (Lag </span><span class="si">{}</span><span class="s2">) </span><span class="si">{}</span><span class="s2"> -&gt; </span><span class="si">{}</span><span class="s2"> </span><span class="se">\n</span><span class="s2">&quot;</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">o</span><span class="p">,</span> <span class="n">sample</span><span class="p">[</span><span class="n">o</span><span class="o">-</span><span class="mi">1</span><span class="p">],</span> <span class="n">lhs</span><span class="p">))</span>
@ -167,24 +215,51 @@
<div class="viewcode-block" id="HighOrderFTS.generate_flrg"><a class="viewcode-back" href="../../../pyFTS.models.html#pyFTS.models.hofts.HighOrderFTS.generate_flrg">[docs]</a> <span class="k">def</span> <span class="nf">generate_flrg</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">data</span><span class="p">):</span>
<span class="n">l</span> <span class="o">=</span> <span class="nb">len</span><span class="p">(</span><span class="n">data</span><span class="p">)</span>
<span class="k">for</span> <span class="n">k</span> <span class="ow">in</span> <span class="n">np</span><span class="o">.</span><span class="n">arange</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">max_lag</span><span class="p">,</span> <span class="n">l</span><span class="p">):</span>
<span class="n">lags</span> <span class="o">=</span> <span class="p">{}</span>
<span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">dump</span><span class="p">:</span> <span class="nb">print</span><span class="p">(</span><span class="s2">&quot;FLR: &quot;</span> <span class="o">+</span> <span class="nb">str</span><span class="p">(</span><span class="n">k</span><span class="p">))</span>
<span class="n">sample</span> <span class="o">=</span> <span class="n">data</span><span class="p">[</span><span class="n">k</span> <span class="o">-</span> <span class="bp">self</span><span class="o">.</span><span class="n">max_lag</span><span class="p">:</span> <span class="n">k</span><span class="p">]</span>
<span class="nb">print</span><span class="p">(</span><span class="n">sample</span><span class="p">)</span>
<span class="n">rhs</span> <span class="o">=</span> <span class="n">FuzzySet</span><span class="o">.</span><span class="n">fuzzyfy</span><span class="p">(</span><span class="n">data</span><span class="p">[</span><span class="n">k</span><span class="p">],</span> <span class="n">partitioner</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">partitioner</span><span class="p">,</span> <span class="n">mode</span><span class="o">=</span><span class="s2">&quot;sets&quot;</span><span class="p">,</span> <span class="n">alpha_cut</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">alpha_cut</span><span class="p">)</span>
<span class="n">flrgs</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">generate_lhs_flrg</span><span class="p">(</span><span class="n">sample</span><span class="p">)</span>
<span class="k">for</span> <span class="n">flrg</span> <span class="ow">in</span> <span class="n">flrgs</span><span class="p">:</span>
<span class="nb">print</span><span class="p">(</span><span class="s1">&#39;key&#39;</span><span class="p">,</span> <span class="n">flrg</span><span class="o">.</span><span class="n">get_key</span><span class="p">())</span>
<span class="k">if</span> <span class="n">flrg</span><span class="o">.</span><span class="n">get_key</span><span class="p">()</span> <span class="ow">not</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">flrgs</span><span class="p">:</span>
<span class="bp">self</span><span class="o">.</span><span class="n">flrgs</span><span class="p">[</span><span class="n">flrg</span><span class="o">.</span><span class="n">get_key</span><span class="p">()]</span> <span class="o">=</span> <span class="n">flrg</span><span class="p">;</span>
<span class="k">for</span> <span class="n">st</span> <span class="ow">in</span> <span class="n">rhs</span><span class="p">:</span>
<span class="bp">self</span><span class="o">.</span><span class="n">flrgs</span><span class="p">[</span><span class="n">flrg</span><span class="o">.</span><span class="n">get_key</span><span class="p">()]</span><span class="o">.</span><span class="n">append_rhs</span><span class="p">(</span><span class="n">st</span><span class="p">)</span></div>
<div class="viewcode-block" id="HighOrderFTS.generate_flrg_fuzzyfied"><a class="viewcode-back" href="../../../pyFTS.models.html#pyFTS.models.hofts.HighOrderFTS.generate_flrg_fuzzyfied">[docs]</a> <span class="k">def</span> <span class="nf">generate_flrg_fuzzyfied</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">data</span><span class="p">):</span>
<span class="n">l</span> <span class="o">=</span> <span class="nb">len</span><span class="p">(</span><span class="n">data</span><span class="p">)</span>
<span class="k">for</span> <span class="n">k</span> <span class="ow">in</span> <span class="n">np</span><span class="o">.</span><span class="n">arange</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">max_lag</span><span class="p">,</span> <span class="n">l</span><span class="p">):</span>
<span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">dump</span><span class="p">:</span> <span class="nb">print</span><span class="p">(</span><span class="s2">&quot;FLR: &quot;</span> <span class="o">+</span> <span class="nb">str</span><span class="p">(</span><span class="n">k</span><span class="p">))</span>
<span class="n">sample</span> <span class="o">=</span> <span class="n">data</span><span class="p">[</span><span class="n">k</span> <span class="o">-</span> <span class="bp">self</span><span class="o">.</span><span class="n">max_lag</span><span class="p">:</span> <span class="n">k</span><span class="p">]</span>
<span class="n">rhs</span> <span class="o">=</span> <span class="n">data</span><span class="p">[</span><span class="n">k</span><span class="p">]</span>
<span class="n">flrgs</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">generate_lhs_flrg_fuzzyfied</span><span class="p">(</span><span class="n">sample</span><span class="p">)</span>
<span class="k">for</span> <span class="n">flrg</span> <span class="ow">in</span> <span class="n">flrgs</span><span class="p">:</span>
<span class="k">if</span> <span class="n">flrg</span><span class="o">.</span><span class="n">get_key</span><span class="p">()</span> <span class="ow">not</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">flrgs</span><span class="p">:</span>
<span class="bp">self</span><span class="o">.</span><span class="n">flrgs</span><span class="p">[</span><span class="n">flrg</span><span class="o">.</span><span class="n">get_key</span><span class="p">()]</span> <span class="o">=</span> <span class="n">flrg</span>
<span class="k">for</span> <span class="n">st</span> <span class="ow">in</span> <span class="n">rhs</span><span class="p">:</span>
<span class="bp">self</span><span class="o">.</span><span class="n">flrgs</span><span class="p">[</span><span class="n">flrg</span><span class="o">.</span><span class="n">get_key</span><span class="p">()]</span><span class="o">.</span><span class="n">append_rhs</span><span class="p">(</span><span class="n">st</span><span class="p">)</span></div>
<div class="viewcode-block" id="HighOrderFTS.train"><a class="viewcode-back" href="../../../pyFTS.models.html#pyFTS.models.hofts.HighOrderFTS.train">[docs]</a> <span class="k">def</span> <span class="nf">train</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">data</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
<span class="bp">self</span><span class="o">.</span><span class="n">configure_lags</span><span class="p">(</span><span class="o">**</span><span class="n">kwargs</span><span class="p">)</span>
<span class="bp">self</span><span class="o">.</span><span class="n">generate_flrg</span><span class="p">(</span><span class="n">data</span><span class="p">)</span></div>
<span class="k">if</span> <span class="ow">not</span> <span class="n">kwargs</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">&#39;fuzzyfied&#39;</span><span class="p">,</span><span class="kc">False</span><span class="p">):</span>
<span class="bp">self</span><span class="o">.</span><span class="n">generate_flrg</span><span class="p">(</span><span class="n">data</span><span class="p">)</span>
<span class="k">else</span><span class="p">:</span>
<span class="bp">self</span><span class="o">.</span><span class="n">generate_flrg_fuzzyfied</span><span class="p">(</span><span class="n">data</span><span class="p">)</span></div>
<div class="viewcode-block" id="HighOrderFTS.forecast"><a class="viewcode-back" href="../../../pyFTS.models.html#pyFTS.models.hofts.HighOrderFTS.forecast">[docs]</a> <span class="k">def</span> <span class="nf">forecast</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">ndata</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
@ -202,7 +277,10 @@
<span class="k">if</span> <span class="n">explain</span><span class="p">:</span>
<span class="nb">print</span><span class="p">(</span><span class="s2">&quot;Fuzzyfication </span><span class="se">\n</span><span class="s2">&quot;</span><span class="p">)</span>
<span class="n">flrgs</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">generate_lhs_flrg</span><span class="p">(</span><span class="n">ndata</span><span class="p">[</span><span class="n">k</span> <span class="o">-</span> <span class="bp">self</span><span class="o">.</span><span class="n">max_lag</span><span class="p">:</span> <span class="n">k</span><span class="p">],</span> <span class="n">explain</span><span class="p">)</span>
<span class="k">if</span> <span class="ow">not</span> <span class="n">kwargs</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">&#39;fuzzyfied&#39;</span><span class="p">,</span> <span class="kc">False</span><span class="p">):</span>
<span class="n">flrgs</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">generate_lhs_flrg</span><span class="p">(</span><span class="n">ndata</span><span class="p">[</span><span class="n">k</span> <span class="o">-</span> <span class="bp">self</span><span class="o">.</span><span class="n">max_lag</span><span class="p">:</span> <span class="n">k</span><span class="p">],</span> <span class="n">explain</span><span class="p">)</span>
<span class="k">else</span><span class="p">:</span>
<span class="n">flrgs</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">generate_lhs_flrg_fuzzyfied</span><span class="p">(</span><span class="n">ndata</span><span class="p">[</span><span class="n">k</span> <span class="o">-</span> <span class="bp">self</span><span class="o">.</span><span class="n">max_lag</span><span class="p">:</span> <span class="n">k</span><span class="p">],</span> <span class="n">explain</span><span class="p">)</span>
<span class="k">if</span> <span class="n">explain</span><span class="p">:</span>
<span class="nb">print</span><span class="p">(</span><span class="s2">&quot;Rules:</span><span class="se">\n</span><span class="s2">&quot;</span><span class="p">)</span>
@ -212,16 +290,15 @@
<span class="k">if</span> <span class="n">flrg</span><span class="o">.</span><span class="n">get_key</span><span class="p">()</span> <span class="ow">not</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">flrgs</span><span class="p">:</span>
<span class="k">if</span> <span class="nb">len</span><span class="p">(</span><span class="n">flrg</span><span class="o">.</span><span class="n">LHS</span><span class="p">)</span> <span class="o">&gt;</span> <span class="mi">0</span><span class="p">:</span>
<span class="n">mp</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">sets</span><span class="p">[</span><span class="n">flrg</span><span class="o">.</span><span class="n">LHS</span><span class="p">[</span><span class="o">-</span><span class="mi">1</span><span class="p">]]</span><span class="o">.</span><span class="n">centroid</span>
<span class="n">mp</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">partitioner</span><span class="o">.</span><span class="n">sets</span><span class="p">[</span><span class="n">flrg</span><span class="o">.</span><span class="n">LHS</span><span class="p">[</span><span class="o">-</span><span class="mi">1</span><span class="p">]]</span><span class="o">.</span><span class="n">centroid</span>
<span class="n">tmp</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">mp</span><span class="p">)</span>
<span class="k">if</span> <span class="n">explain</span><span class="p">:</span>
<span class="nb">print</span><span class="p">(</span><span class="s2">&quot;</span><span class="se">\t</span><span class="s2"> </span><span class="si">{}</span><span class="s2"> -&gt; </span><span class="si">{}</span><span class="s2"> (Naïve)</span><span class="se">\t</span><span class="s2"> Midpoint: </span><span class="si">{}</span><span class="se">\n</span><span class="s2">&quot;</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="nb">str</span><span class="p">(</span><span class="n">flrg</span><span class="o">.</span><span class="n">LHS</span><span class="p">),</span> <span class="n">flrg</span><span class="o">.</span><span class="n">LHS</span><span class="p">[</span><span class="o">-</span><span class="mi">1</span><span class="p">],</span>
<span class="n">mp</span><span class="p">))</span>
<span class="k">else</span><span class="p">:</span>
<span class="n">flrg</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">flrgs</span><span class="p">[</span><span class="n">flrg</span><span class="o">.</span><span class="n">get_key</span><span class="p">()]</span>
<span class="n">mp</span> <span class="o">=</span> <span class="n">flrg</span><span class="o">.</span><span class="n">get_midpoint</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">sets</span><span class="p">)</span>
<span class="n">mp</span> <span class="o">=</span> <span class="n">flrg</span><span class="o">.</span><span class="n">get_midpoint</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">partitioner</span><span class="o">.</span><span class="n">sets</span><span class="p">)</span>
<span class="n">tmp</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">mp</span><span class="p">)</span>
<span class="k">if</span> <span class="n">explain</span><span class="p">:</span>
@ -234,6 +311,41 @@
<span class="nb">print</span><span class="p">(</span><span class="s2">&quot;Deffuzyfied value: </span><span class="si">{}</span><span class="s2"> </span><span class="se">\n</span><span class="s2">&quot;</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">final</span><span class="p">))</span>
<span class="k">return</span> <span class="n">ret</span></div></div>
<div class="viewcode-block" id="WeightedHighOrderFTS"><a class="viewcode-back" href="../../../pyFTS.models.html#pyFTS.models.hofts.WeightedHighOrderFTS">[docs]</a><span class="k">class</span> <span class="nc">WeightedHighOrderFTS</span><span class="p">(</span><span class="n">HighOrderFTS</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;Weighted High Order Fuzzy Time Series&quot;&quot;&quot;</span>
<span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
<span class="nb">super</span><span class="p">(</span><span class="n">WeightedHighOrderFTS</span><span class="p">,</span> <span class="bp">self</span><span class="p">)</span><span class="o">.</span><span class="fm">__init__</span><span class="p">(</span><span class="o">**</span><span class="n">kwargs</span><span class="p">)</span>
<span class="bp">self</span><span class="o">.</span><span class="n">name</span> <span class="o">=</span> <span class="s2">&quot;Weighted High Order FTS&quot;</span>
<span class="bp">self</span><span class="o">.</span><span class="n">shortname</span> <span class="o">=</span> <span class="s2">&quot;WHOFTS&quot;</span>
<div class="viewcode-block" id="WeightedHighOrderFTS.generate_lhs_flrg_fuzzyfied"><a class="viewcode-back" href="../../../pyFTS.models.html#pyFTS.models.hofts.WeightedHighOrderFTS.generate_lhs_flrg_fuzzyfied">[docs]</a> <span class="k">def</span> <span class="nf">generate_lhs_flrg_fuzzyfied</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">sample</span><span class="p">,</span> <span class="n">explain</span><span class="o">=</span><span class="kc">False</span><span class="p">):</span>
<span class="n">lags</span> <span class="o">=</span> <span class="p">{}</span>
<span class="n">flrgs</span> <span class="o">=</span> <span class="p">[]</span>
<span class="k">for</span> <span class="n">ct</span><span class="p">,</span> <span class="n">o</span> <span class="ow">in</span> <span class="nb">enumerate</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">lags</span><span class="p">):</span>
<span class="n">lags</span><span class="p">[</span><span class="n">ct</span><span class="p">]</span> <span class="o">=</span> <span class="n">sample</span><span class="p">[</span><span class="n">o</span><span class="o">-</span><span class="mi">1</span><span class="p">]</span>
<span class="k">if</span> <span class="n">explain</span><span class="p">:</span>
<span class="nb">print</span><span class="p">(</span><span class="s2">&quot;</span><span class="se">\t</span><span class="s2"> (Lag </span><span class="si">{}</span><span class="s2">) </span><span class="si">{}</span><span class="s2"> -&gt; </span><span class="si">{}</span><span class="s2"> </span><span class="se">\n</span><span class="s2">&quot;</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">o</span><span class="p">,</span> <span class="n">sample</span><span class="p">[</span><span class="n">o</span><span class="o">-</span><span class="mi">1</span><span class="p">],</span> <span class="n">lhs</span><span class="p">))</span>
<span class="n">root</span> <span class="o">=</span> <span class="n">tree</span><span class="o">.</span><span class="n">FLRGTreeNode</span><span class="p">(</span><span class="kc">None</span><span class="p">)</span>
<span class="n">tree</span><span class="o">.</span><span class="n">build_tree_without_order</span><span class="p">(</span><span class="n">root</span><span class="p">,</span> <span class="n">lags</span><span class="p">,</span> <span class="mi">0</span><span class="p">)</span>
<span class="c1"># Trace the possible paths</span>
<span class="k">for</span> <span class="n">p</span> <span class="ow">in</span> <span class="n">root</span><span class="o">.</span><span class="n">paths</span><span class="p">():</span>
<span class="n">flrg</span> <span class="o">=</span> <span class="n">WeightedHighOrderFLRG</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">order</span><span class="p">)</span>
<span class="n">path</span> <span class="o">=</span> <span class="nb">list</span><span class="p">(</span><span class="nb">reversed</span><span class="p">(</span><span class="nb">list</span><span class="p">(</span><span class="nb">filter</span><span class="p">(</span><span class="kc">None</span><span class="o">.</span><span class="fm">__ne__</span><span class="p">,</span> <span class="n">p</span><span class="p">))))</span>
<span class="k">for</span> <span class="n">lhs</span> <span class="ow">in</span> <span class="n">path</span><span class="p">:</span>
<span class="n">flrg</span><span class="o">.</span><span class="n">append_lhs</span><span class="p">(</span><span class="n">lhs</span><span class="p">)</span>
<span class="n">flrgs</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">flrg</span><span class="p">)</span>
<span class="k">return</span> <span class="n">flrgs</span></div></div>
</pre></div>
</div>

View File

@ -0,0 +1,183 @@
<!doctype html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="X-UA-Compatible" content="IE=Edge" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-55120145-3']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
<title>pyFTS.models.multivariate.cmvfts &#8212; pyFTS 1.2.3 documentation</title>
<link rel="stylesheet" href="../../../../_static/bizstyle.css" type="text/css" />
<link rel="stylesheet" href="../../../../_static/pygments.css" type="text/css" />
<script type="text/javascript" src="../../../../_static/documentation_options.js"></script>
<script type="text/javascript" src="../../../../_static/jquery.js"></script>
<script type="text/javascript" src="../../../../_static/underscore.js"></script>
<script type="text/javascript" src="../../../../_static/doctools.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
<script type="text/javascript" src="../../../../_static/bizstyle.js"></script>
<link rel="index" title="Index" href="../../../../genindex.html" />
<link rel="search" title="Search" href="../../../../search.html" />
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<!--[if lt IE 9]>
<script type="text/javascript" src="_static/css3-mediaqueries.js"></script>
<![endif]-->
</head><body>
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="../../../../genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="../../../../py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="nav-item nav-item-0"><a href="../../../../index.html">pyFTS 1.2.3 documentation</a> &#187;</li>
<li class="nav-item nav-item-1"><a href="../../../index.html" accesskey="U">Module code</a> &#187;</li>
</ul>
</div>
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebarwrapper">
<p class="logo"><a href="../../../../index.html">
<img class="logo" src="../../../../_static/logo_heading2.png" alt="Logo"/>
</a></p>
<div id="searchbox" style="display: none" role="search">
<h3>Quick search</h3>
<div class="searchformwrapper">
<form class="search" action="../../../../search.html" method="get">
<input type="text" name="q" />
<input type="submit" value="Go" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
</div>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<h1>Source code for pyFTS.models.multivariate.cmvfts</h1><div class="highlight"><pre>
<span></span>
<span class="kn">import</span> <span class="nn">numpy</span> <span class="k">as</span> <span class="nn">np</span>
<span class="kn">from</span> <span class="nn">pyFTS.common</span> <span class="k">import</span> <span class="n">FuzzySet</span><span class="p">,</span> <span class="n">FLR</span><span class="p">,</span> <span class="n">fts</span><span class="p">,</span> <span class="n">flrg</span>
<span class="kn">from</span> <span class="nn">pyFTS.models</span> <span class="k">import</span> <span class="n">hofts</span>
<span class="kn">from</span> <span class="nn">pyFTS.models.multivariate</span> <span class="k">import</span> <span class="n">mvfts</span><span class="p">,</span> <span class="n">grid</span><span class="p">,</span> <span class="n">common</span>
<div class="viewcode-block" id="ClusteredMVFTS"><a class="viewcode-back" href="../../../../pyFTS.models.multivariate.html#pyFTS.models.multivariate.cmvfts.ClusteredMVFTS">[docs]</a><span class="k">class</span> <span class="nc">ClusteredMVFTS</span><span class="p">(</span><span class="n">mvfts</span><span class="o">.</span><span class="n">MVFTS</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Meta model for multivariate, high order, clustered multivariate FTS</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
<span class="nb">super</span><span class="p">(</span><span class="n">ClusteredMVFTS</span><span class="p">,</span> <span class="bp">self</span><span class="p">)</span><span class="o">.</span><span class="fm">__init__</span><span class="p">(</span><span class="o">**</span><span class="n">kwargs</span><span class="p">)</span>
<span class="bp">self</span><span class="o">.</span><span class="n">cluster_method</span> <span class="o">=</span> <span class="n">kwargs</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">&#39;cluster_method&#39;</span><span class="p">,</span> <span class="n">grid</span><span class="o">.</span><span class="n">GridCluster</span><span class="p">)</span>
<span class="sd">&quot;&quot;&quot;The cluster method to be called when a new model is build&quot;&quot;&quot;</span>
<span class="bp">self</span><span class="o">.</span><span class="n">cluster_params</span> <span class="o">=</span> <span class="n">kwargs</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">&#39;cluster_params&#39;</span><span class="p">,</span> <span class="p">{})</span>
<span class="sd">&quot;&quot;&quot;The cluster method parameters&quot;&quot;&quot;</span>
<span class="bp">self</span><span class="o">.</span><span class="n">cluster</span> <span class="o">=</span> <span class="kc">None</span>
<span class="sd">&quot;&quot;&quot;The most recent trained clusterer&quot;&quot;&quot;</span>
<span class="bp">self</span><span class="o">.</span><span class="n">fts_method</span> <span class="o">=</span> <span class="n">kwargs</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">&#39;fts_method&#39;</span><span class="p">,</span> <span class="n">hofts</span><span class="o">.</span><span class="n">WeightedHighOrderFTS</span><span class="p">)</span>
<span class="sd">&quot;&quot;&quot;The FTS method to be called when a new model is build&quot;&quot;&quot;</span>
<span class="bp">self</span><span class="o">.</span><span class="n">fts_params</span> <span class="o">=</span> <span class="n">kwargs</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">&#39;fts_params&#39;</span><span class="p">,</span> <span class="p">{})</span>
<span class="sd">&quot;&quot;&quot;The FTS method specific parameters&quot;&quot;&quot;</span>
<span class="bp">self</span><span class="o">.</span><span class="n">model</span> <span class="o">=</span> <span class="kc">None</span>
<span class="sd">&quot;&quot;&quot;The most recent trained model&quot;&quot;&quot;</span>
<span class="bp">self</span><span class="o">.</span><span class="n">knn</span> <span class="o">=</span> <span class="n">kwargs</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">&#39;knn&#39;</span><span class="p">,</span> <span class="mi">2</span><span class="p">)</span>
<span class="bp">self</span><span class="o">.</span><span class="n">is_high_order</span> <span class="o">=</span> <span class="kc">True</span>
<span class="bp">self</span><span class="o">.</span><span class="n">order</span> <span class="o">=</span> <span class="n">kwargs</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">&quot;order&quot;</span><span class="p">,</span> <span class="mi">2</span><span class="p">)</span>
<span class="bp">self</span><span class="o">.</span><span class="n">lags</span> <span class="o">=</span> <span class="n">kwargs</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">&quot;lags&quot;</span><span class="p">,</span> <span class="kc">None</span><span class="p">)</span>
<span class="bp">self</span><span class="o">.</span><span class="n">alpha_cut</span> <span class="o">=</span> <span class="n">kwargs</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">&#39;alpha_cut&#39;</span><span class="p">,</span> <span class="mf">0.25</span><span class="p">)</span>
<span class="bp">self</span><span class="o">.</span><span class="n">shortname</span> <span class="o">=</span> <span class="s2">&quot;ClusteredMVFTS&quot;</span>
<span class="bp">self</span><span class="o">.</span><span class="n">name</span> <span class="o">=</span> <span class="s2">&quot;Clustered Multivariate FTS&quot;</span>
<div class="viewcode-block" id="ClusteredMVFTS.fuzzyfy"><a class="viewcode-back" href="../../../../pyFTS.models.multivariate.html#pyFTS.models.multivariate.cmvfts.ClusteredMVFTS.fuzzyfy">[docs]</a> <span class="k">def</span> <span class="nf">fuzzyfy</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span><span class="n">data</span><span class="p">):</span>
<span class="n">ndata</span> <span class="o">=</span> <span class="p">[]</span>
<span class="k">for</span> <span class="n">ct</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="nb">len</span><span class="p">(</span><span class="n">data</span><span class="o">.</span><span class="n">index</span><span class="p">)</span><span class="o">+</span><span class="mi">1</span><span class="p">):</span>
<span class="n">ix</span> <span class="o">=</span> <span class="n">data</span><span class="o">.</span><span class="n">index</span><span class="p">[</span><span class="n">ct</span> <span class="o">-</span> <span class="mi">1</span><span class="p">]</span>
<span class="n">data_point</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">format_data</span><span class="p">(</span><span class="n">data</span><span class="o">.</span><span class="n">loc</span><span class="p">[</span><span class="n">ix</span><span class="p">])</span>
<span class="n">ndata</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">common</span><span class="o">.</span><span class="n">fuzzyfy_instance_clustered</span><span class="p">(</span><span class="n">data_point</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">cluster</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">alpha_cut</span><span class="p">))</span>
<span class="k">return</span> <span class="n">ndata</span></div>
<div class="viewcode-block" id="ClusteredMVFTS.train"><a class="viewcode-back" href="../../../../pyFTS.models.multivariate.html#pyFTS.models.multivariate.cmvfts.ClusteredMVFTS.train">[docs]</a> <span class="k">def</span> <span class="nf">train</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">data</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
<span class="bp">self</span><span class="o">.</span><span class="n">cluster</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">cluster_method</span><span class="p">(</span><span class="n">data</span><span class="o">=</span><span class="n">data</span><span class="p">,</span> <span class="n">mvfts</span><span class="o">=</span><span class="bp">self</span><span class="p">,</span> <span class="n">neighbors</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">knn</span><span class="p">)</span>
<span class="bp">self</span><span class="o">.</span><span class="n">model</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">fts_method</span><span class="p">(</span><span class="n">partitioner</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">cluster</span><span class="p">,</span> <span class="o">**</span><span class="bp">self</span><span class="o">.</span><span class="n">fts_params</span><span class="p">)</span>
<span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">model</span><span class="o">.</span><span class="n">is_high_order</span><span class="p">:</span>
<span class="bp">self</span><span class="o">.</span><span class="n">model</span><span class="o">.</span><span class="n">order</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">model</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">fts_method</span><span class="p">(</span><span class="n">partitioner</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">cluster</span><span class="p">,</span>
<span class="n">order</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">order</span><span class="p">,</span> <span class="o">**</span><span class="bp">self</span><span class="o">.</span><span class="n">fts_params</span><span class="p">)</span>
<span class="n">ndata</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">fuzzyfy</span><span class="p">(</span><span class="n">data</span><span class="p">)</span>
<span class="bp">self</span><span class="o">.</span><span class="n">model</span><span class="o">.</span><span class="n">train</span><span class="p">(</span><span class="n">ndata</span><span class="p">,</span> <span class="n">fuzzyfied</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span></div>
<div class="viewcode-block" id="ClusteredMVFTS.forecast"><a class="viewcode-back" href="../../../../pyFTS.models.multivariate.html#pyFTS.models.multivariate.cmvfts.ClusteredMVFTS.forecast">[docs]</a> <span class="k">def</span> <span class="nf">forecast</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">ndata</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
<span class="n">ndata</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">fuzzyfy</span><span class="p">(</span><span class="n">ndata</span><span class="p">)</span>
<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">model</span><span class="o">.</span><span class="n">forecast</span><span class="p">(</span><span class="n">ndata</span><span class="p">,</span> <span class="n">fuzzyfied</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">)</span></div>
<span class="k">def</span> <span class="nf">__str__</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;String representation of the model&quot;&quot;&quot;</span>
<span class="n">tmp</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">model</span><span class="o">.</span><span class="n">shortname</span> <span class="o">+</span> <span class="s2">&quot;:</span><span class="se">\n</span><span class="s2">&quot;</span>
<span class="k">for</span> <span class="n">r</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">model</span><span class="o">.</span><span class="n">flrgs</span><span class="p">:</span>
<span class="n">tmp</span> <span class="o">=</span> <span class="n">tmp</span> <span class="o">+</span> <span class="nb">str</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">model</span><span class="o">.</span><span class="n">flrgs</span><span class="p">[</span><span class="n">r</span><span class="p">])</span> <span class="o">+</span> <span class="s2">&quot;</span><span class="se">\n</span><span class="s2">&quot;</span>
<span class="k">return</span> <span class="n">tmp</span>
<span class="k">def</span> <span class="nf">__len__</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> The length (number of rules) of the model</span>
<span class="sd"> :return: number of rules</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="k">return</span> <span class="nb">len</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">model</span><span class="p">)</span></div>
</pre></div>
</div>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="../../../../genindex.html" title="General Index"
>index</a></li>
<li class="right" >
<a href="../../../../py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="nav-item nav-item-0"><a href="../../../../index.html">pyFTS 1.2.3 documentation</a> &#187;</li>
<li class="nav-item nav-item-1"><a href="../../../index.html" >Module code</a> &#187;</li>
</ul>
</div>
<div class="footer" role="contentinfo">
&#169; Copyright 2018, Machine Intelligence and Data Science Laboratory - UFMG - Brazil.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.7.2.
</div>
</body>
</html>

View File

@ -74,13 +74,56 @@
<h1>Source code for pyFTS.models.multivariate.common</h1><div class="highlight"><pre>
<span></span><span class="kn">import</span> <span class="nn">numpy</span> <span class="k">as</span> <span class="nn">np</span>
<span class="kn">import</span> <span class="nn">pandas</span> <span class="k">as</span> <span class="nn">pd</span>
<span class="kn">from</span> <span class="nn">pyFTS.common</span> <span class="k">import</span> <span class="n">FuzzySet</span>
<span class="kn">from</span> <span class="nn">pyFTS.common</span> <span class="k">import</span> <span class="n">FuzzySet</span><span class="p">,</span> <span class="n">Composite</span>
<div class="viewcode-block" id="MultivariateFuzzySet"><a class="viewcode-back" href="../../../../pyFTS.models.multivariate.html#pyFTS.models.multivariate.common.MultivariateFuzzySet">[docs]</a><span class="k">class</span> <span class="nc">MultivariateFuzzySet</span><span class="p">(</span><span class="n">Composite</span><span class="o">.</span><span class="n">FuzzySet</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Multivariate Composite Fuzzy Set</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">name</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Create an empty composite fuzzy set</span>
<span class="sd"> :param name: fuzzy set name</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="nb">super</span><span class="p">(</span><span class="n">MultivariateFuzzySet</span><span class="p">,</span> <span class="bp">self</span><span class="p">)</span><span class="o">.</span><span class="fm">__init__</span><span class="p">(</span><span class="n">name</span><span class="p">)</span>
<span class="bp">self</span><span class="o">.</span><span class="n">sets</span> <span class="o">=</span> <span class="p">{}</span>
<span class="bp">self</span><span class="o">.</span><span class="n">target_variable</span> <span class="o">=</span> <span class="n">kwargs</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">&#39;target_variable&#39;</span><span class="p">,</span><span class="kc">None</span><span class="p">)</span>
<div class="viewcode-block" id="MultivariateFuzzySet.append_set"><a class="viewcode-back" href="../../../../pyFTS.models.multivariate.html#pyFTS.models.multivariate.common.MultivariateFuzzySet.append_set">[docs]</a> <span class="k">def</span> <span class="nf">append_set</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">variable</span><span class="p">,</span> <span class="nb">set</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Appends a new fuzzy set from a new variable</span>
<span class="sd"> :param variable: an multivariate.variable instance</span>
<span class="sd"> :param set: an common.FuzzySet instance</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="bp">self</span><span class="o">.</span><span class="n">sets</span><span class="p">[</span><span class="n">variable</span><span class="p">]</span> <span class="o">=</span> <span class="nb">set</span>
<span class="k">if</span> <span class="n">variable</span> <span class="o">==</span> <span class="bp">self</span><span class="o">.</span><span class="n">target_variable</span><span class="o">.</span><span class="n">name</span><span class="p">:</span>
<span class="bp">self</span><span class="o">.</span><span class="n">centroid</span> <span class="o">=</span> <span class="nb">set</span><span class="o">.</span><span class="n">centroid</span></div>
<div class="viewcode-block" id="MultivariateFuzzySet.membership"><a class="viewcode-back" href="../../../../pyFTS.models.multivariate.html#pyFTS.models.multivariate.common.MultivariateFuzzySet.membership">[docs]</a> <span class="k">def</span> <span class="nf">membership</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">x</span><span class="p">):</span>
<span class="n">mv</span> <span class="o">=</span> <span class="p">[]</span>
<span class="k">for</span> <span class="n">var</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">sets</span><span class="o">.</span><span class="n">keys</span><span class="p">():</span>
<span class="n">data</span> <span class="o">=</span> <span class="n">x</span><span class="p">[</span><span class="n">var</span><span class="p">]</span>
<span class="n">mv</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">sets</span><span class="p">[</span><span class="n">var</span><span class="p">]</span><span class="o">.</span><span class="n">membership</span><span class="p">(</span><span class="n">data</span><span class="p">))</span>
<span class="k">return</span> <span class="n">np</span><span class="o">.</span><span class="n">nanmin</span><span class="p">(</span><span class="n">mv</span><span class="p">)</span></div></div>
<div class="viewcode-block" id="fuzzyfy_instance"><a class="viewcode-back" href="../../../../pyFTS.models.multivariate.html#pyFTS.models.multivariate.common.fuzzyfy_instance">[docs]</a><span class="k">def</span> <span class="nf">fuzzyfy_instance</span><span class="p">(</span><span class="n">data_point</span><span class="p">,</span> <span class="n">var</span><span class="p">):</span>
<span class="n">fsets</span> <span class="o">=</span> <span class="n">FuzzySet</span><span class="o">.</span><span class="n">fuzzyfy</span><span class="p">(</span><span class="n">data_point</span><span class="p">,</span> <span class="n">var</span><span class="o">.</span><span class="n">partitioner</span><span class="p">,</span> <span class="n">mode</span><span class="o">=</span><span class="s1">&#39;sets&#39;</span><span class="p">,</span> <span class="n">method</span><span class="o">=</span><span class="s1">&#39;fuzzy&#39;</span><span class="p">,</span> <span class="n">alpha_cut</span><span class="o">=</span><span class="n">var</span><span class="o">.</span><span class="n">alpha_cut</span><span class="p">)</span>
<span class="k">return</span> <span class="p">[(</span><span class="n">var</span><span class="o">.</span><span class="n">name</span><span class="p">,</span> <span class="n">fs</span><span class="p">)</span> <span class="k">for</span> <span class="n">fs</span> <span class="ow">in</span> <span class="n">fsets</span><span class="p">]</span></div>
<div class="viewcode-block" id="fuzzyfy_instance_clustered"><a class="viewcode-back" href="../../../../pyFTS.models.multivariate.html#pyFTS.models.multivariate.common.fuzzyfy_instance_clustered">[docs]</a><span class="k">def</span> <span class="nf">fuzzyfy_instance_clustered</span><span class="p">(</span><span class="n">data_point</span><span class="p">,</span> <span class="n">cluster</span><span class="p">,</span> <span class="n">alpha_cut</span><span class="o">=</span><span class="mf">0.0</span><span class="p">):</span>
<span class="n">fsets</span> <span class="o">=</span> <span class="p">[]</span>
<span class="k">for</span> <span class="n">fset</span> <span class="ow">in</span> <span class="n">cluster</span><span class="o">.</span><span class="n">knn</span><span class="p">(</span><span class="n">data_point</span><span class="p">):</span>
<span class="k">if</span> <span class="n">cluster</span><span class="o">.</span><span class="n">sets</span><span class="p">[</span><span class="n">fset</span><span class="p">]</span><span class="o">.</span><span class="n">membership</span><span class="p">(</span><span class="n">data_point</span><span class="p">)</span> <span class="o">&gt;</span> <span class="n">alpha_cut</span><span class="p">:</span>
<span class="n">fsets</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">fset</span><span class="p">)</span>
<span class="k">return</span> <span class="n">fsets</span></div>
</pre></div>

View File

@ -85,7 +85,7 @@
<span class="sd"> Multivariate extension of Chen&#39;s ConventionalFTS method</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
<span class="nb">super</span><span class="p">(</span><span class="n">MVFTS</span><span class="p">,</span> <span class="bp">self</span><span class="p">)</span><span class="o">.</span><span class="fm">__init__</span><span class="p">(</span><span class="n">order</span><span class="o">=</span><span class="mi">1</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">)</span>
<span class="nb">super</span><span class="p">(</span><span class="n">MVFTS</span><span class="p">,</span> <span class="bp">self</span><span class="p">)</span><span class="o">.</span><span class="fm">__init__</span><span class="p">(</span><span class="o">**</span><span class="n">kwargs</span><span class="p">)</span>
<span class="bp">self</span><span class="o">.</span><span class="n">explanatory_variables</span> <span class="o">=</span> <span class="p">[]</span>
<span class="bp">self</span><span class="o">.</span><span class="n">target_variable</span> <span class="o">=</span> <span class="kc">None</span>
<span class="bp">self</span><span class="o">.</span><span class="n">flrgs</span> <span class="o">=</span> <span class="p">{}</span>
@ -187,15 +187,12 @@
<span class="k">for</span> <span class="n">flr</span> <span class="ow">in</span> <span class="n">flrs</span><span class="p">:</span>
<span class="n">flrg</span> <span class="o">=</span> <span class="n">mvflrg</span><span class="o">.</span><span class="n">FLRG</span><span class="p">(</span><span class="n">lhs</span><span class="o">=</span><span class="n">flr</span><span class="o">.</span><span class="n">LHS</span><span class="p">)</span>
<span class="k">if</span> <span class="n">flrg</span><span class="o">.</span><span class="n">get_key</span><span class="p">()</span> <span class="ow">not</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">flrgs</span><span class="p">:</span>
<span class="c1">#print(&#39;hit&#39;)</span>
<span class="n">mvs</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="mf">0.</span><span class="p">)</span>
<span class="n">mps</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="mf">0.</span><span class="p">)</span>
<span class="k">else</span><span class="p">:</span>
<span class="n">mvs</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">flrgs</span><span class="p">[</span><span class="n">flrg</span><span class="o">.</span><span class="n">get_key</span><span class="p">()]</span><span class="o">.</span><span class="n">get_membership</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">format_data</span><span class="p">(</span><span class="n">data_point</span><span class="p">),</span> <span class="bp">self</span><span class="o">.</span><span class="n">explanatory_variables</span><span class="p">))</span>
<span class="n">mps</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">flrgs</span><span class="p">[</span><span class="n">flrg</span><span class="o">.</span><span class="n">get_key</span><span class="p">()]</span><span class="o">.</span><span class="n">get_midpoint</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">target_variable</span><span class="o">.</span><span class="n">partitioner</span><span class="o">.</span><span class="n">sets</span><span class="p">))</span>
<span class="c1">#print(&#39;mv&#39;, mvs)</span>
<span class="c1">#print(&#39;mp&#39;, mps)</span>
<span class="n">mv</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">array</span><span class="p">(</span><span class="n">mvs</span><span class="p">)</span>
<span class="n">mp</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">array</span><span class="p">(</span><span class="n">mps</span><span class="p">)</span>
@ -205,6 +202,44 @@
<span class="n">params</span><span class="o">=</span><span class="n">data</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">target_variable</span><span class="o">.</span><span class="n">data_label</span><span class="p">]</span><span class="o">.</span><span class="n">values</span><span class="p">)</span>
<span class="k">return</span> <span class="n">ret</span></div>
<div class="viewcode-block" id="MVFTS.forecast_ahead"><a class="viewcode-back" href="../../../../pyFTS.models.multivariate.html#pyFTS.models.multivariate.mvfts.MVFTS.forecast_ahead">[docs]</a> <span class="k">def</span> <span class="nf">forecast_ahead</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">data</span><span class="p">,</span> <span class="n">steps</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
<span class="n">generators</span> <span class="o">=</span> <span class="n">kwargs</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">&#39;generators&#39;</span><span class="p">,</span><span class="kc">None</span><span class="p">)</span>
<span class="n">start</span> <span class="o">=</span> <span class="n">kwargs</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">&#39;start&#39;</span><span class="p">,</span> <span class="mi">0</span><span class="p">)</span>
<span class="k">if</span> <span class="n">generators</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span>
<span class="k">raise</span> <span class="ne">Exception</span><span class="p">(</span><span class="s1">&#39;You must provide parameter </span><span class="se">\&#39;</span><span class="s1">generators</span><span class="se">\&#39;</span><span class="s1">! generators is a dict where the keys&#39;</span> <span class="o">+</span>
<span class="s1">&#39; are the variables names (except the target_variable) and the values are &#39;</span> <span class="o">+</span>
<span class="s1">&#39;lambda functions that accept one value (the actual value of the variable) &#39;</span>
<span class="s1">&#39; and return the next value.&#39;</span><span class="p">)</span>
<span class="n">ndata</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">apply_transformations</span><span class="p">(</span><span class="n">data</span><span class="p">)</span>
<span class="n">ret</span> <span class="o">=</span> <span class="p">[]</span>
<span class="k">for</span> <span class="n">k</span> <span class="ow">in</span> <span class="n">np</span><span class="o">.</span><span class="n">arange</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="n">steps</span><span class="p">):</span>
<span class="n">ix</span> <span class="o">=</span> <span class="n">ndata</span><span class="o">.</span><span class="n">index</span><span class="p">[</span><span class="o">-</span><span class="bp">self</span><span class="o">.</span><span class="n">max_lag</span><span class="p">:]</span>
<span class="n">sample</span> <span class="o">=</span> <span class="n">ndata</span><span class="o">.</span><span class="n">loc</span><span class="p">[</span><span class="n">ix</span><span class="p">]</span>
<span class="n">tmp</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">forecast</span><span class="p">(</span><span class="n">sample</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">)</span>
<span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">tmp</span><span class="p">,</span> <span class="p">(</span><span class="nb">list</span><span class="p">,</span> <span class="n">np</span><span class="o">.</span><span class="n">ndarray</span><span class="p">)):</span>
<span class="n">tmp</span> <span class="o">=</span> <span class="n">tmp</span><span class="p">[</span><span class="o">-</span><span class="mi">1</span><span class="p">]</span>
<span class="n">ret</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">tmp</span><span class="p">)</span>
<span class="n">last_data_point</span> <span class="o">=</span> <span class="n">sample</span><span class="o">.</span><span class="n">loc</span><span class="p">[</span><span class="n">sample</span><span class="o">.</span><span class="n">index</span><span class="p">[</span><span class="o">-</span><span class="mi">1</span><span class="p">]]</span>
<span class="n">new_data_point</span> <span class="o">=</span> <span class="p">{}</span>
<span class="k">for</span> <span class="n">var</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">explanatory_variables</span><span class="p">:</span>
<span class="k">if</span> <span class="n">var</span><span class="o">.</span><span class="n">name</span> <span class="o">!=</span> <span class="bp">self</span><span class="o">.</span><span class="n">target_variable</span><span class="o">.</span><span class="n">name</span><span class="p">:</span>
<span class="n">new_data_point</span><span class="p">[</span><span class="n">var</span><span class="o">.</span><span class="n">data_label</span><span class="p">]</span> <span class="o">=</span> <span class="n">generators</span><span class="p">[</span><span class="n">var</span><span class="o">.</span><span class="n">name</span><span class="p">](</span><span class="n">last_data_point</span><span class="p">[</span><span class="n">var</span><span class="o">.</span><span class="n">data_label</span><span class="p">])</span>
<span class="n">new_data_point</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">target_variable</span><span class="o">.</span><span class="n">data_label</span><span class="p">]</span> <span class="o">=</span> <span class="n">tmp</span>
<span class="n">ndata</span> <span class="o">=</span> <span class="n">ndata</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">new_data_point</span><span class="p">,</span> <span class="n">ignore_index</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
<span class="k">return</span> <span class="n">ret</span></div>
<div class="viewcode-block" id="MVFTS.clone_parameters"><a class="viewcode-back" href="../../../../pyFTS.models.multivariate.html#pyFTS.models.multivariate.mvfts.MVFTS.clone_parameters">[docs]</a> <span class="k">def</span> <span class="nf">clone_parameters</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">model</span><span class="p">):</span>
<span class="nb">super</span><span class="p">(</span><span class="n">MVFTS</span><span class="p">,</span> <span class="bp">self</span><span class="p">)</span><span class="o">.</span><span class="n">clone_parameters</span><span class="p">(</span><span class="n">model</span><span class="p">)</span>

View File

@ -0,0 +1,168 @@
<!doctype html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="X-UA-Compatible" content="IE=Edge" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-55120145-3']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
<title>pyFTS.models.multivariate.wmvfts &#8212; pyFTS 1.2.3 documentation</title>
<link rel="stylesheet" href="../../../../_static/bizstyle.css" type="text/css" />
<link rel="stylesheet" href="../../../../_static/pygments.css" type="text/css" />
<script type="text/javascript" src="../../../../_static/documentation_options.js"></script>
<script type="text/javascript" src="../../../../_static/jquery.js"></script>
<script type="text/javascript" src="../../../../_static/underscore.js"></script>
<script type="text/javascript" src="../../../../_static/doctools.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
<script type="text/javascript" src="../../../../_static/bizstyle.js"></script>
<link rel="index" title="Index" href="../../../../genindex.html" />
<link rel="search" title="Search" href="../../../../search.html" />
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<!--[if lt IE 9]>
<script type="text/javascript" src="_static/css3-mediaqueries.js"></script>
<![endif]-->
</head><body>
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="../../../../genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="../../../../py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="nav-item nav-item-0"><a href="../../../../index.html">pyFTS 1.2.3 documentation</a> &#187;</li>
<li class="nav-item nav-item-1"><a href="../../../index.html" accesskey="U">Module code</a> &#187;</li>
</ul>
</div>
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebarwrapper">
<p class="logo"><a href="../../../../index.html">
<img class="logo" src="../../../../_static/logo_heading2.png" alt="Logo"/>
</a></p>
<div id="searchbox" style="display: none" role="search">
<h3>Quick search</h3>
<div class="searchformwrapper">
<form class="search" action="../../../../search.html" method="get">
<input type="text" name="q" />
<input type="submit" value="Go" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
</div>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<h1>Source code for pyFTS.models.multivariate.wmvfts</h1><div class="highlight"><pre>
<span></span><span class="kn">from</span> <span class="nn">pyFTS.common</span> <span class="k">import</span> <span class="n">fts</span><span class="p">,</span> <span class="n">FuzzySet</span><span class="p">,</span> <span class="n">FLR</span><span class="p">,</span> <span class="n">Membership</span><span class="p">,</span> <span class="n">tree</span>
<span class="kn">from</span> <span class="nn">pyFTS.partitioners</span> <span class="k">import</span> <span class="n">Grid</span>
<span class="kn">from</span> <span class="nn">pyFTS.models.multivariate</span> <span class="k">import</span> <span class="n">mvfts</span><span class="p">,</span> <span class="n">FLR</span> <span class="k">as</span> <span class="n">MVFLR</span><span class="p">,</span> <span class="n">common</span><span class="p">,</span> <span class="n">flrg</span> <span class="k">as</span> <span class="n">mvflrg</span>
<span class="kn">import</span> <span class="nn">numpy</span> <span class="k">as</span> <span class="nn">np</span>
<span class="kn">import</span> <span class="nn">pandas</span> <span class="k">as</span> <span class="nn">pd</span>
<div class="viewcode-block" id="WeightedFLRG"><a class="viewcode-back" href="../../../../pyFTS.models.multivariate.html#pyFTS.models.multivariate.wmvfts.WeightedFLRG">[docs]</a><span class="k">class</span> <span class="nc">WeightedFLRG</span><span class="p">(</span><span class="n">mvflrg</span><span class="o">.</span><span class="n">FLRG</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Weighted Multivariate Fuzzy Logical Rule Group</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
<span class="nb">super</span><span class="p">(</span><span class="n">WeightedFLRG</span><span class="p">,</span> <span class="bp">self</span><span class="p">)</span><span class="o">.</span><span class="fm">__init__</span><span class="p">(</span><span class="o">**</span><span class="n">kwargs</span><span class="p">)</span>
<span class="bp">self</span><span class="o">.</span><span class="n">order</span> <span class="o">=</span> <span class="n">kwargs</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">&#39;order&#39;</span><span class="p">,</span> <span class="mi">1</span><span class="p">)</span>
<span class="bp">self</span><span class="o">.</span><span class="n">LHS</span> <span class="o">=</span> <span class="n">kwargs</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">&#39;lhs&#39;</span><span class="p">,</span> <span class="p">{})</span>
<span class="bp">self</span><span class="o">.</span><span class="n">RHS</span> <span class="o">=</span> <span class="p">{}</span>
<span class="bp">self</span><span class="o">.</span><span class="n">count</span> <span class="o">=</span> <span class="mf">0.0</span>
<span class="bp">self</span><span class="o">.</span><span class="n">w</span> <span class="o">=</span> <span class="kc">None</span>
<div class="viewcode-block" id="WeightedFLRG.append_rhs"><a class="viewcode-back" href="../../../../pyFTS.models.multivariate.html#pyFTS.models.multivariate.wmvfts.WeightedFLRG.append_rhs">[docs]</a> <span class="k">def</span> <span class="nf">append_rhs</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">fset</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
<span class="k">if</span> <span class="n">fset</span> <span class="ow">not</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">RHS</span><span class="p">:</span>
<span class="bp">self</span><span class="o">.</span><span class="n">RHS</span><span class="p">[</span><span class="n">fset</span><span class="p">]</span> <span class="o">=</span> <span class="mf">1.0</span>
<span class="k">else</span><span class="p">:</span>
<span class="bp">self</span><span class="o">.</span><span class="n">RHS</span><span class="p">[</span><span class="n">fset</span><span class="p">]</span> <span class="o">+=</span> <span class="mf">1.0</span>
<span class="bp">self</span><span class="o">.</span><span class="n">count</span> <span class="o">+=</span> <span class="mf">1.0</span></div>
<div class="viewcode-block" id="WeightedFLRG.weights"><a class="viewcode-back" href="../../../../pyFTS.models.multivariate.html#pyFTS.models.multivariate.wmvfts.WeightedFLRG.weights">[docs]</a> <span class="k">def</span> <span class="nf">weights</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">w</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span>
<span class="bp">self</span><span class="o">.</span><span class="n">w</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">array</span><span class="p">([</span><span class="bp">self</span><span class="o">.</span><span class="n">RHS</span><span class="p">[</span><span class="n">c</span><span class="p">]</span> <span class="o">/</span> <span class="bp">self</span><span class="o">.</span><span class="n">count</span> <span class="k">for</span> <span class="n">c</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">RHS</span><span class="o">.</span><span class="n">keys</span><span class="p">()])</span>
<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">w</span></div>
<div class="viewcode-block" id="WeightedFLRG.get_midpoint"><a class="viewcode-back" href="../../../../pyFTS.models.multivariate.html#pyFTS.models.multivariate.wmvfts.WeightedFLRG.get_midpoint">[docs]</a> <span class="k">def</span> <span class="nf">get_midpoint</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">sets</span><span class="p">):</span>
<span class="n">mp</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">array</span><span class="p">([</span><span class="n">sets</span><span class="p">[</span><span class="n">c</span><span class="p">]</span><span class="o">.</span><span class="n">centroid</span> <span class="k">for</span> <span class="n">c</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">RHS</span><span class="o">.</span><span class="n">keys</span><span class="p">()])</span>
<span class="k">return</span> <span class="n">mp</span><span class="o">.</span><span class="n">dot</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">weights</span><span class="p">())</span></div>
<span class="k">def</span> <span class="nf">__str__</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="n">_str</span> <span class="o">=</span> <span class="s2">&quot;&quot;</span>
<span class="k">for</span> <span class="n">k</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">RHS</span><span class="o">.</span><span class="n">keys</span><span class="p">():</span>
<span class="n">_str</span> <span class="o">+=</span> <span class="s2">&quot;, &quot;</span> <span class="k">if</span> <span class="nb">len</span><span class="p">(</span><span class="n">_str</span><span class="p">)</span> <span class="o">&gt;</span> <span class="mi">0</span> <span class="k">else</span> <span class="s2">&quot;&quot;</span>
<span class="n">_str</span> <span class="o">+=</span> <span class="n">k</span> <span class="o">+</span> <span class="s2">&quot; (&quot;</span> <span class="o">+</span> <span class="nb">str</span><span class="p">(</span><span class="nb">round</span><span class="p">(</span> <span class="bp">self</span><span class="o">.</span><span class="n">RHS</span><span class="p">[</span><span class="n">k</span><span class="p">]</span> <span class="o">/</span> <span class="bp">self</span><span class="o">.</span><span class="n">count</span><span class="p">,</span> <span class="mi">3</span><span class="p">))</span> <span class="o">+</span> <span class="s2">&quot;)&quot;</span>
<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">get_key</span><span class="p">()</span> <span class="o">+</span> <span class="s2">&quot; -&gt; &quot;</span> <span class="o">+</span> <span class="n">_str</span></div>
<div class="viewcode-block" id="WeightedMVFTS"><a class="viewcode-back" href="../../../../pyFTS.models.multivariate.html#pyFTS.models.multivariate.wmvfts.WeightedMVFTS">[docs]</a><span class="k">class</span> <span class="nc">WeightedMVFTS</span><span class="p">(</span><span class="n">mvfts</span><span class="o">.</span><span class="n">MVFTS</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Weighted Multivariate FTS</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
<span class="nb">super</span><span class="p">(</span><span class="n">WeightedMVFTS</span><span class="p">,</span> <span class="bp">self</span><span class="p">)</span><span class="o">.</span><span class="fm">__init__</span><span class="p">(</span><span class="n">order</span><span class="o">=</span><span class="mi">1</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">)</span>
<span class="bp">self</span><span class="o">.</span><span class="n">explanatory_variables</span> <span class="o">=</span> <span class="p">[]</span>
<span class="bp">self</span><span class="o">.</span><span class="n">target_variable</span> <span class="o">=</span> <span class="kc">None</span>
<span class="bp">self</span><span class="o">.</span><span class="n">flrgs</span> <span class="o">=</span> <span class="p">{}</span>
<span class="bp">self</span><span class="o">.</span><span class="n">is_multivariate</span> <span class="o">=</span> <span class="kc">True</span>
<span class="bp">self</span><span class="o">.</span><span class="n">shortname</span> <span class="o">=</span> <span class="s2">&quot;WeightedMVFTS&quot;</span>
<span class="bp">self</span><span class="o">.</span><span class="n">name</span> <span class="o">=</span> <span class="s2">&quot;Weighted Multivariate FTS&quot;</span>
<div class="viewcode-block" id="WeightedMVFTS.generate_flrg"><a class="viewcode-back" href="../../../../pyFTS.models.multivariate.html#pyFTS.models.multivariate.wmvfts.WeightedMVFTS.generate_flrg">[docs]</a> <span class="k">def</span> <span class="nf">generate_flrg</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">flrs</span><span class="p">):</span>
<span class="k">for</span> <span class="n">flr</span> <span class="ow">in</span> <span class="n">flrs</span><span class="p">:</span>
<span class="n">flrg</span> <span class="o">=</span> <span class="n">WeightedFLRG</span><span class="p">(</span><span class="n">lhs</span><span class="o">=</span><span class="n">flr</span><span class="o">.</span><span class="n">LHS</span><span class="p">)</span>
<span class="k">if</span> <span class="n">flrg</span><span class="o">.</span><span class="n">get_key</span><span class="p">()</span> <span class="ow">not</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">flrgs</span><span class="p">:</span>
<span class="bp">self</span><span class="o">.</span><span class="n">flrgs</span><span class="p">[</span><span class="n">flrg</span><span class="o">.</span><span class="n">get_key</span><span class="p">()]</span> <span class="o">=</span> <span class="n">flrg</span>
<span class="bp">self</span><span class="o">.</span><span class="n">flrgs</span><span class="p">[</span><span class="n">flrg</span><span class="o">.</span><span class="n">get_key</span><span class="p">()]</span><span class="o">.</span><span class="n">append_rhs</span><span class="p">(</span><span class="n">flr</span><span class="o">.</span><span class="n">RHS</span><span class="p">)</span></div></div>
</pre></div>
</div>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="../../../../genindex.html" title="General Index"
>index</a></li>
<li class="right" >
<a href="../../../../py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="nav-item nav-item-0"><a href="../../../../index.html">pyFTS 1.2.3 documentation</a> &#187;</li>
<li class="nav-item nav-item-1"><a href="../../../index.html" >Module code</a> &#187;</li>
</ul>
</div>
<div class="footer" role="contentinfo">
&#169; Copyright 2018, Machine Intelligence and Data Science Laboratory - UFMG - Brazil.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.7.2.
</div>
</body>
</html>

View File

@ -163,10 +163,9 @@
<span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">datepart</span><span class="p">,</span> <span class="n">name</span><span class="p">,</span> <span class="n">mf</span><span class="p">,</span> <span class="n">parameters</span><span class="p">,</span> <span class="n">centroid</span><span class="p">,</span> <span class="n">alpha</span><span class="o">=</span><span class="mf">1.0</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
<span class="nb">super</span><span class="p">(</span><span class="n">FuzzySet</span><span class="p">,</span> <span class="bp">self</span><span class="p">)</span><span class="o">.</span><span class="fm">__init__</span><span class="p">(</span><span class="n">name</span><span class="p">,</span> <span class="n">mf</span><span class="p">,</span> <span class="n">parameters</span><span class="p">,</span> <span class="n">centroid</span><span class="p">,</span> <span class="n">alpha</span><span class="p">,</span>
<span class="nb">type</span><span class="o">=</span><span class="n">kwargs</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">&#39;type&#39;</span><span class="p">,</span> <span class="s1">&#39;seasonal&#39;</span><span class="p">),</span>
<span class="o">**</span><span class="n">kwargs</span><span class="p">)</span>
<span class="bp">self</span><span class="o">.</span><span class="n">datepart</span> <span class="o">=</span> <span class="n">datepart</span>
<span class="bp">self</span><span class="o">.</span><span class="n">type</span> <span class="o">=</span> <span class="s1">&#39;seasonal&#39;</span>
<span class="bp">self</span><span class="o">.</span><span class="n">type</span> <span class="o">=</span> <span class="n">kwargs</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">&#39;type&#39;</span><span class="p">,</span> <span class="s1">&#39;seasonal&#39;</span><span class="p">)</span>
<div class="viewcode-block" id="FuzzySet.transform"><a class="viewcode-back" href="../../../../pyFTS.models.seasonal.html#pyFTS.models.seasonal.common.FuzzySet.transform">[docs]</a> <span class="k">def</span> <span class="nf">transform</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">x</span><span class="p">):</span>
<span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">type</span> <span class="o">==</span> <span class="s1">&#39;seasonal&#39;</span><span class="p">:</span>

View File

@ -104,6 +104,8 @@
<span class="bp">self</span><span class="o">.</span><span class="n">min</span> <span class="o">=</span> <span class="n">tmp</span>
<span class="bp">self</span><span class="o">.</span><span class="n">max</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">season</span><span class="o">.</span><span class="n">value</span> <span class="o">+</span> <span class="n">tmp</span>
<span class="bp">self</span><span class="o">.</span><span class="n">type</span> <span class="o">=</span> <span class="n">kwargs</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">&#39;type&#39;</span><span class="p">,</span><span class="s1">&#39;seasonal&#39;</span><span class="p">)</span>
<span class="bp">self</span><span class="o">.</span><span class="n">sets</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">build</span><span class="p">(</span><span class="kc">None</span><span class="p">)</span>
<span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">ordered_sets</span> <span class="ow">is</span> <span class="kc">None</span> <span class="ow">and</span> <span class="bp">self</span><span class="o">.</span><span class="n">setnames</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span>
@ -114,7 +116,7 @@
<div class="viewcode-block" id="TimeGridPartitioner.build"><a class="viewcode-back" href="../../../../pyFTS.models.seasonal.html#pyFTS.models.seasonal.partitioner.TimeGridPartitioner.build">[docs]</a> <span class="k">def</span> <span class="nf">build</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">data</span><span class="p">):</span>
<span class="n">sets</span> <span class="o">=</span> <span class="p">{}</span>
<span class="n">kwargs</span> <span class="o">=</span> <span class="p">{</span><span class="s1">&#39;variable&#39;</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">variable</span><span class="p">}</span>
<span class="n">kwargs</span> <span class="o">=</span> <span class="p">{</span><span class="s1">&#39;variable&#39;</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">variable</span><span class="p">,</span> <span class="s1">&#39;type&#39;</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">type</span> <span class="p">}</span>
<span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">season</span> <span class="o">==</span> <span class="n">DateTime</span><span class="o">.</span><span class="n">year</span><span class="p">:</span>
<span class="n">dlen</span> <span class="o">=</span> <span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">max</span> <span class="o">-</span> <span class="bp">self</span><span class="o">.</span><span class="n">min</span><span class="p">)</span>
@ -128,7 +130,7 @@
<span class="n">set_name</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">get_name</span><span class="p">(</span><span class="n">count</span><span class="p">)</span>
<span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">membership_function</span> <span class="o">==</span> <span class="n">Membership</span><span class="o">.</span><span class="n">trimf</span><span class="p">:</span>
<span class="k">if</span> <span class="n">c</span> <span class="o">==</span> <span class="bp">self</span><span class="o">.</span><span class="n">min</span><span class="p">:</span>
<span class="n">tmp</span> <span class="o">=</span> <span class="n">Composite</span><span class="p">(</span><span class="n">set_name</span><span class="p">,</span> <span class="n">superset</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
<span class="n">tmp</span> <span class="o">=</span> <span class="n">Composite</span><span class="p">(</span><span class="n">set_name</span><span class="p">,</span> <span class="n">superset</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">)</span>
<span class="n">tmp</span><span class="o">.</span><span class="n">append_set</span><span class="p">(</span><span class="n">FuzzySet</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">season</span><span class="p">,</span> <span class="n">set_name</span><span class="p">,</span> <span class="n">Membership</span><span class="o">.</span><span class="n">trimf</span><span class="p">,</span>
<span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">season</span><span class="o">.</span><span class="n">value</span> <span class="o">-</span> <span class="n">pl2</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">season</span><span class="o">.</span><span class="n">value</span><span class="p">,</span>
<span class="bp">self</span><span class="o">.</span><span class="n">season</span><span class="o">.</span><span class="n">value</span> <span class="o">+</span> <span class="mf">0.0000001</span><span class="p">],</span> <span class="bp">self</span><span class="o">.</span><span class="n">season</span><span class="o">.</span><span class="n">value</span><span class="p">,</span> <span class="n">alpha</span><span class="o">=.</span><span class="mi">5</span><span class="p">,</span>
@ -139,7 +141,7 @@
<span class="n">tmp</span><span class="o">.</span><span class="n">centroid</span> <span class="o">=</span> <span class="n">c</span>
<span class="n">sets</span><span class="p">[</span><span class="n">set_name</span><span class="p">]</span> <span class="o">=</span> <span class="n">tmp</span>
<span class="k">elif</span> <span class="n">c</span> <span class="o">==</span> <span class="bp">self</span><span class="o">.</span><span class="n">max</span> <span class="o">-</span> <span class="n">partlen</span><span class="p">:</span>
<span class="n">tmp</span> <span class="o">=</span> <span class="n">Composite</span><span class="p">(</span><span class="n">set_name</span><span class="p">,</span> <span class="n">superset</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
<span class="n">tmp</span> <span class="o">=</span> <span class="n">Composite</span><span class="p">(</span><span class="n">set_name</span><span class="p">,</span> <span class="n">superset</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">)</span>
<span class="n">tmp</span><span class="o">.</span><span class="n">append_set</span><span class="p">(</span><span class="n">FuzzySet</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">season</span><span class="p">,</span> <span class="n">set_name</span><span class="p">,</span> <span class="n">Membership</span><span class="o">.</span><span class="n">trimf</span><span class="p">,</span>
<span class="p">[</span><span class="mf">0.0000001</span><span class="p">,</span> <span class="mf">0.0</span><span class="p">,</span>
<span class="n">pl2</span><span class="p">],</span> <span class="mf">0.0</span><span class="p">,</span> <span class="n">alpha</span><span class="o">=.</span><span class="mi">5</span><span class="p">,</span>

View File

@ -114,7 +114,7 @@
<div class="viewcode-block" id="bestSplit"><a class="viewcode-back" href="../../../pyFTS.partitioners.html#pyFTS.partitioners.Entropy.bestSplit">[docs]</a><span class="k">def</span> <span class="nf">bestSplit</span><span class="p">(</span><span class="n">data</span><span class="p">,</span> <span class="n">npart</span><span class="p">):</span>
<span class="k">if</span> <span class="nb">len</span><span class="p">(</span><span class="n">data</span><span class="p">)</span> <span class="o">&lt;</span> <span class="mi">2</span><span class="p">:</span>
<span class="k">return</span> <span class="kc">None</span>
<span class="k">return</span> <span class="p">[]</span>
<span class="n">count</span> <span class="o">=</span> <span class="mi">1</span>
<span class="n">ndata</span> <span class="o">=</span> <span class="nb">list</span><span class="p">(</span><span class="nb">set</span><span class="p">(</span><span class="n">np</span><span class="o">.</span><span class="n">array</span><span class="p">(</span><span class="n">data</span><span class="p">)</span><span class="o">.</span><span class="n">flatten</span><span class="p">()))</span>
<span class="n">ndata</span><span class="o">.</span><span class="n">sort</span><span class="p">()</span>

View File

@ -101,7 +101,9 @@
<span class="sd">&quot;&quot;&quot;data transformation to be applied on data&quot;&quot;&quot;</span>
<span class="bp">self</span><span class="o">.</span><span class="n">indexer</span> <span class="o">=</span> <span class="n">kwargs</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">&#39;indexer&#39;</span><span class="p">,</span> <span class="kc">None</span><span class="p">)</span>
<span class="bp">self</span><span class="o">.</span><span class="n">variable</span> <span class="o">=</span> <span class="n">kwargs</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">&#39;variable&#39;</span><span class="p">,</span> <span class="kc">None</span><span class="p">)</span>
<span class="sd">&quot;&quot;&quot;In a multivariate context, the variable that contains this partitioner&quot;&quot;&quot;</span>
<span class="bp">self</span><span class="o">.</span><span class="n">type</span> <span class="o">=</span> <span class="n">kwargs</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">&#39;type&#39;</span><span class="p">,</span> <span class="s1">&#39;common&#39;</span><span class="p">)</span>
<span class="sd">&quot;&quot;&quot;The type of fuzzy sets that are generated by this partitioner&quot;&quot;&quot;</span>
<span class="bp">self</span><span class="o">.</span><span class="n">ordered_sets</span> <span class="o">=</span> <span class="kc">None</span>
<span class="k">if</span> <span class="n">kwargs</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">&#39;preprocess&#39;</span><span class="p">,</span><span class="kc">True</span><span class="p">):</span>

View File

@ -0,0 +1,31 @@
pyFTS.hyperparam package
========================
Module contents
---------------
.. automodule:: pyFTS.hyperparam
:members:
:undoc-members:
:show-inheritance:
Submodules
----------
pyFTS.hyperparam.Util module
-----------------------------
.. automodule:: pyFTS.hyperparam.Util
:members:
:undoc-members:
:show-inheritance:
pyFTS.hyperparam.GridSearch module
----------------------------------
.. automodule:: pyFTS.hyperparam.GridSearch
:members:
:undoc-members:
:show-inheritance:

View File

@ -29,6 +29,14 @@ pyFTS.models.multivariate.common module
:undoc-members:
:show-inheritance:
pyFTS.models.multivariate.variable module
-----------------------------------------
.. automodule:: pyFTS.models.multivariate.variable
:members:
:undoc-members:
:show-inheritance:
pyFTS.models.multivariate.flrg module
-------------------------------------
@ -44,19 +52,19 @@ pyFTS.models.multivariate.mvfts module
:members:
:undoc-members:
:show-inheritance:
pyFTS.models.multivariate.wmvfts module
---------------------------------------
pyFTS.models.multivariate.variable module
-----------------------------------------
.. automodule:: pyFTS.models.multivariate.variable
.. automodule:: pyFTS.models.multivariate.wmvfts
:members:
:undoc-members:
:show-inheritance:
pyFTS.models.multivariate.wmvfts module
--------------------------------------
pyFTS.models.multivariate.cmvfts module
---------------------------------------
.. automodule:: pyFTS.models.multivariate.mvfts
.. automodule:: pyFTS.models.multivariate.cmvfts
:members:
:undoc-members:
:show-inheritance:

View File

@ -61,7 +61,7 @@ pyFTS.partitioners.Huarng module
:show-inheritance:
pyFTS.partitioners.Singleton module
--------------------------------
-----------------------------------
.. automodule:: pyFTS.partitioners.Singleton
:members:

View File

@ -9,6 +9,7 @@ Subpackages
pyFTS.benchmarks
pyFTS.common
pyFTS.data
pyFTS.hyperparam
pyFTS.models
pyFTS.partitioners
pyFTS.probabilistic

View File

@ -139,6 +139,8 @@
<li><a href="pyFTS.models.html#pyFTS.models.hofts.HighOrderFLRG.append_lhs">append_lhs() (pyFTS.models.hofts.HighOrderFLRG method)</a>
<ul>
<li><a href="pyFTS.models.html#pyFTS.models.hofts.WeightedHighOrderFLRG.append_lhs">(pyFTS.models.hofts.WeightedHighOrderFLRG method)</a>
</li>
<li><a href="pyFTS.models.nonstationary.html#pyFTS.models.nonstationary.cvfts.HighOrderNonstationaryFLRG.append_lhs">(pyFTS.models.nonstationary.cvfts.HighOrderNonstationaryFLRG method)</a>
</li>
<li><a href="pyFTS.models.nonstationary.html#pyFTS.models.nonstationary.honsfts.HighOrderNonStationaryFLRG.append_lhs">(pyFTS.models.nonstationary.honsfts.HighOrderNonStationaryFLRG method)</a>
@ -152,10 +154,14 @@
<li><a href="pyFTS.models.html#pyFTS.models.chen.ConventionalFLRG.append_rhs">(pyFTS.models.chen.ConventionalFLRG method)</a>
</li>
<li><a href="pyFTS.models.html#pyFTS.models.hofts.HighOrderFLRG.append_rhs">(pyFTS.models.hofts.HighOrderFLRG method)</a>
</li>
<li><a href="pyFTS.models.html#pyFTS.models.hofts.WeightedHighOrderFLRG.append_rhs">(pyFTS.models.hofts.WeightedHighOrderFLRG method)</a>
</li>
<li><a href="pyFTS.models.html#pyFTS.models.ismailefendi.ImprovedWeightedFLRG.append_rhs">(pyFTS.models.ismailefendi.ImprovedWeightedFLRG method)</a>
</li>
<li><a href="pyFTS.models.multivariate.html#pyFTS.models.multivariate.flrg.FLRG.append_rhs">(pyFTS.models.multivariate.flrg.FLRG method)</a>
</li>
<li><a href="pyFTS.models.multivariate.html#pyFTS.models.multivariate.wmvfts.WeightedFLRG.append_rhs">(pyFTS.models.multivariate.wmvfts.WeightedFLRG method)</a>
</li>
<li><a href="pyFTS.models.nonstationary.html#pyFTS.models.nonstationary.cvfts.HighOrderNonstationaryFLRG.append_rhs">(pyFTS.models.nonstationary.cvfts.HighOrderNonstationaryFLRG method)</a>
</li>
@ -177,10 +183,14 @@
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="pyFTS.common.html#pyFTS.common.Composite.FuzzySet.append_set">append_set() (pyFTS.common.Composite.FuzzySet method)</a>
<ul>
<li><a href="pyFTS.models.multivariate.html#pyFTS.models.multivariate.common.MultivariateFuzzySet.append_set">(pyFTS.models.multivariate.common.MultivariateFuzzySet method)</a>
</li>
</ul></li>
<li><a href="pyFTS.common.html#pyFTS.common.fts.FTS.append_transformation">append_transformation() (pyFTS.common.fts.FTS method)</a>
</li>
<li><a href="pyFTS.models.multivariate.html#pyFTS.models.multivariate.mvfts.MVFTS.append_variable">append_variable() (pyFTS.models.multivariate.mvfts.MVFTS method)</a>, <a href="pyFTS.models.multivariate.html#pyFTS.models.multivariate.mvfts.MVFTS.append_variable">[1]</a>
<li><a href="pyFTS.models.multivariate.html#pyFTS.models.multivariate.mvfts.MVFTS.append_variable">append_variable() (pyFTS.models.multivariate.mvfts.MVFTS method)</a>
</li>
<li><a href="pyFTS.common.html#pyFTS.common.tree.FLRGTreeNode.appendChild">appendChild() (pyFTS.common.tree.FLRGTreeNode method)</a>
</li>
@ -205,7 +215,7 @@
<li><a href="pyFTS.common.html#pyFTS.common.fts.FTS.apply_transformations">apply_transformations() (pyFTS.common.fts.FTS method)</a>
<ul>
<li><a href="pyFTS.models.multivariate.html#pyFTS.models.multivariate.mvfts.MVFTS.apply_transformations">(pyFTS.models.multivariate.mvfts.MVFTS method)</a>, <a href="pyFTS.models.multivariate.html#pyFTS.models.multivariate.mvfts.MVFTS.apply_transformations">[1]</a>
<li><a href="pyFTS.models.multivariate.html#pyFTS.models.multivariate.mvfts.MVFTS.apply_transformations">(pyFTS.models.multivariate.mvfts.MVFTS method)</a>
</li>
<li><a href="pyFTS.models.multivariate.html#pyFTS.models.multivariate.variable.Variable.apply_transformations">(pyFTS.models.multivariate.variable.Variable method)</a>
</li>
@ -323,17 +333,25 @@
<li><a href="pyFTS.common.html#pyFTS.common.fts.FTS.clone_parameters">clone_parameters() (pyFTS.common.fts.FTS method)</a>
<ul>
<li><a href="pyFTS.models.multivariate.html#pyFTS.models.multivariate.mvfts.MVFTS.clone_parameters">(pyFTS.models.multivariate.mvfts.MVFTS method)</a>, <a href="pyFTS.models.multivariate.html#pyFTS.models.multivariate.mvfts.MVFTS.clone_parameters">[1]</a>
<li><a href="pyFTS.models.multivariate.html#pyFTS.models.multivariate.mvfts.MVFTS.clone_parameters">(pyFTS.models.multivariate.mvfts.MVFTS method)</a>
</li>
</ul></li>
<li><a href="pyFTS.models.multivariate.html#pyFTS.models.multivariate.cmvfts.ClusteredMVFTS.cluster">cluster (pyFTS.models.multivariate.cmvfts.ClusteredMVFTS attribute)</a>
</li>
<li><a href="pyFTS.models.multivariate.html#pyFTS.models.multivariate.cmvfts.ClusteredMVFTS.cluster_method">cluster_method (pyFTS.models.multivariate.cmvfts.ClusteredMVFTS attribute)</a>
</li>
<li><a href="pyFTS.models.multivariate.html#pyFTS.models.multivariate.cmvfts.ClusteredMVFTS.cluster_params">cluster_params (pyFTS.models.multivariate.cmvfts.ClusteredMVFTS attribute)</a>
</li>
<li><a href="pyFTS.models.multivariate.html#pyFTS.models.multivariate.cmvfts.ClusteredMVFTS">ClusteredMVFTS (class in pyFTS.models.multivariate.cmvfts)</a>
</li>
<li><a href="pyFTS.partitioners.html#pyFTS.partitioners.CMeans.CMeansPartitioner">CMeansPartitioner (class in pyFTS.partitioners.CMeans)</a>
</li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="pyFTS.benchmarks.html#pyFTS.benchmarks.ResidualAnalysis.compare_residuals">compare_residuals() (in module pyFTS.benchmarks.ResidualAnalysis)</a>
</li>
<li><a href="pyFTS.benchmarks.html#pyFTS.benchmarks.benchmarks.compareModelsPlot">compareModelsPlot() (in module pyFTS.benchmarks.benchmarks)</a>
</li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="pyFTS.benchmarks.html#pyFTS.benchmarks.benchmarks.compareModelsTable">compareModelsTable() (in module pyFTS.benchmarks.benchmarks)</a>
</li>
<li><a href="pyFTS.models.nonstationary.html#pyFTS.models.nonstationary.nsfts.NonStationaryFTS.conditional_perturbation_factors">conditional_perturbation_factors() (pyFTS.models.nonstationary.nsfts.NonStationaryFTS method)</a>
@ -367,6 +385,8 @@
<li><a href="pyFTS.benchmarks.html#pyFTS.benchmarks.Measures.coverage">coverage() (in module pyFTS.benchmarks.Measures)</a>
</li>
<li><a href="pyFTS.benchmarks.html#pyFTS.benchmarks.Util.create_benchmark_tables">create_benchmark_tables() (in module pyFTS.benchmarks.Util)</a>
</li>
<li><a href="pyFTS.hyperparam.html#pyFTS.hyperparam.Util.create_hyperparam_tables">create_hyperparam_tables() (in module pyFTS.hyperparam.Util)</a>
</li>
<li><a href="pyFTS.probabilistic.html#pyFTS.probabilistic.ProbabilityDistribution.ProbabilityDistribution.crossentropy">crossentropy() (pyFTS.probabilistic.ProbabilityDistribution.ProbabilityDistribution method)</a>
</li>
@ -396,11 +416,13 @@
</li>
<li><a href="pyFTS.models.seasonal.html#pyFTS.models.seasonal.common.DateTime.day_of_year">day_of_year (pyFTS.models.seasonal.common.DateTime attribute)</a>
</li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="pyFTS.probabilistic.html#pyFTS.probabilistic.ProbabilityDistribution.ProbabilityDistribution.density">density() (pyFTS.probabilistic.ProbabilityDistribution.ProbabilityDistribution method)</a>
</li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="pyFTS.common.html#pyFTS.common.fts.FTS.detail">detail (pyFTS.common.fts.FTS attribute)</a>
</li>
<li><a href="pyFTS.hyperparam.html#pyFTS.hyperparam.GridSearch.dict_individual">dict_individual() (in module pyFTS.hyperparam.GridSearch)</a>
</li>
<li><a href="pyFTS.common.html#pyFTS.common.Transformations.Differential">Differential (class in pyFTS.common.Transformations)</a>
</li>
@ -433,6 +455,8 @@
<li><a href="pyFTS.partitioners.html#pyFTS.partitioners.Entropy.EntropyPartitioner">EntropyPartitioner (class in pyFTS.partitioners.Entropy)</a>
</li>
<li><a href="pyFTS.common.html#pyFTS.common.Util.enumerate2">enumerate2() (in module pyFTS.common.Util)</a>
</li>
<li><a href="pyFTS.hyperparam.html#pyFTS.hyperparam.GridSearch.execute">execute() (in module pyFTS.hyperparam.GridSearch)</a>
</li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
@ -523,7 +547,9 @@
</li>
<li><a href="pyFTS.models.html#pyFTS.models.ismailefendi.ImprovedWeightedFTS.forecast">(pyFTS.models.ismailefendi.ImprovedWeightedFTS method)</a>
</li>
<li><a href="pyFTS.models.multivariate.html#pyFTS.models.multivariate.mvfts.MVFTS.forecast">(pyFTS.models.multivariate.mvfts.MVFTS method)</a>, <a href="pyFTS.models.multivariate.html#pyFTS.models.multivariate.mvfts.MVFTS.forecast">[1]</a>
<li><a href="pyFTS.models.multivariate.html#pyFTS.models.multivariate.cmvfts.ClusteredMVFTS.forecast">(pyFTS.models.multivariate.cmvfts.ClusteredMVFTS method)</a>
</li>
<li><a href="pyFTS.models.multivariate.html#pyFTS.models.multivariate.mvfts.MVFTS.forecast">(pyFTS.models.multivariate.mvfts.MVFTS method)</a>
</li>
<li><a href="pyFTS.models.nonstationary.html#pyFTS.models.nonstationary.cvfts.ConditionalVarianceFTS.forecast">(pyFTS.models.nonstationary.cvfts.ConditionalVarianceFTS method)</a>
</li>
@ -549,6 +575,8 @@
<li><a href="pyFTS.common.html#pyFTS.common.fts.FTS.forecast_ahead">forecast_ahead() (pyFTS.common.fts.FTS method)</a>
<ul>
<li><a href="pyFTS.models.multivariate.html#pyFTS.models.multivariate.mvfts.MVFTS.forecast_ahead">(pyFTS.models.multivariate.mvfts.MVFTS method)</a>
</li>
<li><a href="pyFTS.models.html#pyFTS.models.pwfts.ProbabilisticWeightedFTS.forecast_ahead">(pyFTS.models.pwfts.ProbabilisticWeightedFTS method)</a>
</li>
<li><a href="pyFTS.models.seasonal.html#pyFTS.models.seasonal.cmsfts.ContextualMultiSeasonalFTS.forecast_ahead">(pyFTS.models.seasonal.cmsfts.ContextualMultiSeasonalFTS method)</a>
@ -556,8 +584,6 @@
<li><a href="pyFTS.models.seasonal.html#pyFTS.models.seasonal.msfts.MultiSeasonalFTS.forecast_ahead">(pyFTS.models.seasonal.msfts.MultiSeasonalFTS method)</a>
</li>
</ul></li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="pyFTS.benchmarks.html#pyFTS.benchmarks.arima.ARIMA.forecast_ahead_distribution">forecast_ahead_distribution() (pyFTS.benchmarks.arima.ARIMA method)</a>
<ul>
@ -570,6 +596,8 @@
<li><a href="pyFTS.models.html#pyFTS.models.pwfts.ProbabilisticWeightedFTS.forecast_ahead_distribution">(pyFTS.models.pwfts.ProbabilisticWeightedFTS method)</a>
</li>
</ul></li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="pyFTS.benchmarks.html#pyFTS.benchmarks.arima.ARIMA.forecast_ahead_interval">forecast_ahead_interval() (pyFTS.benchmarks.arima.ARIMA method)</a>
<ul>
@ -618,14 +646,22 @@
<li><a href="pyFTS.models.html#pyFTS.models.pwfts.ProbabilisticWeightedFTS.forecast_interval">(pyFTS.models.pwfts.ProbabilisticWeightedFTS method)</a>
</li>
</ul></li>
<li><a href="pyFTS.models.multivariate.html#pyFTS.models.multivariate.mvfts.MVFTS.format_data">format_data() (pyFTS.models.multivariate.mvfts.MVFTS method)</a>, <a href="pyFTS.models.multivariate.html#pyFTS.models.multivariate.mvfts.MVFTS.format_data">[1]</a>
<li><a href="pyFTS.models.multivariate.html#pyFTS.models.multivariate.mvfts.MVFTS.format_data">format_data() (pyFTS.models.multivariate.mvfts.MVFTS method)</a>
</li>
<li><a href="pyFTS.common.html#pyFTS.common.fts.FTS">FTS (class in pyFTS.common.fts)</a>
</li>
<li><a href="pyFTS.models.incremental.html#pyFTS.models.incremental.Retrainer.Retrainer.fts_method">fts_method (pyFTS.models.incremental.Retrainer.Retrainer attribute)</a>
<ul>
<li><a href="pyFTS.models.multivariate.html#pyFTS.models.multivariate.cmvfts.ClusteredMVFTS.fts_method">(pyFTS.models.multivariate.cmvfts.ClusteredMVFTS attribute)</a>
</li>
</ul></li>
<li><a href="pyFTS.models.incremental.html#pyFTS.models.incremental.Retrainer.Retrainer.fts_params">fts_params (pyFTS.models.incremental.Retrainer.Retrainer attribute)</a>
<ul>
<li><a href="pyFTS.models.multivariate.html#pyFTS.models.multivariate.cmvfts.ClusteredMVFTS.fts_params">(pyFTS.models.multivariate.cmvfts.ClusteredMVFTS attribute)</a>
</li>
</ul></li>
<li><a href="pyFTS.models.nonstationary.html#pyFTS.models.nonstationary.common.fuzzify">fuzzify() (in module pyFTS.models.nonstationary.common)</a>
</li>
<li><a href="pyFTS.common.html#pyFTS.common.fts.FTS.fuzzy">fuzzy() (pyFTS.common.fts.FTS method)</a>
@ -635,13 +671,19 @@
<li><a href="pyFTS.partitioners.html#pyFTS.partitioners.FCM.fuzzy_distance">fuzzy_distance() (in module pyFTS.partitioners.FCM)</a>
</li>
<li><a href="pyFTS.common.html#pyFTS.common.FuzzySet.fuzzyfy">fuzzyfy() (in module pyFTS.common.FuzzySet)</a>
<ul>
<li><a href="pyFTS.models.multivariate.html#pyFTS.models.multivariate.cmvfts.ClusteredMVFTS.fuzzyfy">(pyFTS.models.multivariate.cmvfts.ClusteredMVFTS method)</a>
</li>
</ul></li>
<li><a href="pyFTS.common.html#pyFTS.common.FuzzySet.fuzzyfy_instance">fuzzyfy_instance() (in module pyFTS.common.FuzzySet)</a>
<ul>
<li><a href="pyFTS.models.multivariate.html#pyFTS.models.multivariate.common.fuzzyfy_instance">(in module pyFTS.models.multivariate.common)</a>
</li>
</ul></li>
<li><a href="pyFTS.models.multivariate.html#pyFTS.models.multivariate.common.fuzzyfy_instance_clustered">fuzzyfy_instance_clustered() (in module pyFTS.models.multivariate.common)</a>
</li>
<li><a href="pyFTS.common.html#pyFTS.common.FuzzySet.fuzzyfy_instances">fuzzyfy_instances() (in module pyFTS.common.FuzzySet)</a>
</li>
<li><a href="pyFTS.common.html#pyFTS.common.FuzzySet.fuzzyfy_series">fuzzyfy_series() (in module pyFTS.common.FuzzySet)</a>
@ -677,7 +719,9 @@
<ul>
<li><a href="pyFTS.models.html#pyFTS.models.ismailefendi.ImprovedWeightedFTS.generate_flrg">(pyFTS.models.ismailefendi.ImprovedWeightedFTS method)</a>
</li>
<li><a href="pyFTS.models.multivariate.html#pyFTS.models.multivariate.mvfts.MVFTS.generate_flrg">(pyFTS.models.multivariate.mvfts.MVFTS method)</a>, <a href="pyFTS.models.multivariate.html#pyFTS.models.multivariate.mvfts.MVFTS.generate_flrg">[1]</a>
<li><a href="pyFTS.models.multivariate.html#pyFTS.models.multivariate.mvfts.MVFTS.generate_flrg">(pyFTS.models.multivariate.mvfts.MVFTS method)</a>
</li>
<li><a href="pyFTS.models.multivariate.html#pyFTS.models.multivariate.wmvfts.WeightedMVFTS.generate_flrg">(pyFTS.models.multivariate.wmvfts.WeightedMVFTS method)</a>
</li>
<li><a href="pyFTS.models.nonstationary.html#pyFTS.models.nonstationary.cvfts.ConditionalVarianceFTS.generate_flrg">(pyFTS.models.nonstationary.cvfts.ConditionalVarianceFTS method)</a>
</li>
@ -698,7 +742,9 @@
</ul></li>
<li><a href="pyFTS.models.html#pyFTS.models.yu.WeightedFTS.generate_FLRG">generate_FLRG() (pyFTS.models.yu.WeightedFTS method)</a>
</li>
<li><a href="pyFTS.models.multivariate.html#pyFTS.models.multivariate.mvfts.MVFTS.generate_flrs">generate_flrs() (pyFTS.models.multivariate.mvfts.MVFTS method)</a>, <a href="pyFTS.models.multivariate.html#pyFTS.models.multivariate.mvfts.MVFTS.generate_flrs">[1]</a>
<li><a href="pyFTS.models.html#pyFTS.models.hofts.HighOrderFTS.generate_flrg_fuzzyfied">generate_flrg_fuzzyfied() (pyFTS.models.hofts.HighOrderFTS method)</a>
</li>
<li><a href="pyFTS.models.multivariate.html#pyFTS.models.multivariate.mvfts.MVFTS.generate_flrs">generate_flrs() (pyFTS.models.multivariate.mvfts.MVFTS method)</a>
</li>
<li><a href="pyFTS.data.html#pyFTS.data.artificial.generate_gaussian_linear">generate_gaussian_linear() (in module pyFTS.data.artificial)</a>
</li>
@ -712,7 +758,13 @@
<li><a href="pyFTS.models.html#pyFTS.models.pwfts.ProbabilisticWeightedFTS.generate_lhs_flrg">(pyFTS.models.pwfts.ProbabilisticWeightedFTS method)</a>
</li>
</ul></li>
<li><a href="pyFTS.models.multivariate.html#pyFTS.models.multivariate.mvfts.MVFTS.generate_lhs_flrs">generate_lhs_flrs() (pyFTS.models.multivariate.mvfts.MVFTS method)</a>, <a href="pyFTS.models.multivariate.html#pyFTS.models.multivariate.mvfts.MVFTS.generate_lhs_flrs">[1]</a>
<li><a href="pyFTS.models.html#pyFTS.models.hofts.HighOrderFTS.generate_lhs_flrg_fuzzyfied">generate_lhs_flrg_fuzzyfied() (pyFTS.models.hofts.HighOrderFTS method)</a>
<ul>
<li><a href="pyFTS.models.html#pyFTS.models.hofts.WeightedHighOrderFTS.generate_lhs_flrg_fuzzyfied">(pyFTS.models.hofts.WeightedHighOrderFTS method)</a>
</li>
</ul></li>
<li><a href="pyFTS.models.multivariate.html#pyFTS.models.multivariate.mvfts.MVFTS.generate_lhs_flrs">generate_lhs_flrs() (pyFTS.models.multivariate.mvfts.MVFTS method)</a>
</li>
<li><a href="pyFTS.common.html#pyFTS.common.FLR.generate_non_recurrent_flrs">generate_non_recurrent_flrs() (in module pyFTS.common.FLR)</a>
</li>
@ -897,6 +949,10 @@
<li><a href="pyFTS.common.html#pyFTS.common.flrg.FLRG.get_midpoint">get_midpoint() (pyFTS.common.flrg.FLRG method)</a>
<ul>
<li><a href="pyFTS.models.html#pyFTS.models.hofts.WeightedHighOrderFLRG.get_midpoint">(pyFTS.models.hofts.WeightedHighOrderFLRG method)</a>
</li>
<li><a href="pyFTS.models.multivariate.html#pyFTS.models.multivariate.wmvfts.WeightedFLRG.get_midpoint">(pyFTS.models.multivariate.wmvfts.WeightedFLRG method)</a>
</li>
<li><a href="pyFTS.models.nonstationary.html#pyFTS.models.nonstationary.common.FuzzySet.get_midpoint">(pyFTS.models.nonstationary.common.FuzzySet method)</a>
</li>
<li><a href="pyFTS.models.nonstationary.html#pyFTS.models.nonstationary.flrg.NonStationaryFLRG.get_midpoint">(pyFTS.models.nonstationary.flrg.NonStationaryFLRG method)</a>
@ -921,6 +977,8 @@
<li><a href="pyFTS.models.ensemble.html#pyFTS.models.ensemble.ensemble.EnsembleFTS.get_point">get_point() (pyFTS.models.ensemble.ensemble.EnsembleFTS method)</a>
</li>
<li><a href="pyFTS.benchmarks.html#pyFTS.benchmarks.benchmarks.get_point_methods">get_point_methods() (in module pyFTS.benchmarks.benchmarks)</a>
</li>
<li><a href="pyFTS.benchmarks.html#pyFTS.benchmarks.benchmarks.get_point_multivariate_methods">get_point_multivariate_methods() (in module pyFTS.benchmarks.benchmarks)</a>
</li>
<li><a href="pyFTS.benchmarks.html#pyFTS.benchmarks.Measures.get_point_statistics">get_point_statistics() (in module pyFTS.benchmarks.Measures)</a>
</li>
@ -1045,6 +1103,8 @@
<li><a href="pyFTS.common.html#pyFTS.common.SortedCollection.SortedCollection.insert">insert() (pyFTS.common.SortedCollection.SortedCollection method)</a>
</li>
<li><a href="pyFTS.benchmarks.html#pyFTS.benchmarks.Util.insert_benchmark">insert_benchmark() (in module pyFTS.benchmarks.Util)</a>
</li>
<li><a href="pyFTS.hyperparam.html#pyFTS.hyperparam.Util.insert_hyperparam">insert_hyperparam() (in module pyFTS.hyperparam.Util)</a>
</li>
<li><a href="pyFTS.common.html#pyFTS.common.SortedCollection.SortedCollection.insert_right">insert_right() (pyFTS.common.SortedCollection.SortedCollection method)</a>
</li>
@ -1160,6 +1220,8 @@
<li><a href="pyFTS.common.html#pyFTS.common.Composite.FuzzySet.membership">(pyFTS.common.Composite.FuzzySet method)</a>
</li>
<li><a href="pyFTS.common.html#pyFTS.common.FuzzySet.FuzzySet.membership">(pyFTS.common.FuzzySet.FuzzySet method)</a>
</li>
<li><a href="pyFTS.models.multivariate.html#pyFTS.models.multivariate.common.MultivariateFuzzySet.membership">(pyFTS.models.multivariate.common.MultivariateFuzzySet method)</a>
</li>
<li><a href="pyFTS.models.nonstationary.html#pyFTS.models.nonstationary.common.FuzzySet.membership">(pyFTS.models.nonstationary.common.FuzzySet method)</a>
</li>
@ -1167,6 +1229,8 @@
<li><a href="pyFTS.partitioners.html#pyFTS.partitioners.partitioner.Partitioner.membership_function">membership_function (pyFTS.partitioners.partitioner.Partitioner attribute)</a>
</li>
<li><a href="pyFTS.common.html#pyFTS.common.fts.FTS.merge">merge() (pyFTS.common.fts.FTS method)</a>
</li>
<li><a href="pyFTS.hyperparam.html#pyFTS.hyperparam.GridSearch.metodo_cluster">metodo_cluster() (in module pyFTS.hyperparam.GridSearch)</a>
</li>
<li><a href="pyFTS.common.html#pyFTS.common.FuzzySet.FuzzySet.mf">mf (pyFTS.common.FuzzySet.FuzzySet attribute)</a>
</li>
@ -1185,14 +1249,20 @@
<li><a href="pyFTS.models.seasonal.html#pyFTS.models.seasonal.common.DateTime.minute_of_year">minute_of_year (pyFTS.models.seasonal.common.DateTime attribute)</a>
</li>
<li><a href="pyFTS.models.incremental.html#pyFTS.models.incremental.Retrainer.Retrainer.model">model (pyFTS.models.incremental.Retrainer.Retrainer attribute)</a>
<ul>
<li><a href="pyFTS.models.multivariate.html#pyFTS.models.multivariate.cmvfts.ClusteredMVFTS.model">(pyFTS.models.multivariate.cmvfts.ClusteredMVFTS attribute)</a>
</li>
</ul></li>
<li><a href="pyFTS.models.ensemble.html#pyFTS.models.ensemble.ensemble.EnsembleFTS.models">models (pyFTS.models.ensemble.ensemble.EnsembleFTS attribute)</a>
</li>
<li><a href="pyFTS.models.seasonal.html#pyFTS.models.seasonal.common.DateTime.month">month (pyFTS.models.seasonal.common.DateTime attribute)</a>
</li>
<li><a href="pyFTS.models.seasonal.html#pyFTS.models.seasonal.msfts.MultiSeasonalFTS">MultiSeasonalFTS (class in pyFTS.models.seasonal.msfts)</a>
</li>
<li><a href="pyFTS.models.multivariate.html#pyFTS.models.multivariate.mvfts.MVFTS">MVFTS (class in pyFTS.models.multivariate.mvfts)</a>, <a href="pyFTS.models.multivariate.html#pyFTS.models.multivariate.mvfts.MVFTS">[1]</a>
<li><a href="pyFTS.models.multivariate.html#pyFTS.models.multivariate.common.MultivariateFuzzySet">MultivariateFuzzySet (class in pyFTS.models.multivariate.common)</a>
</li>
<li><a href="pyFTS.models.multivariate.html#pyFTS.models.multivariate.mvfts.MVFTS">MVFTS (class in pyFTS.models.multivariate.mvfts)</a>
</li>
</ul></td>
</tr></table>
@ -1229,17 +1299,19 @@
<table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="pyFTS.benchmarks.html#pyFTS.benchmarks.Util.open_benchmark_db">open_benchmark_db() (in module pyFTS.benchmarks.Util)</a>
</li>
<li><a href="pyFTS.hyperparam.html#pyFTS.hyperparam.Util.open_hyperparam_db">open_hyperparam_db() (in module pyFTS.hyperparam.Util)</a>
</li>
<li><a href="pyFTS.models.html#pyFTS.models.song.ConventionalFTS.operation_matrix">operation_matrix() (pyFTS.models.song.ConventionalFTS method)</a>
</li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="pyFTS.common.html#pyFTS.common.flrg.FLRG.order">order (pyFTS.common.flrg.FLRG attribute)</a>
<ul>
<li><a href="pyFTS.common.html#pyFTS.common.fts.FTS.order">(pyFTS.common.fts.FTS attribute)</a>
</li>
</ul></li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="pyFTS.common.html#pyFTS.common.fts.FTS.original_max">original_max (pyFTS.common.fts.FTS attribute)</a>
</li>
<li><a href="pyFTS.common.html#pyFTS.common.fts.FTS.original_min">original_min (pyFTS.common.fts.FTS attribute)</a>
@ -1432,12 +1504,12 @@
</li>
<li><a href="pyFTS.benchmarks.html#module-pyFTS.benchmarks.Util">pyFTS.benchmarks.Util (module)</a>
</li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="pyFTS.common.html#module-pyFTS.common">pyFTS.common (module)</a>
</li>
<li><a href="pyFTS.common.html#module-pyFTS.common.Composite">pyFTS.common.Composite (module)</a>
</li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="pyFTS.common.html#module-pyFTS.common.FLR">pyFTS.common.FLR (module)</a>
</li>
<li><a href="pyFTS.common.html#module-pyFTS.common.flrg">pyFTS.common.flrg (module)</a>
@ -1503,6 +1575,12 @@
<li><a href="pyFTS.data.html#module-pyFTS.data.sunspots">pyFTS.data.sunspots (module)</a>
</li>
<li><a href="pyFTS.data.html#module-pyFTS.data.TAIEX">pyFTS.data.TAIEX (module)</a>
</li>
<li><a href="pyFTS.hyperparam.html#module-pyFTS.hyperparam">pyFTS.hyperparam (module)</a>
</li>
<li><a href="pyFTS.hyperparam.html#module-pyFTS.hyperparam.GridSearch">pyFTS.hyperparam.GridSearch (module)</a>
</li>
<li><a href="pyFTS.hyperparam.html#module-pyFTS.hyperparam.Util">pyFTS.hyperparam.Util (module)</a>
</li>
<li><a href="pyFTS.models.html#module-pyFTS.models">pyFTS.models (module)</a>
</li>
@ -1529,6 +1607,8 @@
<li><a href="pyFTS.models.html#module-pyFTS.models.ismailefendi">pyFTS.models.ismailefendi (module)</a>
</li>
<li><a href="pyFTS.models.multivariate.html#module-pyFTS.models.multivariate">pyFTS.models.multivariate (module)</a>
</li>
<li><a href="pyFTS.models.multivariate.html#module-pyFTS.models.multivariate.cmvfts">pyFTS.models.multivariate.cmvfts (module)</a>
</li>
<li><a href="pyFTS.models.multivariate.html#module-pyFTS.models.multivariate.common">pyFTS.models.multivariate.common (module)</a>
</li>
@ -1536,9 +1616,11 @@
</li>
<li><a href="pyFTS.models.multivariate.html#module-pyFTS.models.multivariate.flrg">pyFTS.models.multivariate.flrg (module)</a>
</li>
<li><a href="pyFTS.models.multivariate.html#module-pyFTS.models.multivariate.mvfts">pyFTS.models.multivariate.mvfts (module)</a>, <a href="pyFTS.models.multivariate.html#module-pyFTS.models.multivariate.mvfts">[1]</a>
<li><a href="pyFTS.models.multivariate.html#module-pyFTS.models.multivariate.mvfts">pyFTS.models.multivariate.mvfts (module)</a>
</li>
<li><a href="pyFTS.models.multivariate.html#module-pyFTS.models.multivariate.variable">pyFTS.models.multivariate.variable (module)</a>
</li>
<li><a href="pyFTS.models.multivariate.html#module-pyFTS.models.multivariate.wmvfts">pyFTS.models.multivariate.wmvfts (module)</a>
</li>
<li><a href="pyFTS.models.nonstationary.html#module-pyFTS.models.nonstationary">pyFTS.models.nonstationary (module)</a>
</li>
@ -1809,7 +1891,9 @@
</li>
<li><a href="pyFTS.models.html#pyFTS.models.ismailefendi.ImprovedWeightedFTS.train">(pyFTS.models.ismailefendi.ImprovedWeightedFTS method)</a>
</li>
<li><a href="pyFTS.models.multivariate.html#pyFTS.models.multivariate.mvfts.MVFTS.train">(pyFTS.models.multivariate.mvfts.MVFTS method)</a>, <a href="pyFTS.models.multivariate.html#pyFTS.models.multivariate.mvfts.MVFTS.train">[1]</a>
<li><a href="pyFTS.models.multivariate.html#pyFTS.models.multivariate.cmvfts.ClusteredMVFTS.train">(pyFTS.models.multivariate.cmvfts.ClusteredMVFTS method)</a>
</li>
<li><a href="pyFTS.models.multivariate.html#pyFTS.models.multivariate.mvfts.MVFTS.train">(pyFTS.models.multivariate.mvfts.MVFTS method)</a>
</li>
<li><a href="pyFTS.models.nonstationary.html#pyFTS.models.nonstationary.cvfts.ConditionalVarianceFTS.train">(pyFTS.models.nonstationary.cvfts.ConditionalVarianceFTS method)</a>
</li>
@ -1863,6 +1947,8 @@
<li><a href="pyFTS.common.html#pyFTS.common.FuzzySet.FuzzySet.type">type (pyFTS.common.FuzzySet.FuzzySet attribute)</a>
<ul>
<li><a href="pyFTS.partitioners.html#pyFTS.partitioners.partitioner.Partitioner.type">(pyFTS.partitioners.partitioner.Partitioner attribute)</a>
</li>
<li><a href="pyFTS.probabilistic.html#pyFTS.probabilistic.ProbabilityDistribution.ProbabilityDistribution.type">(pyFTS.probabilistic.ProbabilityDistribution.ProbabilityDistribution attribute)</a>
</li>
</ul></li>
@ -1906,10 +1992,14 @@
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="pyFTS.models.multivariate.html#pyFTS.models.multivariate.variable.Variable">Variable (class in pyFTS.models.multivariate.variable)</a>
</li>
<li><a href="pyFTS.common.html#pyFTS.common.FuzzySet.FuzzySet.variable">variable (pyFTS.common.FuzzySet.FuzzySet attribute)</a>
<ul>
<li><a href="pyFTS.partitioners.html#pyFTS.partitioners.partitioner.Partitioner.variable">(pyFTS.partitioners.partitioner.Partitioner attribute)</a>
</li>
</ul></li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="pyFTS.common.html#pyFTS.common.FuzzySet.FuzzySet.variable">variable (pyFTS.common.FuzzySet.FuzzySet attribute)</a>
</li>
<li><a href="pyFTS.models.html#pyFTS.models.pwfts.visualize_distributions">visualize_distributions() (in module pyFTS.models.pwfts)</a>
</li>
</ul></td>
@ -1918,14 +2008,28 @@
<h2 id="W">W</h2>
<table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="pyFTS.models.html#pyFTS.models.yu.WeightedFLRG">WeightedFLRG (class in pyFTS.models.yu)</a>
<li><a href="pyFTS.models.multivariate.html#pyFTS.models.multivariate.wmvfts.WeightedFLRG">WeightedFLRG (class in pyFTS.models.multivariate.wmvfts)</a>
<ul>
<li><a href="pyFTS.models.html#pyFTS.models.yu.WeightedFLRG">(class in pyFTS.models.yu)</a>
</li>
</ul></li>
<li><a href="pyFTS.models.html#pyFTS.models.yu.WeightedFTS">WeightedFTS (class in pyFTS.models.yu)</a>
</li>
<li><a href="pyFTS.models.html#pyFTS.models.hofts.WeightedHighOrderFLRG">WeightedHighOrderFLRG (class in pyFTS.models.hofts)</a>
</li>
<li><a href="pyFTS.models.html#pyFTS.models.hofts.WeightedHighOrderFTS">WeightedHighOrderFTS (class in pyFTS.models.hofts)</a>
</li>
<li><a href="pyFTS.models.multivariate.html#pyFTS.models.multivariate.wmvfts.WeightedMVFTS">WeightedMVFTS (class in pyFTS.models.multivariate.wmvfts)</a>
</li>
<li><a href="pyFTS.models.html#pyFTS.models.cheng.TrendWeightedFLRG.weights">weights() (pyFTS.models.cheng.TrendWeightedFLRG method)</a>
<ul>
<li><a href="pyFTS.models.html#pyFTS.models.hofts.WeightedHighOrderFLRG.weights">(pyFTS.models.hofts.WeightedHighOrderFLRG method)</a>
</li>
<li><a href="pyFTS.models.html#pyFTS.models.ismailefendi.ImprovedWeightedFLRG.weights">(pyFTS.models.ismailefendi.ImprovedWeightedFLRG method)</a>
</li>
<li><a href="pyFTS.models.multivariate.html#pyFTS.models.multivariate.wmvfts.WeightedFLRG.weights">(pyFTS.models.multivariate.wmvfts.WeightedFLRG method)</a>
</li>
<li><a href="pyFTS.models.html#pyFTS.models.sadaei.ExponentialyWeightedFLRG.weights">(pyFTS.models.sadaei.ExponentialyWeightedFLRG method)</a>
</li>

View File

@ -153,6 +153,13 @@
<li class="toctree-l4"><a class="reference internal" href="pyFTS.data.html#module-pyFTS.data.sunspots">Sunspots dataset</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="pyFTS.hyperparam.html">pyFTS.hyperparam package</a><ul>
<li class="toctree-l4"><a class="reference internal" href="pyFTS.hyperparam.html#module-pyFTS.hyperparam">Module contents</a></li>
<li class="toctree-l4"><a class="reference internal" href="pyFTS.hyperparam.html#submodules">Submodules</a></li>
<li class="toctree-l4"><a class="reference internal" href="pyFTS.hyperparam.html#module-pyFTS.hyperparam.Util">pyFTS.hyperparam.Util module</a></li>
<li class="toctree-l4"><a class="reference internal" href="pyFTS.hyperparam.html#pyfts-hyperparam-gridsearch-module">pyFTS.hyperparam.GridSearch module</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="pyFTS.models.html">pyFTS.models package</a><ul>
<li class="toctree-l4"><a class="reference internal" href="pyFTS.models.html#module-pyFTS.models">Module contents</a></li>
<li class="toctree-l4"><a class="reference internal" href="pyFTS.models.html#subpackages">Subpackages</a></li>

Binary file not shown.

View File

@ -310,6 +310,21 @@
<td>&#160;&#160;&#160;
<a href="pyFTS.data.html#module-pyFTS.data.TAIEX"><code class="xref">pyFTS.data.TAIEX</code></a></td><td>
<em></em></td></tr>
<tr class="cg-1">
<td></td>
<td>&#160;&#160;&#160;
<a href="pyFTS.hyperparam.html#module-pyFTS.hyperparam"><code class="xref">pyFTS.hyperparam</code></a></td><td>
<em></em></td></tr>
<tr class="cg-1">
<td></td>
<td>&#160;&#160;&#160;
<a href="pyFTS.hyperparam.html#module-pyFTS.hyperparam.GridSearch"><code class="xref">pyFTS.hyperparam.GridSearch</code></a></td><td>
<em></em></td></tr>
<tr class="cg-1">
<td></td>
<td>&#160;&#160;&#160;
<a href="pyFTS.hyperparam.html#module-pyFTS.hyperparam.Util"><code class="xref">pyFTS.hyperparam.Util</code></a></td><td>
<em></em></td></tr>
<tr class="cg-1">
<td></td>
<td>&#160;&#160;&#160;
@ -375,6 +390,11 @@
<td>&#160;&#160;&#160;
<a href="pyFTS.models.multivariate.html#module-pyFTS.models.multivariate"><code class="xref">pyFTS.models.multivariate</code></a></td><td>
<em></em></td></tr>
<tr class="cg-1">
<td></td>
<td>&#160;&#160;&#160;
<a href="pyFTS.models.multivariate.html#module-pyFTS.models.multivariate.cmvfts"><code class="xref">pyFTS.models.multivariate.cmvfts</code></a></td><td>
<em></em></td></tr>
<tr class="cg-1">
<td></td>
<td>&#160;&#160;&#160;
@ -400,6 +420,11 @@
<td>&#160;&#160;&#160;
<a href="pyFTS.models.multivariate.html#module-pyFTS.models.multivariate.variable"><code class="xref">pyFTS.models.multivariate.variable</code></a></td><td>
<em></em></td></tr>
<tr class="cg-1">
<td></td>
<td>&#160;&#160;&#160;
<a href="pyFTS.models.multivariate.html#module-pyFTS.models.multivariate.wmvfts"><code class="xref">pyFTS.models.multivariate.wmvfts</code></a></td><td>
<em></em></td></tr>
<tr class="cg-1">
<td></td>
<td>&#160;&#160;&#160;

View File

@ -167,6 +167,12 @@
<dd><p>Return all FTS methods for point forecasting</p>
</dd></dl>
<dl class="function">
<dt id="pyFTS.benchmarks.benchmarks.get_point_multivariate_methods">
<code class="descclassname">pyFTS.benchmarks.benchmarks.</code><code class="descname">get_point_multivariate_methods</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/pyFTS/benchmarks/benchmarks.html#get_point_multivariate_methods"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyFTS.benchmarks.benchmarks.get_point_multivariate_methods" title="Permalink to this definition"></a></dt>
<dd><p>Return all multivariate FTS methods por point forecasting</p>
</dd></dl>
<dl class="function">
<dt id="pyFTS.benchmarks.benchmarks.get_probabilistic_methods">
<code class="descclassname">pyFTS.benchmarks.benchmarks.</code><code class="descname">get_probabilistic_methods</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/pyFTS/benchmarks/benchmarks.html#get_probabilistic_methods"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyFTS.benchmarks.benchmarks.get_probabilistic_methods" title="Permalink to this definition"></a></dt>

View File

@ -125,7 +125,7 @@
<p>Composite Fuzzy Sets</p>
<dl class="class">
<dt id="pyFTS.common.Composite.FuzzySet">
<em class="property">class </em><code class="descclassname">pyFTS.common.Composite.</code><code class="descname">FuzzySet</code><span class="sig-paren">(</span><em>name</em>, <em>superset=False</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pyFTS/common/Composite.html#FuzzySet"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyFTS.common.Composite.FuzzySet" title="Permalink to this definition"></a></dt>
<em class="property">class </em><code class="descclassname">pyFTS.common.Composite.</code><code class="descname">FuzzySet</code><span class="sig-paren">(</span><em>name</em>, <em>superset=False</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pyFTS/common/Composite.html#FuzzySet"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyFTS.common.Composite.FuzzySet" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference internal" href="#pyFTS.common.FuzzySet.FuzzySet" title="pyFTS.common.FuzzySet.FuzzySet"><code class="xref py py-class docutils literal notranslate"><span class="pre">pyFTS.common.FuzzySet.FuzzySet</span></code></a></p>
<p>Composite Fuzzy Set</p>
<dl class="method">
@ -1611,7 +1611,7 @@ when the LHS pattern is identified on time t.</p>
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>data</strong> time series data with the minimal length equal to the max_lag of the model</li>
<li><strong>steps</strong> the number of steps ahead to forecast</li>
<li><strong>kwargs</strong> model specific parameters</li>
<li><strong>start</strong> in the multi step forecasting, the index of the data where to start forecasting</li>
</ul>
</td>
</tr>
@ -1851,6 +1851,9 @@ needed to forecast a single step ahead</p>
<li><strong>distributed</strong> boolean, indicate if the forecasting procedure will be distributed in a dispy cluster</li>
<li><strong>nodes</strong> a list with the dispy cluster nodes addresses</li>
<li><strong>explain</strong> try to explain, step by step, the one-step-ahead point forecasting result given the input data.</li>
<li><strong>generators</strong> for multivariate methods on multi step ahead forecasting, generators is a dict where the keys
are the variables names (except the target_variable) and the values are lambda functions that
accept one value (the actual value of the variable) and return the next value.</li>
</ul>
</td>
</tr>

View File

@ -165,6 +165,13 @@
<li class="toctree-l2"><a class="reference internal" href="pyFTS.data.html#module-pyFTS.data.sunspots">Sunspots dataset</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="pyFTS.hyperparam.html">pyFTS.hyperparam package</a><ul>
<li class="toctree-l2"><a class="reference internal" href="pyFTS.hyperparam.html#module-pyFTS.hyperparam">Module contents</a></li>
<li class="toctree-l2"><a class="reference internal" href="pyFTS.hyperparam.html#submodules">Submodules</a></li>
<li class="toctree-l2"><a class="reference internal" href="pyFTS.hyperparam.html#module-pyFTS.hyperparam.Util">pyFTS.hyperparam.Util module</a></li>
<li class="toctree-l2"><a class="reference internal" href="pyFTS.hyperparam.html#module-pyFTS.hyperparam.GridSearch">pyFTS.hyperparam.GridSearch module</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="pyFTS.models.html">pyFTS.models package</a><ul>
<li class="toctree-l2"><a class="reference internal" href="pyFTS.models.html#module-pyFTS.models">Module contents</a></li>
<li class="toctree-l2"><a class="reference internal" href="pyFTS.models.html#subpackages">Subpackages</a><ul>
@ -182,13 +189,15 @@
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="pyFTS.models.multivariate.html">pyFTS.models.multivariate package</a><ul>
<li class="toctree-l4"><a class="reference internal" href="pyFTS.models.multivariate.html#module-pyFTS.models.multivariate">Module contents</a></li>
<li class="toctree-l4"><a class="reference internal" href="pyFTS.models.multivariate.html#submodules">Submodules</a></li>
<li class="toctree-l4"><a class="reference internal" href="pyFTS.models.multivariate.html#module-pyFTS.models.multivariate.FLR">pyFTS.models.multivariate.FLR module</a></li>
<li class="toctree-l4"><a class="reference internal" href="pyFTS.models.multivariate.html#module-pyFTS.models.multivariate.common">pyFTS.models.multivariate.common module</a></li>
<li class="toctree-l4"><a class="reference internal" href="pyFTS.models.multivariate.html#module-pyFTS.models.multivariate.variable">pyFTS.models.multivariate.variable module</a></li>
<li class="toctree-l4"><a class="reference internal" href="pyFTS.models.multivariate.html#module-pyFTS.models.multivariate.flrg">pyFTS.models.multivariate.flrg module</a></li>
<li class="toctree-l4"><a class="reference internal" href="pyFTS.models.multivariate.html#module-pyFTS.models.multivariate.mvfts">pyFTS.models.multivariate.mvfts module</a></li>
<li class="toctree-l4"><a class="reference internal" href="pyFTS.models.multivariate.html#module-pyFTS.models.multivariate.variable">pyFTS.models.multivariate.variable module</a></li>
<li class="toctree-l4"><a class="reference internal" href="pyFTS.models.multivariate.html#module-pyFTS.models.multivariate">Module contents</a></li>
<li class="toctree-l4"><a class="reference internal" href="pyFTS.models.multivariate.html#module-pyFTS.models.multivariate.wmvfts">pyFTS.models.multivariate.wmvfts module</a></li>
<li class="toctree-l4"><a class="reference internal" href="pyFTS.models.multivariate.html#module-pyFTS.models.multivariate.cmvfts">pyFTS.models.multivariate.cmvfts module</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="pyFTS.models.nonstationary.html">pyFTS.models.nonstationary package</a><ul>
@ -239,7 +248,7 @@
<li class="toctree-l2"><a class="reference internal" href="pyFTS.partitioners.html#module-pyFTS.partitioners.FCM">pyFTS.partitioners.FCM module</a></li>
<li class="toctree-l2"><a class="reference internal" href="pyFTS.partitioners.html#module-pyFTS.partitioners.Grid">pyFTS.partitioners.Grid module</a></li>
<li class="toctree-l2"><a class="reference internal" href="pyFTS.partitioners.html#module-pyFTS.partitioners.Huarng">pyFTS.partitioners.Huarng module</a></li>
<li class="toctree-l2"><a class="reference internal" href="pyFTS.partitioners.html#pyfts-partitioners-singleton-module">pyFTS.partitioners.Singleton module</a></li>
<li class="toctree-l2"><a class="reference internal" href="pyFTS.partitioners.html#module-pyFTS.partitioners.Singleton">pyFTS.partitioners.Singleton module</a></li>
<li class="toctree-l2"><a class="reference internal" href="pyFTS.partitioners.html#module-pyFTS.partitioners.Util">pyFTS.partitioners.Util module</a></li>
<li class="toctree-l2"><a class="reference internal" href="pyFTS.partitioners.html#module-pyFTS.partitioners.parallel_util">pyFTS.partitioners.parallel_util module</a></li>
</ul>

236
docs/build/html/pyFTS.hyperparam.html vendored Normal file
View File

@ -0,0 +1,236 @@
<!doctype html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="X-UA-Compatible" content="IE=Edge" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-55120145-3']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
<title>pyFTS.hyperparam package &#8212; pyFTS 1.2.3 documentation</title>
<link rel="stylesheet" href="_static/bizstyle.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<script type="text/javascript" src="_static/documentation_options.js"></script>
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
<script type="text/javascript" src="_static/bizstyle.js"></script>
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="next" title="pyFTS.models package" href="pyFTS.models.html" />
<link rel="prev" title="pyFTS.data package" href="pyFTS.data.html" />
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<!--[if lt IE 9]>
<script type="text/javascript" src="_static/css3-mediaqueries.js"></script>
<![endif]-->
</head><body>
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="right" >
<a href="pyFTS.models.html" title="pyFTS.models package"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="pyFTS.data.html" title="pyFTS.data package"
accesskey="P">previous</a> |</li>
<li class="nav-item nav-item-0"><a href="index.html">pyFTS 1.2.3 documentation</a> &#187;</li>
<li class="nav-item nav-item-1"><a href="modules.html" >pyFTS</a> &#187;</li>
<li class="nav-item nav-item-2"><a href="pyFTS.html" accesskey="U">pyFTS package</a> &#187;</li>
</ul>
</div>
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebarwrapper">
<p class="logo"><a href="index.html">
<img class="logo" src="_static/logo_heading2.png" alt="Logo"/>
</a></p>
<h3><a href="index.html">Table Of Contents</a></h3>
<ul>
<li><a class="reference internal" href="#">pyFTS.hyperparam package</a><ul>
<li><a class="reference internal" href="#module-pyFTS.hyperparam">Module contents</a></li>
<li><a class="reference internal" href="#submodules">Submodules</a></li>
<li><a class="reference internal" href="#module-pyFTS.hyperparam.Util">pyFTS.hyperparam.Util module</a></li>
<li><a class="reference internal" href="#module-pyFTS.hyperparam.GridSearch">pyFTS.hyperparam.GridSearch module</a></li>
</ul>
</li>
</ul>
<h4>Previous topic</h4>
<p class="topless"><a href="pyFTS.data.html"
title="previous chapter">pyFTS.data package</a></p>
<h4>Next topic</h4>
<p class="topless"><a href="pyFTS.models.html"
title="next chapter">pyFTS.models package</a></p>
<div role="note" aria-label="source link">
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="_sources/pyFTS.hyperparam.rst.txt"
rel="nofollow">Show Source</a></li>
</ul>
</div>
<div id="searchbox" style="display: none" role="search">
<h3>Quick search</h3>
<div class="searchformwrapper">
<form class="search" action="search.html" method="get">
<input type="text" name="q" />
<input type="submit" value="Go" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
</div>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<div class="section" id="pyfts-hyperparam-package">
<h1>pyFTS.hyperparam package<a class="headerlink" href="#pyfts-hyperparam-package" title="Permalink to this headline"></a></h1>
<div class="section" id="module-pyFTS.hyperparam">
<span id="module-contents"></span><h2>Module contents<a class="headerlink" href="#module-pyFTS.hyperparam" title="Permalink to this headline"></a></h2>
</div>
<div class="section" id="submodules">
<h2>Submodules<a class="headerlink" href="#submodules" title="Permalink to this headline"></a></h2>
</div>
<div class="section" id="module-pyFTS.hyperparam.Util">
<span id="pyfts-hyperparam-util-module"></span><h2>pyFTS.hyperparam.Util module<a class="headerlink" href="#module-pyFTS.hyperparam.Util" title="Permalink to this headline"></a></h2>
<p>Common facilities for hyperparameter tunning</p>
<dl class="function">
<dt id="pyFTS.hyperparam.Util.create_hyperparam_tables">
<code class="descclassname">pyFTS.hyperparam.Util.</code><code class="descname">create_hyperparam_tables</code><span class="sig-paren">(</span><em>conn</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pyFTS/hyperparam/Util.html#create_hyperparam_tables"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyFTS.hyperparam.Util.create_hyperparam_tables" title="Permalink to this definition"></a></dt>
<dd><p>Create a sqlite3 table designed to store benchmark results.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>conn</strong> a sqlite3 database connection</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="function">
<dt id="pyFTS.hyperparam.Util.insert_hyperparam">
<code class="descclassname">pyFTS.hyperparam.Util.</code><code class="descname">insert_hyperparam</code><span class="sig-paren">(</span><em>data</em>, <em>conn</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pyFTS/hyperparam/Util.html#insert_hyperparam"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyFTS.hyperparam.Util.insert_hyperparam" title="Permalink to this definition"></a></dt>
<dd><p>Insert benchmark data on database</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>data</strong> a tuple with the benchmark data with format:</td>
</tr>
</tbody>
</table>
<p>Dataset: Identify on which dataset the dataset was performed
Tag: a user defined word that indentify a benchmark set
Model: FTS model
Transformation: The name of data transformation, if one was used
mf: membership function
Order: the order of the FTS method
Partitioner: UoD partitioning scheme
Partitions: Number of partitions
alpha: alpha cut
lags: lags
Measure: accuracy measure
Value: the measure value</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>conn</strong> a sqlite3 database connection</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"></td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="function">
<dt id="pyFTS.hyperparam.Util.open_hyperparam_db">
<code class="descclassname">pyFTS.hyperparam.Util.</code><code class="descname">open_hyperparam_db</code><span class="sig-paren">(</span><em>name</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pyFTS/hyperparam/Util.html#open_hyperparam_db"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyFTS.hyperparam.Util.open_hyperparam_db" title="Permalink to this definition"></a></dt>
<dd><p>Open a connection with a Sqlite database designed to store benchmark results.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>name</strong> database filenem</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">a sqlite3 database connection</td>
</tr>
</tbody>
</table>
</dd></dl>
</div>
<div class="section" id="module-pyFTS.hyperparam.GridSearch">
<span id="pyfts-hyperparam-gridsearch-module"></span><h2>pyFTS.hyperparam.GridSearch module<a class="headerlink" href="#module-pyFTS.hyperparam.GridSearch" title="Permalink to this headline"></a></h2>
<dl class="function">
<dt id="pyFTS.hyperparam.GridSearch.dict_individual">
<code class="descclassname">pyFTS.hyperparam.GridSearch.</code><code class="descname">dict_individual</code><span class="sig-paren">(</span><em>mf</em>, <em>partitioner</em>, <em>partitions</em>, <em>order</em>, <em>lags</em>, <em>alpha_cut</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pyFTS/hyperparam/GridSearch.html#dict_individual"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyFTS.hyperparam.GridSearch.dict_individual" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="function">
<dt id="pyFTS.hyperparam.GridSearch.execute">
<code class="descclassname">pyFTS.hyperparam.GridSearch.</code><code class="descname">execute</code><span class="sig-paren">(</span><em>hyperparams</em>, <em>datasetname</em>, <em>train</em>, <em>test</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pyFTS/hyperparam/GridSearch.html#execute"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyFTS.hyperparam.GridSearch.execute" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="function">
<dt id="pyFTS.hyperparam.GridSearch.metodo_cluster">
<code class="descclassname">pyFTS.hyperparam.GridSearch.</code><code class="descname">metodo_cluster</code><span class="sig-paren">(</span><em>individual</em>, <em>train</em>, <em>test</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pyFTS/hyperparam/GridSearch.html#metodo_cluster"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyFTS.hyperparam.GridSearch.metodo_cluster" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</div>
</div>
</div>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
>index</a></li>
<li class="right" >
<a href="py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="right" >
<a href="pyFTS.models.html" title="pyFTS.models package"
>next</a> |</li>
<li class="right" >
<a href="pyFTS.data.html" title="pyFTS.data package"
>previous</a> |</li>
<li class="nav-item nav-item-0"><a href="index.html">pyFTS 1.2.3 documentation</a> &#187;</li>
<li class="nav-item nav-item-1"><a href="modules.html" >pyFTS</a> &#187;</li>
<li class="nav-item nav-item-2"><a href="pyFTS.html" >pyFTS package</a> &#187;</li>
</ul>
</div>
<div class="footer" role="contentinfo">
&#169; Copyright 2018, Machine Intelligence and Data Science Laboratory - UFMG - Brazil.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.7.2.
</div>
</body>
</html>

View File

@ -29,7 +29,7 @@
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="next" title="pyFTS.models.ensemble package" href="pyFTS.models.ensemble.html" />
<link rel="prev" title="pyFTS.data package" href="pyFTS.data.html" />
<link rel="prev" title="pyFTS.hyperparam package" href="pyFTS.hyperparam.html" />
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<!--[if lt IE 9]>
<script type="text/javascript" src="_static/css3-mediaqueries.js"></script>
@ -48,7 +48,7 @@
<a href="pyFTS.models.ensemble.html" title="pyFTS.models.ensemble package"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="pyFTS.data.html" title="pyFTS.data package"
<a href="pyFTS.hyperparam.html" title="pyFTS.hyperparam package"
accesskey="P">previous</a> |</li>
<li class="nav-item nav-item-0"><a href="index.html">pyFTS 1.2.3 documentation</a> &#187;</li>
<li class="nav-item nav-item-1"><a href="modules.html" >pyFTS</a> &#187;</li>
@ -81,8 +81,8 @@
</ul>
<h4>Previous topic</h4>
<p class="topless"><a href="pyFTS.data.html"
title="previous chapter">pyFTS.data package</a></p>
<p class="topless"><a href="pyFTS.hyperparam.html"
title="previous chapter">pyFTS.hyperparam package</a></p>
<h4>Next topic</h4>
<p class="topless"><a href="pyFTS.models.ensemble.html"
title="next chapter">pyFTS.models.ensemble package</a></p>
@ -141,10 +141,11 @@
<li class="toctree-l2"><a class="reference internal" href="pyFTS.models.multivariate.html#submodules">Submodules</a></li>
<li class="toctree-l2"><a class="reference internal" href="pyFTS.models.multivariate.html#module-pyFTS.models.multivariate.FLR">pyFTS.models.multivariate.FLR module</a></li>
<li class="toctree-l2"><a class="reference internal" href="pyFTS.models.multivariate.html#module-pyFTS.models.multivariate.common">pyFTS.models.multivariate.common module</a></li>
<li class="toctree-l2"><a class="reference internal" href="pyFTS.models.multivariate.html#module-pyFTS.models.multivariate.variable">pyFTS.models.multivariate.variable module</a></li>
<li class="toctree-l2"><a class="reference internal" href="pyFTS.models.multivariate.html#module-pyFTS.models.multivariate.flrg">pyFTS.models.multivariate.flrg module</a></li>
<li class="toctree-l2"><a class="reference internal" href="pyFTS.models.multivariate.html#module-pyFTS.models.multivariate.mvfts">pyFTS.models.multivariate.mvfts module</a></li>
<li class="toctree-l2"><a class="reference internal" href="pyFTS.models.multivariate.html#module-pyFTS.models.multivariate.variable">pyFTS.models.multivariate.variable module</a></li>
<li class="toctree-l2"><a class="reference internal" href="pyFTS.models.multivariate.html#pyfts-models-multivariate-wmvfts-module">pyFTS.models.multivariate.wmvfts module</a></li>
<li class="toctree-l2"><a class="reference internal" href="pyFTS.models.multivariate.html#module-pyFTS.models.multivariate.wmvfts">pyFTS.models.multivariate.wmvfts module</a></li>
<li class="toctree-l2"><a class="reference internal" href="pyFTS.models.multivariate.html#module-pyFTS.models.multivariate.cmvfts">pyFTS.models.multivariate.cmvfts module</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="pyFTS.models.nonstationary.html">pyFTS.models.nonstationary package</a><ul>
@ -476,11 +477,21 @@ using Fuzzy Time Series. 2017 IEEE International Conference on Fuzzy Systems. DO
<code class="descname">generate_flrg</code><span class="sig-paren">(</span><em>data</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pyFTS/models/hofts.html#HighOrderFTS.generate_flrg"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyFTS.models.hofts.HighOrderFTS.generate_flrg" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="pyFTS.models.hofts.HighOrderFTS.generate_flrg_fuzzyfied">
<code class="descname">generate_flrg_fuzzyfied</code><span class="sig-paren">(</span><em>data</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pyFTS/models/hofts.html#HighOrderFTS.generate_flrg_fuzzyfied"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyFTS.models.hofts.HighOrderFTS.generate_flrg_fuzzyfied" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="pyFTS.models.hofts.HighOrderFTS.generate_lhs_flrg">
<code class="descname">generate_lhs_flrg</code><span class="sig-paren">(</span><em>sample</em>, <em>explain=False</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pyFTS/models/hofts.html#HighOrderFTS.generate_lhs_flrg"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyFTS.models.hofts.HighOrderFTS.generate_lhs_flrg" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="pyFTS.models.hofts.HighOrderFTS.generate_lhs_flrg_fuzzyfied">
<code class="descname">generate_lhs_flrg_fuzzyfied</code><span class="sig-paren">(</span><em>sample</em>, <em>explain=False</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pyFTS/models/hofts.html#HighOrderFTS.generate_lhs_flrg_fuzzyfied"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyFTS.models.hofts.HighOrderFTS.generate_lhs_flrg_fuzzyfied" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="pyFTS.models.hofts.HighOrderFTS.train">
<code class="descname">train</code><span class="sig-paren">(</span><em>data</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pyFTS/models/hofts.html#HighOrderFTS.train"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyFTS.models.hofts.HighOrderFTS.train" title="Permalink to this definition"></a></dt>
@ -501,6 +512,56 @@ using Fuzzy Time Series. 2017 IEEE International Conference on Fuzzy Systems. DO
</dd></dl>
<dl class="class">
<dt id="pyFTS.models.hofts.WeightedHighOrderFLRG">
<em class="property">class </em><code class="descclassname">pyFTS.models.hofts.</code><code class="descname">WeightedHighOrderFLRG</code><span class="sig-paren">(</span><em>order</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pyFTS/models/hofts.html#WeightedHighOrderFLRG"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyFTS.models.hofts.WeightedHighOrderFLRG" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference internal" href="pyFTS.common.html#pyFTS.common.flrg.FLRG" title="pyFTS.common.flrg.FLRG"><code class="xref py py-class docutils literal notranslate"><span class="pre">pyFTS.common.flrg.FLRG</span></code></a></p>
<p>Weighted High Order Fuzzy Logical Relationship Group</p>
<dl class="method">
<dt id="pyFTS.models.hofts.WeightedHighOrderFLRG.append_lhs">
<code class="descname">append_lhs</code><span class="sig-paren">(</span><em>c</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pyFTS/models/hofts.html#WeightedHighOrderFLRG.append_lhs"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyFTS.models.hofts.WeightedHighOrderFLRG.append_lhs" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="pyFTS.models.hofts.WeightedHighOrderFLRG.append_rhs">
<code class="descname">append_rhs</code><span class="sig-paren">(</span><em>fset</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pyFTS/models/hofts.html#WeightedHighOrderFLRG.append_rhs"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyFTS.models.hofts.WeightedHighOrderFLRG.append_rhs" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="pyFTS.models.hofts.WeightedHighOrderFLRG.get_midpoint">
<code class="descname">get_midpoint</code><span class="sig-paren">(</span><em>sets</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pyFTS/models/hofts.html#WeightedHighOrderFLRG.get_midpoint"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyFTS.models.hofts.WeightedHighOrderFLRG.get_midpoint" title="Permalink to this definition"></a></dt>
<dd><p>Returns the midpoint value for the RHS fuzzy sets</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>sets</strong> fuzzy sets</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">the midpoint value</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="pyFTS.models.hofts.WeightedHighOrderFLRG.weights">
<code class="descname">weights</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/pyFTS/models/hofts.html#WeightedHighOrderFLRG.weights"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyFTS.models.hofts.WeightedHighOrderFLRG.weights" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="class">
<dt id="pyFTS.models.hofts.WeightedHighOrderFTS">
<em class="property">class </em><code class="descclassname">pyFTS.models.hofts.</code><code class="descname">WeightedHighOrderFTS</code><span class="sig-paren">(</span><em>**kwargs</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pyFTS/models/hofts.html#WeightedHighOrderFTS"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyFTS.models.hofts.WeightedHighOrderFTS" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference internal" href="#pyFTS.models.hofts.HighOrderFTS" title="pyFTS.models.hofts.HighOrderFTS"><code class="xref py py-class docutils literal notranslate"><span class="pre">pyFTS.models.hofts.HighOrderFTS</span></code></a></p>
<p>Weighted High Order Fuzzy Time Series</p>
<dl class="method">
<dt id="pyFTS.models.hofts.WeightedHighOrderFTS.generate_lhs_flrg_fuzzyfied">
<code class="descname">generate_lhs_flrg_fuzzyfied</code><span class="sig-paren">(</span><em>sample</em>, <em>explain=False</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pyFTS/models/hofts.html#WeightedHighOrderFTS.generate_lhs_flrg_fuzzyfied"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyFTS.models.hofts.WeightedHighOrderFTS.generate_lhs_flrg_fuzzyfied" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
</div>
<div class="section" id="module-pyFTS.models.hwang">
<span id="pyfts-models-hwang-module"></span><h2>pyFTS.models.hwang module<a class="headerlink" href="#module-pyFTS.models.hwang" title="Permalink to this headline"></a></h2>
@ -831,7 +892,7 @@ US Dollar to Ringgit Malaysia,” Int. J. Comput. Intell. Appl., vol. 12, no. 1,
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>data</strong> time series data with the minimal length equal to the max_lag of the model</li>
<li><strong>steps</strong> the number of steps ahead to forecast</li>
<li><strong>kwargs</strong> model specific parameters</li>
<li><strong>start</strong> in the multi step forecasting, the index of the data where to start forecasting</li>
</ul>
</td>
</tr>
@ -1099,7 +1160,7 @@ refined exponentially weighted fuzzy time series and an improved harmony search,
<a href="pyFTS.models.ensemble.html" title="pyFTS.models.ensemble package"
>next</a> |</li>
<li class="right" >
<a href="pyFTS.data.html" title="pyFTS.data package"
<a href="pyFTS.hyperparam.html" title="pyFTS.hyperparam package"
>previous</a> |</li>
<li class="nav-item nav-item-0"><a href="index.html">pyFTS 1.2.3 documentation</a> &#187;</li>
<li class="nav-item nav-item-1"><a href="modules.html" >pyFTS</a> &#187;</li>

View File

@ -68,10 +68,11 @@
<li><a class="reference internal" href="#submodules">Submodules</a></li>
<li><a class="reference internal" href="#module-pyFTS.models.multivariate.FLR">pyFTS.models.multivariate.FLR module</a></li>
<li><a class="reference internal" href="#module-pyFTS.models.multivariate.common">pyFTS.models.multivariate.common module</a></li>
<li><a class="reference internal" href="#module-pyFTS.models.multivariate.variable">pyFTS.models.multivariate.variable module</a></li>
<li><a class="reference internal" href="#module-pyFTS.models.multivariate.flrg">pyFTS.models.multivariate.flrg module</a></li>
<li><a class="reference internal" href="#module-pyFTS.models.multivariate.mvfts">pyFTS.models.multivariate.mvfts module</a></li>
<li><a class="reference internal" href="#module-pyFTS.models.multivariate.variable">pyFTS.models.multivariate.variable module</a></li>
<li><a class="reference internal" href="#pyfts-models-multivariate-wmvfts-module">pyFTS.models.multivariate.wmvfts module</a></li>
<li><a class="reference internal" href="#module-pyFTS.models.multivariate.wmvfts">pyFTS.models.multivariate.wmvfts module</a></li>
<li><a class="reference internal" href="#module-pyFTS.models.multivariate.cmvfts">pyFTS.models.multivariate.cmvfts module</a></li>
</ul>
</li>
</ul>
@ -140,11 +141,111 @@
</div>
<div class="section" id="module-pyFTS.models.multivariate.common">
<span id="pyfts-models-multivariate-common-module"></span><h2>pyFTS.models.multivariate.common module<a class="headerlink" href="#module-pyFTS.models.multivariate.common" title="Permalink to this headline"></a></h2>
<dl class="class">
<dt id="pyFTS.models.multivariate.common.MultivariateFuzzySet">
<em class="property">class </em><code class="descclassname">pyFTS.models.multivariate.common.</code><code class="descname">MultivariateFuzzySet</code><span class="sig-paren">(</span><em>name</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pyFTS/models/multivariate/common.html#MultivariateFuzzySet"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyFTS.models.multivariate.common.MultivariateFuzzySet" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference internal" href="pyFTS.common.html#pyFTS.common.Composite.FuzzySet" title="pyFTS.common.Composite.FuzzySet"><code class="xref py py-class docutils literal notranslate"><span class="pre">pyFTS.common.Composite.FuzzySet</span></code></a></p>
<p>Multivariate Composite Fuzzy Set</p>
<dl class="method">
<dt id="pyFTS.models.multivariate.common.MultivariateFuzzySet.append_set">
<code class="descname">append_set</code><span class="sig-paren">(</span><em>variable</em>, <em>set</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pyFTS/models/multivariate/common.html#MultivariateFuzzySet.append_set"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyFTS.models.multivariate.common.MultivariateFuzzySet.append_set" title="Permalink to this definition"></a></dt>
<dd><p>Appends a new fuzzy set from a new variable</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>variable</strong> an multivariate.variable instance</li>
<li><strong>set</strong> an common.FuzzySet instance</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="pyFTS.models.multivariate.common.MultivariateFuzzySet.membership">
<code class="descname">membership</code><span class="sig-paren">(</span><em>x</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pyFTS/models/multivariate/common.html#MultivariateFuzzySet.membership"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyFTS.models.multivariate.common.MultivariateFuzzySet.membership" title="Permalink to this definition"></a></dt>
<dd><p>Calculate the membership value of a given input</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>x</strong> input value</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">membership value of x at this fuzzy set</td>
</tr>
</tbody>
</table>
</dd></dl>
</dd></dl>
<dl class="function">
<dt id="pyFTS.models.multivariate.common.fuzzyfy_instance">
<code class="descclassname">pyFTS.models.multivariate.common.</code><code class="descname">fuzzyfy_instance</code><span class="sig-paren">(</span><em>data_point</em>, <em>var</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pyFTS/models/multivariate/common.html#fuzzyfy_instance"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyFTS.models.multivariate.common.fuzzyfy_instance" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="function">
<dt id="pyFTS.models.multivariate.common.fuzzyfy_instance_clustered">
<code class="descclassname">pyFTS.models.multivariate.common.</code><code class="descname">fuzzyfy_instance_clustered</code><span class="sig-paren">(</span><em>data_point</em>, <em>cluster</em>, <em>alpha_cut=0.0</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pyFTS/models/multivariate/common.html#fuzzyfy_instance_clustered"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyFTS.models.multivariate.common.fuzzyfy_instance_clustered" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</div>
<div class="section" id="module-pyFTS.models.multivariate.variable">
<span id="pyfts-models-multivariate-variable-module"></span><h2>pyFTS.models.multivariate.variable module<a class="headerlink" href="#module-pyFTS.models.multivariate.variable" title="Permalink to this headline"></a></h2>
<dl class="class">
<dt id="pyFTS.models.multivariate.variable.Variable">
<em class="property">class </em><code class="descclassname">pyFTS.models.multivariate.variable.</code><code class="descname">Variable</code><span class="sig-paren">(</span><em>name</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pyFTS/models/multivariate/variable.html#Variable"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyFTS.models.multivariate.variable.Variable" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference external" href="https://docs.python.org/3/library/functions.html#object" title="(in Python v3.7)"><code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></a></p>
<p>A variable of a fuzzy time series multivariate model. Each variable contains its own
transformations and partitioners.</p>
<dl class="attribute">
<dt id="pyFTS.models.multivariate.variable.Variable.alias">
<code class="descname">alias</code><em class="property"> = None</em><a class="headerlink" href="#pyFTS.models.multivariate.variable.Variable.alias" title="Permalink to this definition"></a></dt>
<dd><p>A string with the alias of the variable</p>
</dd></dl>
<dl class="method">
<dt id="pyFTS.models.multivariate.variable.Variable.apply_inverse_transformations">
<code class="descname">apply_inverse_transformations</code><span class="sig-paren">(</span><em>data</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pyFTS/models/multivariate/variable.html#Variable.apply_inverse_transformations"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyFTS.models.multivariate.variable.Variable.apply_inverse_transformations" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="pyFTS.models.multivariate.variable.Variable.apply_transformations">
<code class="descname">apply_transformations</code><span class="sig-paren">(</span><em>data</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pyFTS/models/multivariate/variable.html#Variable.apply_transformations"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyFTS.models.multivariate.variable.Variable.apply_transformations" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="pyFTS.models.multivariate.variable.Variable.build">
<code class="descname">build</code><span class="sig-paren">(</span><em>**kwargs</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pyFTS/models/multivariate/variable.html#Variable.build"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyFTS.models.multivariate.variable.Variable.build" title="Permalink to this definition"></a></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>kwargs</strong> </td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"></td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="attribute">
<dt id="pyFTS.models.multivariate.variable.Variable.data_label">
<code class="descname">data_label</code><em class="property"> = None</em><a class="headerlink" href="#pyFTS.models.multivariate.variable.Variable.data_label" title="Permalink to this definition"></a></dt>
<dd><p>A string with the column name on DataFrame</p>
</dd></dl>
<dl class="attribute">
<dt id="pyFTS.models.multivariate.variable.Variable.name">
<code class="descname">name</code><em class="property"> = None</em><a class="headerlink" href="#pyFTS.models.multivariate.variable.Variable.name" title="Permalink to this definition"></a></dt>
<dd><p>A string with the name of the variable</p>
</dd></dl>
</dd></dl>
</div>
<div class="section" id="module-pyFTS.models.multivariate.flrg">
<span id="pyfts-models-multivariate-flrg-module"></span><h2>pyFTS.models.multivariate.flrg module<a class="headerlink" href="#module-pyFTS.models.multivariate.flrg" title="Permalink to this headline"></a></h2>
@ -268,6 +369,28 @@
</table>
</dd></dl>
<dl class="method">
<dt id="pyFTS.models.multivariate.mvfts.MVFTS.forecast_ahead">
<code class="descname">forecast_ahead</code><span class="sig-paren">(</span><em>data</em>, <em>steps</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pyFTS/models/multivariate/mvfts.html#MVFTS.forecast_ahead"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyFTS.models.multivariate.mvfts.MVFTS.forecast_ahead" title="Permalink to this definition"></a></dt>
<dd><p>Point forecast n steps ahead</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>data</strong> time series data with the minimal length equal to the max_lag of the model</li>
<li><strong>steps</strong> the number of steps ahead to forecast</li>
<li><strong>start</strong> in the multi step forecasting, the index of the data where to start forecasting</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">a list with the forecasted values</p>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="pyFTS.models.multivariate.mvfts.MVFTS.format_data">
<code class="descname">format_data</code><span class="sig-paren">(</span><em>data</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pyFTS/models/multivariate/mvfts.html#MVFTS.format_data"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyFTS.models.multivariate.mvfts.MVFTS.format_data" title="Permalink to this definition"></a></dt>
@ -309,123 +432,82 @@
</dd></dl>
</div>
<div class="section" id="module-pyFTS.models.multivariate.variable">
<span id="pyfts-models-multivariate-variable-module"></span><h2>pyFTS.models.multivariate.variable module<a class="headerlink" href="#module-pyFTS.models.multivariate.variable" title="Permalink to this headline"></a></h2>
<div class="section" id="module-pyFTS.models.multivariate.wmvfts">
<span id="pyfts-models-multivariate-wmvfts-module"></span><h2>pyFTS.models.multivariate.wmvfts module<a class="headerlink" href="#module-pyFTS.models.multivariate.wmvfts" title="Permalink to this headline"></a></h2>
<dl class="class">
<dt id="pyFTS.models.multivariate.variable.Variable">
<em class="property">class </em><code class="descclassname">pyFTS.models.multivariate.variable.</code><code class="descname">Variable</code><span class="sig-paren">(</span><em>name</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pyFTS/models/multivariate/variable.html#Variable"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyFTS.models.multivariate.variable.Variable" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference external" href="https://docs.python.org/3/library/functions.html#object" title="(in Python v3.7)"><code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></a></p>
<p>A variable of a fuzzy time series multivariate model. Each variable contains its own
transformations and partitioners.</p>
<dl class="attribute">
<dt id="pyFTS.models.multivariate.variable.Variable.alias">
<code class="descname">alias</code><em class="property"> = None</em><a class="headerlink" href="#pyFTS.models.multivariate.variable.Variable.alias" title="Permalink to this definition"></a></dt>
<dd><p>A string with the alias of the variable</p>
</dd></dl>
<dt id="pyFTS.models.multivariate.wmvfts.WeightedFLRG">
<em class="property">class </em><code class="descclassname">pyFTS.models.multivariate.wmvfts.</code><code class="descname">WeightedFLRG</code><span class="sig-paren">(</span><em>**kwargs</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pyFTS/models/multivariate/wmvfts.html#WeightedFLRG"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyFTS.models.multivariate.wmvfts.WeightedFLRG" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference internal" href="#pyFTS.models.multivariate.flrg.FLRG" title="pyFTS.models.multivariate.flrg.FLRG"><code class="xref py py-class docutils literal notranslate"><span class="pre">pyFTS.models.multivariate.flrg.FLRG</span></code></a></p>
<p>Weighted Multivariate Fuzzy Logical Rule Group</p>
<dl class="method">
<dt id="pyFTS.models.multivariate.variable.Variable.apply_inverse_transformations">
<code class="descname">apply_inverse_transformations</code><span class="sig-paren">(</span><em>data</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pyFTS/models/multivariate/variable.html#Variable.apply_inverse_transformations"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyFTS.models.multivariate.variable.Variable.apply_inverse_transformations" title="Permalink to this definition"></a></dt>
<dt id="pyFTS.models.multivariate.wmvfts.WeightedFLRG.append_rhs">
<code class="descname">append_rhs</code><span class="sig-paren">(</span><em>fset</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pyFTS/models/multivariate/wmvfts.html#WeightedFLRG.append_rhs"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyFTS.models.multivariate.wmvfts.WeightedFLRG.append_rhs" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="pyFTS.models.multivariate.variable.Variable.apply_transformations">
<code class="descname">apply_transformations</code><span class="sig-paren">(</span><em>data</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pyFTS/models/multivariate/variable.html#Variable.apply_transformations"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyFTS.models.multivariate.variable.Variable.apply_transformations" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="pyFTS.models.multivariate.variable.Variable.build">
<code class="descname">build</code><span class="sig-paren">(</span><em>**kwargs</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pyFTS/models/multivariate/variable.html#Variable.build"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyFTS.models.multivariate.variable.Variable.build" title="Permalink to this definition"></a></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<dt id="pyFTS.models.multivariate.wmvfts.WeightedFLRG.get_midpoint">
<code class="descname">get_midpoint</code><span class="sig-paren">(</span><em>sets</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pyFTS/models/multivariate/wmvfts.html#WeightedFLRG.get_midpoint"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyFTS.models.multivariate.wmvfts.WeightedFLRG.get_midpoint" title="Permalink to this definition"></a></dt>
<dd><p>Returns the midpoint value for the RHS fuzzy sets</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>kwargs</strong> </td>
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>sets</strong> fuzzy sets</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"></td>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">the midpoint value</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="attribute">
<dt id="pyFTS.models.multivariate.variable.Variable.data_label">
<code class="descname">data_label</code><em class="property"> = None</em><a class="headerlink" href="#pyFTS.models.multivariate.variable.Variable.data_label" title="Permalink to this definition"></a></dt>
<dd><p>A string with the column name on DataFrame</p>
<dl class="method">
<dt id="pyFTS.models.multivariate.wmvfts.WeightedFLRG.weights">
<code class="descname">weights</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/pyFTS/models/multivariate/wmvfts.html#WeightedFLRG.weights"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyFTS.models.multivariate.wmvfts.WeightedFLRG.weights" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="attribute">
<dt id="pyFTS.models.multivariate.variable.Variable.name">
<code class="descname">name</code><em class="property"> = None</em><a class="headerlink" href="#pyFTS.models.multivariate.variable.Variable.name" title="Permalink to this definition"></a></dt>
<dd><p>A string with the name of the variable</p>
</dd></dl>
<dl class="class">
<dt id="pyFTS.models.multivariate.wmvfts.WeightedMVFTS">
<em class="property">class </em><code class="descclassname">pyFTS.models.multivariate.wmvfts.</code><code class="descname">WeightedMVFTS</code><span class="sig-paren">(</span><em>**kwargs</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pyFTS/models/multivariate/wmvfts.html#WeightedMVFTS"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyFTS.models.multivariate.wmvfts.WeightedMVFTS" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference internal" href="#pyFTS.models.multivariate.mvfts.MVFTS" title="pyFTS.models.multivariate.mvfts.MVFTS"><code class="xref py py-class docutils literal notranslate"><span class="pre">pyFTS.models.multivariate.mvfts.MVFTS</span></code></a></p>
<p>Weighted Multivariate FTS</p>
<dl class="method">
<dt id="pyFTS.models.multivariate.wmvfts.WeightedMVFTS.generate_flrg">
<code class="descname">generate_flrg</code><span class="sig-paren">(</span><em>flrs</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pyFTS/models/multivariate/wmvfts.html#WeightedMVFTS.generate_flrg"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyFTS.models.multivariate.wmvfts.WeightedMVFTS.generate_flrg" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
</div>
<div class="section" id="pyfts-models-multivariate-wmvfts-module">
<h2>pyFTS.models.multivariate.wmvfts module<a class="headerlink" href="#pyfts-models-multivariate-wmvfts-module" title="Permalink to this headline"></a></h2>
<span class="target" id="module-pyFTS.models.multivariate.mvfts"></span><dl class="class">
<dt>
<em class="property">class </em><code class="descclassname">pyFTS.models.multivariate.mvfts.</code><code class="descname">MVFTS</code><span class="sig-paren">(</span><em>**kwargs</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pyFTS/models/multivariate/mvfts.html#MVFTS"><span class="viewcode-link">[source]</span></a></dt>
<dd><p>Bases: <a class="reference internal" href="pyFTS.common.html#pyFTS.common.fts.FTS" title="pyFTS.common.fts.FTS"><code class="xref py py-class docutils literal notranslate"><span class="pre">pyFTS.common.fts.FTS</span></code></a></p>
<p>Multivariate extension of Chens ConventionalFTS method</p>
<dl class="method">
<dt>
<code class="descname">append_variable</code><span class="sig-paren">(</span><em>var</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pyFTS/models/multivariate/mvfts.html#MVFTS.append_variable"><span class="viewcode-link">[source]</span></a></dt>
<dd><p>Append a new endogenous variable to the model</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>var</strong> variable object</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"></td>
</tr>
</tbody>
</table>
<div class="section" id="module-pyFTS.models.multivariate.cmvfts">
<span id="pyfts-models-multivariate-cmvfts-module"></span><h2>pyFTS.models.multivariate.cmvfts module<a class="headerlink" href="#module-pyFTS.models.multivariate.cmvfts" title="Permalink to this headline"></a></h2>
<dl class="class">
<dt id="pyFTS.models.multivariate.cmvfts.ClusteredMVFTS">
<em class="property">class </em><code class="descclassname">pyFTS.models.multivariate.cmvfts.</code><code class="descname">ClusteredMVFTS</code><span class="sig-paren">(</span><em>**kwargs</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pyFTS/models/multivariate/cmvfts.html#ClusteredMVFTS"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyFTS.models.multivariate.cmvfts.ClusteredMVFTS" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference internal" href="#pyFTS.models.multivariate.mvfts.MVFTS" title="pyFTS.models.multivariate.mvfts.MVFTS"><code class="xref py py-class docutils literal notranslate"><span class="pre">pyFTS.models.multivariate.mvfts.MVFTS</span></code></a></p>
<p>Meta model for multivariate, high order, clustered multivariate FTS</p>
<dl class="attribute">
<dt id="pyFTS.models.multivariate.cmvfts.ClusteredMVFTS.cluster">
<code class="descname">cluster</code><em class="property"> = None</em><a class="headerlink" href="#pyFTS.models.multivariate.cmvfts.ClusteredMVFTS.cluster" title="Permalink to this definition"></a></dt>
<dd><p>The most recent trained clusterer</p>
</dd></dl>
<dl class="attribute">
<dt id="pyFTS.models.multivariate.cmvfts.ClusteredMVFTS.cluster_method">
<code class="descname">cluster_method</code><em class="property"> = None</em><a class="headerlink" href="#pyFTS.models.multivariate.cmvfts.ClusteredMVFTS.cluster_method" title="Permalink to this definition"></a></dt>
<dd><p>The cluster method to be called when a new model is build</p>
</dd></dl>
<dl class="attribute">
<dt id="pyFTS.models.multivariate.cmvfts.ClusteredMVFTS.cluster_params">
<code class="descname">cluster_params</code><em class="property"> = None</em><a class="headerlink" href="#pyFTS.models.multivariate.cmvfts.ClusteredMVFTS.cluster_params" title="Permalink to this definition"></a></dt>
<dd><p>The cluster method parameters</p>
</dd></dl>
<dl class="method">
<dt>
<code class="descname">apply_transformations</code><span class="sig-paren">(</span><em>data</em>, <em>params=None</em>, <em>updateUoD=False</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pyFTS/models/multivariate/mvfts.html#MVFTS.apply_transformations"><span class="viewcode-link">[source]</span></a></dt>
<dd><p>Apply the data transformations for data preprocessing</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>data</strong> input data</li>
<li><strong>params</strong> transformation parameters</li>
<li><strong>updateUoD</strong> </li>
<li><strong>kwargs</strong> </li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">preprocessed data</p>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt>
<code class="descname">clone_parameters</code><span class="sig-paren">(</span><em>model</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pyFTS/models/multivariate/mvfts.html#MVFTS.clone_parameters"><span class="viewcode-link">[source]</span></a></dt>
<dd><p>Import the parameters values from other model</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>model</strong> </td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt>
<code class="descname">forecast</code><span class="sig-paren">(</span><em>data</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pyFTS/models/multivariate/mvfts.html#MVFTS.forecast"><span class="viewcode-link">[source]</span></a></dt>
<dt id="pyFTS.models.multivariate.cmvfts.ClusteredMVFTS.forecast">
<code class="descname">forecast</code><span class="sig-paren">(</span><em>ndata</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pyFTS/models/multivariate/cmvfts.html#ClusteredMVFTS.forecast"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyFTS.models.multivariate.cmvfts.ClusteredMVFTS.forecast" title="Permalink to this definition"></a></dt>
<dd><p>Point forecast one step ahead</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
@ -444,29 +526,32 @@ transformations and partitioners.</p>
</table>
</dd></dl>
<dl class="method">
<dt>
<code class="descname">format_data</code><span class="sig-paren">(</span><em>data</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pyFTS/models/multivariate/mvfts.html#MVFTS.format_data"><span class="viewcode-link">[source]</span></a></dt>
<dd></dd></dl>
<dl class="attribute">
<dt id="pyFTS.models.multivariate.cmvfts.ClusteredMVFTS.fts_method">
<code class="descname">fts_method</code><em class="property"> = None</em><a class="headerlink" href="#pyFTS.models.multivariate.cmvfts.ClusteredMVFTS.fts_method" title="Permalink to this definition"></a></dt>
<dd><p>The FTS method to be called when a new model is build</p>
</dd></dl>
<dl class="attribute">
<dt id="pyFTS.models.multivariate.cmvfts.ClusteredMVFTS.fts_params">
<code class="descname">fts_params</code><em class="property"> = None</em><a class="headerlink" href="#pyFTS.models.multivariate.cmvfts.ClusteredMVFTS.fts_params" title="Permalink to this definition"></a></dt>
<dd><p>The FTS method specific parameters</p>
</dd></dl>
<dl class="method">
<dt>
<code class="descname">generate_flrg</code><span class="sig-paren">(</span><em>flrs</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pyFTS/models/multivariate/mvfts.html#MVFTS.generate_flrg"><span class="viewcode-link">[source]</span></a></dt>
<dt id="pyFTS.models.multivariate.cmvfts.ClusteredMVFTS.fuzzyfy">
<code class="descname">fuzzyfy</code><span class="sig-paren">(</span><em>data</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pyFTS/models/multivariate/cmvfts.html#ClusteredMVFTS.fuzzyfy"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyFTS.models.multivariate.cmvfts.ClusteredMVFTS.fuzzyfy" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="method">
<dt>
<code class="descname">generate_flrs</code><span class="sig-paren">(</span><em>data</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pyFTS/models/multivariate/mvfts.html#MVFTS.generate_flrs"><span class="viewcode-link">[source]</span></a></dt>
<dd></dd></dl>
<dl class="attribute">
<dt id="pyFTS.models.multivariate.cmvfts.ClusteredMVFTS.model">
<code class="descname">model</code><em class="property"> = None</em><a class="headerlink" href="#pyFTS.models.multivariate.cmvfts.ClusteredMVFTS.model" title="Permalink to this definition"></a></dt>
<dd><p>The most recent trained model</p>
</dd></dl>
<dl class="method">
<dt>
<code class="descname">generate_lhs_flrs</code><span class="sig-paren">(</span><em>data</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pyFTS/models/multivariate/mvfts.html#MVFTS.generate_lhs_flrs"><span class="viewcode-link">[source]</span></a></dt>
<dd></dd></dl>
<dl class="method">
<dt>
<code class="descname">train</code><span class="sig-paren">(</span><em>data</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pyFTS/models/multivariate/mvfts.html#MVFTS.train"><span class="viewcode-link">[source]</span></a></dt>
<dt id="pyFTS.models.multivariate.cmvfts.ClusteredMVFTS.train">
<code class="descname">train</code><span class="sig-paren">(</span><em>data</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pyFTS/models/multivariate/cmvfts.html#ClusteredMVFTS.train"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyFTS.models.multivariate.cmvfts.ClusteredMVFTS.train" title="Permalink to this definition"></a></dt>
<dd><p>Method specific parameter fitting</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />

View File

@ -299,7 +299,7 @@
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>data</strong> time series data with the minimal length equal to the max_lag of the model</li>
<li><strong>steps</strong> the number of steps ahead to forecast</li>
<li><strong>kwargs</strong> model specific parameters</li>
<li><strong>start</strong> in the multi step forecasting, the index of the data where to start forecasting</li>
</ul>
</td>
</tr>
@ -525,7 +525,7 @@
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>data</strong> time series data with the minimal length equal to the max_lag of the model</li>
<li><strong>steps</strong> the number of steps ahead to forecast</li>
<li><strong>kwargs</strong> model specific parameters</li>
<li><strong>start</strong> in the multi step forecasting, the index of the data where to start forecasting</li>
</ul>
</td>
</tr>

View File

@ -71,7 +71,7 @@
<li><a class="reference internal" href="#module-pyFTS.partitioners.FCM">pyFTS.partitioners.FCM module</a></li>
<li><a class="reference internal" href="#module-pyFTS.partitioners.Grid">pyFTS.partitioners.Grid module</a></li>
<li><a class="reference internal" href="#module-pyFTS.partitioners.Huarng">pyFTS.partitioners.Huarng module</a></li>
<li><a class="reference internal" href="#pyfts-partitioners-singleton-module">pyFTS.partitioners.Singleton module</a></li>
<li><a class="reference internal" href="#module-pyFTS.partitioners.Singleton">pyFTS.partitioners.Singleton module</a></li>
<li><a class="reference internal" href="#module-pyFTS.partitioners.Util">pyFTS.partitioners.Util module</a></li>
<li><a class="reference internal" href="#module-pyFTS.partitioners.parallel_util">pyFTS.partitioners.parallel_util module</a></li>
</ul>
@ -241,6 +241,12 @@
<dd><p>data transformation to be applied on data</p>
</dd></dl>
<dl class="attribute">
<dt id="pyFTS.partitioners.partitioner.Partitioner.type">
<code class="descname">type</code><em class="property"> = None</em><a class="headerlink" href="#pyFTS.partitioners.partitioner.Partitioner.type" title="Permalink to this definition"></a></dt>
<dd><p>The type of fuzzy sets that are generated by this partitioner</p>
</dd></dl>
<dl class="method">
<dt id="pyFTS.partitioners.partitioner.Partitioner.upper_set">
<code class="descname">upper_set</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/pyFTS/partitioners/partitioner.html#Partitioner.upper_set"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyFTS.partitioners.partitioner.Partitioner.upper_set" title="Permalink to this definition"></a></dt>
@ -255,6 +261,12 @@
</table>
</dd></dl>
<dl class="attribute">
<dt id="pyFTS.partitioners.partitioner.Partitioner.variable">
<code class="descname">variable</code><em class="property"> = None</em><a class="headerlink" href="#pyFTS.partitioners.partitioner.Partitioner.variable" title="Permalink to this definition"></a></dt>
<dd><p>In a multivariate context, the variable that contains this partitioner</p>
</dd></dl>
</dd></dl>
</div>
@ -448,9 +460,9 @@ Fuzzy Sets Syst., vol. 123, no. 3, pp. 387394, Nov. 2001.</p>
</dd></dl>
</div>
<div class="section" id="pyfts-partitioners-singleton-module">
<h2>pyFTS.partitioners.Singleton module<a class="headerlink" href="#pyfts-partitioners-singleton-module" title="Permalink to this headline"></a></h2>
<span class="target" id="module-pyFTS.partitioners.Singleton"></span><p>Even Length Grid Partitioner</p>
<div class="section" id="module-pyFTS.partitioners.Singleton">
<span id="pyfts-partitioners-singleton-module"></span><h2>pyFTS.partitioners.Singleton module<a class="headerlink" href="#module-pyFTS.partitioners.Singleton" title="Permalink to this headline"></a></h2>
<p>Even Length Grid Partitioner</p>
<dl class="class">
<dt id="pyFTS.partitioners.Singleton.SingletonPartitioner">
<em class="property">class </em><code class="descclassname">pyFTS.partitioners.Singleton.</code><code class="descname">SingletonPartitioner</code><span class="sig-paren">(</span><em>**kwargs</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pyFTS/partitioners/Singleton.html#SingletonPartitioner"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyFTS.partitioners.Singleton.SingletonPartitioner" title="Permalink to this definition"></a></dt>

File diff suppressed because one or more lines are too long

View File

@ -29,6 +29,14 @@ pyFTS.models.multivariate.common module
:undoc-members:
:show-inheritance:
pyFTS.models.multivariate.variable module
-----------------------------------------
.. automodule:: pyFTS.models.multivariate.variable
:members:
:undoc-members:
:show-inheritance:
pyFTS.models.multivariate.flrg module
-------------------------------------
@ -44,19 +52,19 @@ pyFTS.models.multivariate.mvfts module
:members:
:undoc-members:
:show-inheritance:
pyFTS.models.multivariate.wmvfts module
---------------------------------------
pyFTS.models.multivariate.variable module
-----------------------------------------
.. automodule:: pyFTS.models.multivariate.variable
.. automodule:: pyFTS.models.multivariate.wmvfts
:members:
:undoc-members:
:show-inheritance:
pyFTS.models.multivariate.wmvfts module
--------------------------------------
pyFTS.models.multivariate.cmvfts module
---------------------------------------
.. automodule:: pyFTS.models.multivariate.mvfts
.. automodule:: pyFTS.models.multivariate.cmvfts
:members:
:undoc-members:
:show-inheritance:

View File

@ -61,7 +61,7 @@ pyFTS.partitioners.Huarng module
:show-inheritance:
pyFTS.partitioners.Singleton module
--------------------------------
-----------------------------------
.. automodule:: pyFTS.partitioners.Singleton
:members:

View File

@ -9,6 +9,7 @@ Subpackages
pyFTS.benchmarks
pyFTS.common
pyFTS.data
pyFTS.hyperparam
pyFTS.models
pyFTS.partitioners
pyFTS.probabilistic

View File

@ -94,6 +94,9 @@ class FTS(object):
:keyword distributed: boolean, indicate if the forecasting procedure will be distributed in a dispy cluster
:keyword nodes: a list with the dispy cluster nodes addresses
:keyword explain: try to explain, step by step, the one-step-ahead point forecasting result given the input data.
:keyword generators: for multivariate methods on multi step ahead forecasting, generators is a dict where the keys
are the variables names (except the target_variable) and the values are lambda functions that
accept one value (the actual value of the variable) and return the next value.
:return: a numpy array with the forecasted data
"""
@ -187,10 +190,12 @@ class FTS(object):
:param data: time series data with the minimal length equal to the max_lag of the model
:param steps: the number of steps ahead to forecast
:param kwargs: model specific parameters
:keyword start: in the multi step forecasting, the index of the data where to start forecasting
:return: a list with the forecasted values
"""
if isinstance(data, np.ndarray):
data = data.tolist()

View File

@ -130,6 +130,7 @@ class MVFTS(fts.FTS):
def forecast_ahead(self, data, steps, **kwargs):
generators = kwargs.get('generators',None)
start = kwargs.get('start', 0)
if generators is None:
raise Exception('You must provide parameter \'generators\'! generators is a dict where the keys' +