Updating the documentation
This commit is contained in:
parent
66e41f42ee
commit
0017d471b5
BIN
docs/build/doctrees/environment.pickle
vendored
BIN
docs/build/doctrees/environment.pickle
vendored
Binary file not shown.
BIN
docs/build/doctrees/pyFTS.common.doctree
vendored
BIN
docs/build/doctrees/pyFTS.common.doctree
vendored
Binary file not shown.
Binary file not shown.
BIN
docs/build/doctrees/pyFTS.partitioners.doctree
vendored
BIN
docs/build/doctrees/pyFTS.partitioners.doctree
vendored
Binary file not shown.
@ -142,7 +142,7 @@
|
|||||||
<span class="n">targets</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">targets</span><span class="p">)</span>
|
<span class="n">targets</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">targets</span><span class="p">)</span>
|
||||||
<span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">forecasts</span><span class="p">,</span> <span class="nb">list</span><span class="p">):</span>
|
<span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">forecasts</span><span class="p">,</span> <span class="nb">list</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">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="k">return</span> <span class="n">np</span><span class="o">.</span><span class="n">mean</span><span class="p">(</span><span class="n">np</span><span class="o">.</span><span class="n">abs</span><span class="p">((</span><span class="n">targets</span> <span class="o">-</span> <span class="n">forecasts</span><span class="p">)</span> <span class="o">/</span> <span class="n">targets</span><span class="p">))</span> <span class="o">*</span> <span class="mi">100</span></div>
|
<span class="k">return</span> <span class="n">np</span><span class="o">.</span><span class="n">mean</span><span class="p">(</span><span class="n">np</span><span class="o">.</span><span class="n">abs</span><span class="p">(</span><span class="n">np</span><span class="o">.</span><span class="n">divide</span><span class="p">((</span><span class="n">targets</span> <span class="o">-</span> <span class="n">forecasts</span><span class="p">),</span> <span class="n">targets</span><span class="p">)))</span> <span class="o">*</span> <span class="mi">100</span></div>
|
||||||
|
|
||||||
|
|
||||||
<div class="viewcode-block" id="smape"><a class="viewcode-back" href="../../../pyFTS.benchmarks.html#pyFTS.benchmarks.Measures.smape">[docs]</a><span class="k">def</span> <span class="nf">smape</span><span class="p">(</span><span class="n">targets</span><span class="p">,</span> <span class="n">forecasts</span><span class="p">,</span> <span class="nb">type</span><span class="o">=</span><span class="mi">2</span><span class="p">):</span>
|
<div class="viewcode-block" id="smape"><a class="viewcode-back" href="../../../pyFTS.benchmarks.html#pyFTS.benchmarks.Measures.smape">[docs]</a><span class="k">def</span> <span class="nf">smape</span><span class="p">(</span><span class="n">targets</span><span class="p">,</span> <span class="n">forecasts</span><span class="p">,</span> <span class="nb">type</span><span class="o">=</span><span class="mi">2</span><span class="p">):</span>
|
||||||
|
@ -100,6 +100,10 @@
|
|||||||
<span class="bp">self</span><span class="o">.</span><span class="n">mf</span> <span class="o">=</span> <span class="p">[]</span>
|
<span class="bp">self</span><span class="o">.</span><span class="n">mf</span> <span class="o">=</span> <span class="p">[]</span>
|
||||||
<span class="bp">self</span><span class="o">.</span><span class="n">parameters</span> <span class="o">=</span> <span class="p">[]</span>
|
<span class="bp">self</span><span class="o">.</span><span class="n">parameters</span> <span class="o">=</span> <span class="p">[]</span>
|
||||||
|
|
||||||
|
<span class="bp">self</span><span class="o">.</span><span class="n">lower</span> <span class="o">=</span> <span class="kc">None</span>
|
||||||
|
<span class="bp">self</span><span class="o">.</span><span class="n">upper</span> <span class="o">=</span> <span class="kc">None</span>
|
||||||
|
<span class="bp">self</span><span class="o">.</span><span class="n">centroid</span> <span class="o">=</span> <span class="kc">None</span>
|
||||||
|
|
||||||
|
|
||||||
<div class="viewcode-block" id="FuzzySet.membership"><a class="viewcode-back" href="../../../pyFTS.common.html#pyFTS.common.Composite.FuzzySet.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>
|
<div class="viewcode-block" id="FuzzySet.membership"><a class="viewcode-back" href="../../../pyFTS.common.html#pyFTS.common.Composite.FuzzySet.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="sd">"""</span>
|
<span class="sd">"""</span>
|
||||||
@ -135,7 +139,17 @@
|
|||||||
<span class="sd"> :param parameters:</span>
|
<span class="sd"> :param parameters:</span>
|
||||||
<span class="sd"> :return:</span>
|
<span class="sd"> :return:</span>
|
||||||
<span class="sd"> """</span>
|
<span class="sd"> """</span>
|
||||||
<span class="bp">self</span><span class="o">.</span><span class="n">sets</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="nb">set</span><span class="p">)</span></div></div>
|
<span class="bp">self</span><span class="o">.</span><span class="n">sets</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="nb">set</span><span class="p">)</span>
|
||||||
|
|
||||||
|
<span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">lower</span> <span class="ow">is</span> <span class="kc">None</span> <span class="ow">or</span> <span class="bp">self</span><span class="o">.</span><span class="n">lower</span> <span class="o">></span> <span class="nb">set</span><span class="o">.</span><span class="n">lower</span><span class="p">:</span>
|
||||||
|
<span class="bp">self</span><span class="o">.</span><span class="n">lower</span> <span class="o">=</span> <span class="nb">set</span><span class="o">.</span><span class="n">lower</span>
|
||||||
|
|
||||||
|
<span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">upper</span> <span class="ow">is</span> <span class="kc">None</span> <span class="ow">or</span> <span class="bp">self</span><span class="o">.</span><span class="n">upper</span> <span class="o"><</span> <span class="nb">set</span><span class="o">.</span><span class="n">upper</span><span class="p">:</span>
|
||||||
|
<span class="bp">self</span><span class="o">.</span><span class="n">upper</span> <span class="o">=</span> <span class="nb">set</span><span class="o">.</span><span class="n">upper</span>
|
||||||
|
|
||||||
|
<span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">centroid</span> <span class="ow">is</span> <span class="kc">None</span> <span class="ow">or</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><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>
|
||||||
|
|
||||||
</pre></div>
|
</pre></div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
@ -102,6 +102,7 @@
|
|||||||
<span class="bp">self</span><span class="o">.</span><span class="n">Z</span> <span class="o">=</span> <span class="kc">None</span>
|
<span class="bp">self</span><span class="o">.</span><span class="n">Z</span> <span class="o">=</span> <span class="kc">None</span>
|
||||||
<span class="sd">"""Partition function in respect to the membership function"""</span>
|
<span class="sd">"""Partition function in respect to the membership function"""</span>
|
||||||
|
|
||||||
|
<span class="k">if</span> <span class="n">parameters</span> <span class="ow">is</span> <span class="ow">not</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">mf</span> <span class="o">==</span> <span class="n">Membership</span><span class="o">.</span><span class="n">gaussmf</span><span class="p">:</span>
|
<span class="k">if</span> <span class="bp">self</span><span class="o">.</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="p">:</span>
|
||||||
<span class="bp">self</span><span class="o">.</span><span class="n">lower</span> <span class="o">=</span> <span class="n">parameters</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> <span class="o">-</span> <span class="n">parameters</span><span class="p">[</span><span class="mi">1</span><span class="p">]</span><span class="o">*</span><span class="mi">3</span>
|
<span class="bp">self</span><span class="o">.</span><span class="n">lower</span> <span class="o">=</span> <span class="n">parameters</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> <span class="o">-</span> <span class="n">parameters</span><span class="p">[</span><span class="mi">1</span><span class="p">]</span><span class="o">*</span><span class="mi">3</span>
|
||||||
<span class="bp">self</span><span class="o">.</span><span class="n">upper</span> <span class="o">=</span> <span class="n">parameters</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> <span class="o">+</span> <span class="n">parameters</span><span class="p">[</span><span class="mi">1</span><span class="p">]</span><span class="o">*</span><span class="mi">3</span>
|
<span class="bp">self</span><span class="o">.</span><span class="n">upper</span> <span class="o">=</span> <span class="n">parameters</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> <span class="o">+</span> <span class="n">parameters</span><span class="p">[</span><span class="mi">1</span><span class="p">]</span><span class="o">*</span><span class="mi">3</span>
|
||||||
@ -198,6 +199,7 @@
|
|||||||
<span class="sd"> :keyword method: the fuzzyfication method (fuzzy: all fuzzy memberships, maximum: only the maximum membership)</span>
|
<span class="sd"> :keyword method: the fuzzyfication method (fuzzy: all fuzzy memberships, maximum: only the maximum membership)</span>
|
||||||
<span class="sd"> :keyword mode: the fuzzyfication mode (sets: return the fuzzy sets names, vector: return a vector with the membership</span>
|
<span class="sd"> :keyword mode: the fuzzyfication mode (sets: return the fuzzy sets names, vector: return a vector with the membership</span>
|
||||||
<span class="sd"> values for all fuzzy sets, both: return a list with tuples (fuzzy set, membership value) )</span>
|
<span class="sd"> values for all fuzzy sets, both: return a list with tuples (fuzzy set, membership value) )</span>
|
||||||
|
<span class="sd"> </span>
|
||||||
<span class="sd"> :returns a list with the fuzzyfied values, depending on the mode</span>
|
<span class="sd"> :returns a list with the fuzzyfied values, depending on the mode</span>
|
||||||
<span class="sd"> """</span>
|
<span class="sd"> """</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">'alpha_cut'</span><span class="p">,</span> <span class="mf">0.</span><span class="p">)</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">'alpha_cut'</span><span class="p">,</span> <span class="mf">0.</span><span class="p">)</span>
|
||||||
|
@ -148,7 +148,7 @@
|
|||||||
|
|
||||||
<span class="sd"> :param x:</span>
|
<span class="sd"> :param x:</span>
|
||||||
<span class="sd"> :param parameters: an list with 2 real values (smoothness and midpoint)</span>
|
<span class="sd"> :param parameters: an list with 2 real values (smoothness and midpoint)</span>
|
||||||
<span class="sd"> :return:</span>
|
<span class="sd"> :return</span>
|
||||||
<span class="sd"> """</span>
|
<span class="sd"> """</span>
|
||||||
<span class="k">return</span> <span class="mi">1</span> <span class="o">/</span> <span class="p">(</span><span class="mi">1</span> <span class="o">+</span> <span class="n">math</span><span class="o">.</span><span class="n">exp</span><span class="p">(</span><span class="o">-</span><span class="n">parameters</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> <span class="o">*</span> <span class="p">(</span><span class="n">x</span> <span class="o">-</span> <span class="n">parameters</span><span class="p">[</span><span class="mi">1</span><span class="p">])))</span></div>
|
<span class="k">return</span> <span class="mi">1</span> <span class="o">/</span> <span class="p">(</span><span class="mi">1</span> <span class="o">+</span> <span class="n">math</span><span class="o">.</span><span class="n">exp</span><span class="p">(</span><span class="o">-</span><span class="n">parameters</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> <span class="o">*</span> <span class="p">(</span><span class="n">x</span> <span class="o">-</span> <span class="n">parameters</span><span class="p">[</span><span class="mi">1</span><span class="p">])))</span></div>
|
||||||
|
|
||||||
|
127
docs/build/html/_modules/pyFTS/common/Util.html
vendored
127
docs/build/html/_modules/pyFTS/common/Util.html
vendored
@ -199,8 +199,8 @@
|
|||||||
<span class="sd"> :param flag: if True the image will be saved</span>
|
<span class="sd"> :param flag: if True the image will be saved</span>
|
||||||
<span class="sd"> :param lgd: legend</span>
|
<span class="sd"> :param lgd: legend</span>
|
||||||
<span class="sd"> """</span>
|
<span class="sd"> """</span>
|
||||||
<span class="k">if</span> <span class="n">flag</span><span class="p">:</span>
|
|
||||||
<span class="n">plt</span><span class="o">.</span><span class="n">show</span><span class="p">()</span>
|
<span class="n">plt</span><span class="o">.</span><span class="n">show</span><span class="p">()</span>
|
||||||
|
<span class="k">if</span> <span class="n">flag</span><span class="p">:</span>
|
||||||
<span class="k">if</span> <span class="n">lgd</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span>
|
<span class="k">if</span> <span class="n">lgd</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span>
|
||||||
<span class="n">fig</span><span class="o">.</span><span class="n">savefig</span><span class="p">(</span><span class="n">file</span><span class="p">,</span> <span class="n">additional_artists</span><span class="o">=</span><span class="n">lgd</span><span class="p">,</span><span class="n">bbox_inches</span><span class="o">=</span><span class="s1">'tight'</span><span class="p">)</span> <span class="c1">#bbox_extra_artists=(lgd,), )</span>
|
<span class="n">fig</span><span class="o">.</span><span class="n">savefig</span><span class="p">(</span><span class="n">file</span><span class="p">,</span> <span class="n">additional_artists</span><span class="o">=</span><span class="n">lgd</span><span class="p">,</span><span class="n">bbox_inches</span><span class="o">=</span><span class="s1">'tight'</span><span class="p">)</span> <span class="c1">#bbox_extra_artists=(lgd,), )</span>
|
||||||
<span class="k">else</span><span class="p">:</span>
|
<span class="k">else</span><span class="p">:</span>
|
||||||
@ -281,131 +281,6 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div class="viewcode-block" id="start_dispy_cluster"><a class="viewcode-back" href="../../../pyFTS.common.html#pyFTS.common.Util.start_dispy_cluster">[docs]</a><span class="k">def</span> <span class="nf">start_dispy_cluster</span><span class="p">(</span><span class="n">method</span><span class="p">,</span> <span class="n">nodes</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">logging</span>
|
|
||||||
|
|
||||||
<span class="n">cluster</span> <span class="o">=</span> <span class="n">dispy</span><span class="o">.</span><span class="n">JobCluster</span><span class="p">(</span><span class="n">method</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">loglevel</span><span class="o">=</span><span class="n">logging</span><span class="o">.</span><span class="n">DEBUG</span><span class="p">,</span> <span class="n">ping_interval</span><span class="o">=</span><span class="mi">1000</span><span class="p">)</span>
|
|
||||||
|
|
||||||
<span class="n">http_server</span> <span class="o">=</span> <span class="n">dispy</span><span class="o">.</span><span class="n">httpd</span><span class="o">.</span><span class="n">DispyHTTPServer</span><span class="p">(</span><span class="n">cluster</span><span class="p">)</span>
|
|
||||||
|
|
||||||
<span class="k">return</span> <span class="n">cluster</span><span class="p">,</span> <span class="n">http_server</span></div>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div class="viewcode-block" id="stop_dispy_cluster"><a class="viewcode-back" href="../../../pyFTS.common.html#pyFTS.common.Util.stop_dispy_cluster">[docs]</a><span class="k">def</span> <span class="nf">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>
|
|
||||||
<span class="n">cluster</span><span class="o">.</span><span class="n">wait</span><span class="p">()</span> <span class="c1"># wait for all jobs to finish</span>
|
|
||||||
|
|
||||||
<span class="n">cluster</span><span class="o">.</span><span class="n">print_status</span><span class="p">()</span>
|
|
||||||
|
|
||||||
<span class="n">http_server</span><span class="o">.</span><span class="n">shutdown</span><span class="p">()</span> <span class="c1"># this waits until browser gets all updates</span>
|
|
||||||
<span class="n">cluster</span><span class="o">.</span><span class="n">close</span><span class="p">()</span></div>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div class="viewcode-block" id="simple_model_train"><a class="viewcode-back" href="../../../pyFTS.common.html#pyFTS.common.Util.simple_model_train">[docs]</a><span class="k">def</span> <span class="nf">simple_model_train</span><span class="p">(</span><span class="n">model</span><span class="p">,</span> <span class="n">data</span><span class="p">,</span> <span class="n">parameters</span><span class="p">):</span>
|
|
||||||
<span class="n">model</span><span class="o">.</span><span class="n">train</span><span class="p">(</span><span class="n">data</span><span class="p">,</span> <span class="o">**</span><span class="n">parameters</span><span class="p">)</span>
|
|
||||||
<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>
|
|
||||||
|
|
||||||
<span class="n">batch_save</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">'batch_save'</span><span class="p">,</span> <span class="kc">False</span><span class="p">)</span> <span class="c1"># save model between batches</span>
|
|
||||||
|
|
||||||
<span class="n">batch_save_interval</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">'batch_save_interval'</span><span class="p">,</span> <span class="mi">1</span><span class="p">)</span>
|
|
||||||
|
|
||||||
<span class="n">file_path</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">'file_path'</span><span class="p">,</span> <span class="kc">None</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">start_dispy_cluster</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="nb">print</span><span class="p">(</span><span class="s2">"[{0: %H:%M:%S}] Distrituted Train Started"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">datetime</span><span class="o">.</span><span class="n">datetime</span><span class="o">.</span><span class="n">now</span><span class="p">()))</span>
|
|
||||||
|
|
||||||
<span class="n">jobs</span> <span class="o">=</span> <span class="p">[]</span>
|
|
||||||
<span class="n">n</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="n">batch_size</span> <span class="o">=</span> <span class="nb">int</span><span class="p">(</span><span class="n">n</span> <span class="o">/</span> <span class="n">num_batches</span><span class="p">)</span>
|
|
||||||
<span class="n">bcount</span> <span class="o">=</span> <span class="mi">1</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="n">model</span><span class="o">.</span><span class="n">order</span><span class="p">,</span> <span class="n">n</span><span class="p">,</span> <span class="n">batch_size</span><span class="p">):</span>
|
|
||||||
<span class="k">if</span> <span class="n">model</span><span class="o">.</span><span class="n">is_multivariate</span><span class="p">:</span>
|
|
||||||
<span class="n">ndata</span> <span class="o">=</span> <span class="n">data</span><span class="o">.</span><span class="n">iloc</span><span class="p">[</span><span class="n">ct</span> <span class="o">-</span> <span class="n">model</span><span class="o">.</span><span class="n">order</span><span class="p">:</span><span class="n">ct</span> <span class="o">+</span> <span class="n">batch_size</span><span class="p">]</span>
|
|
||||||
<span class="k">else</span><span class="p">:</span>
|
|
||||||
<span class="n">ndata</span> <span class="o">=</span> <span class="n">data</span><span class="p">[</span><span class="n">ct</span> <span class="o">-</span> <span class="n">model</span><span class="o">.</span><span class="n">order</span><span class="p">:</span> <span class="n">ct</span> <span class="o">+</span> <span class="n">batch_size</span><span class="p">]</span>
|
|
||||||
|
|
||||||
<span class="n">tmp_model</span> <span class="o">=</span> <span class="n">fts_method</span><span class="p">(</span><span class="nb">str</span><span class="p">(</span><span class="n">bcount</span><span class="p">))</span>
|
|
||||||
|
|
||||||
<span class="n">tmp_model</span><span class="o">.</span><span class="n">clone_parameters</span><span class="p">(</span><span class="n">model</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">tmp_model</span><span class="p">,</span> <span class="n">ndata</span><span class="p">,</span> <span class="n">train_parameters</span><span class="p">)</span>
|
|
||||||
<span class="n">job</span><span class="o">.</span><span class="n">id</span> <span class="o">=</span> <span class="n">bcount</span> <span class="c1"># associate an ID to identify jobs (if needed later)</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">bcount</span> <span class="o">+=</span> <span class="mi">1</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="nb">print</span><span class="p">(</span><span class="s2">"[{0: %H:%M:%S}] Processing batch "</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">datetime</span><span class="o">.</span><span class="n">datetime</span><span class="o">.</span><span class="n">now</span><span class="p">())</span> <span class="o">+</span> <span class="nb">str</span><span class="p">(</span><span class="n">job</span><span class="o">.</span><span class="n">id</span><span class="p">))</span>
|
|
||||||
<span class="n">tmp</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">tmp</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span>
|
|
||||||
<span class="n">model</span><span class="o">.</span><span class="n">merge</span><span class="p">(</span><span class="n">tmp</span><span class="p">)</span>
|
|
||||||
|
|
||||||
<span class="k">if</span> <span class="n">batch_save</span> <span class="ow">and</span> <span class="p">(</span><span class="n">job</span><span class="o">.</span><span class="n">id</span> <span class="o">%</span> <span class="n">batch_save_interval</span><span class="p">)</span> <span class="o">==</span> <span class="mi">0</span><span class="p">:</span>
|
|
||||||
<span class="n">persist_obj</span><span class="p">(</span><span class="n">model</span><span class="p">,</span> <span class="n">file_path</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="nb">print</span><span class="p">(</span><span class="s2">"[{0: %H:%M:%S}] Finished batch "</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">datetime</span><span class="o">.</span><span class="n">datetime</span><span class="o">.</span><span class="n">now</span><span class="p">())</span> <span class="o">+</span> <span class="nb">str</span><span class="p">(</span><span class="n">job</span><span class="o">.</span><span class="n">id</span><span class="p">))</span>
|
|
||||||
|
|
||||||
<span class="nb">print</span><span class="p">(</span><span class="s2">"[{0: %H:%M:%S}] Distrituted Train Finished"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">datetime</span><span class="o">.</span><span class="n">datetime</span><span class="o">.</span><span class="n">now</span><span class="p">()))</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>
|
|
||||||
|
|
||||||
<span class="k">return</span> <span class="n">model</span></div>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div class="viewcode-block" id="simple_model_predict"><a class="viewcode-back" href="../../../pyFTS.common.html#pyFTS.common.Util.simple_model_predict">[docs]</a><span class="k">def</span> <span class="nf">simple_model_predict</span><span class="p">(</span><span class="n">model</span><span class="p">,</span> <span class="n">data</span><span class="p">,</span> <span class="n">parameters</span><span class="p">):</span>
|
|
||||||
<span class="k">return</span> <span class="n">model</span><span class="o">.</span><span class="n">predict</span><span class="p">(</span><span class="n">data</span><span class="p">,</span> <span class="o">**</span><span class="n">parameters</span><span class="p">)</span></div>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div class="viewcode-block" id="distributed_predict"><a class="viewcode-back" href="../../../pyFTS.common.html#pyFTS.common.Util.distributed_predict">[docs]</a><span class="k">def</span> <span class="nf">distributed_predict</span><span class="p">(</span><span class="n">model</span><span class="p">,</span> <span class="n">parameters</span><span class="p">,</span> <span class="n">nodes</span><span class="p">,</span> <span class="n">data</span><span class="p">,</span> <span class="n">num_batches</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="n">cluster</span><span class="p">,</span> <span class="n">http_server</span> <span class="o">=</span> <span class="n">start_dispy_cluster</span><span class="p">(</span><span class="n">simple_model_predict</span><span class="p">,</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="n">n</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="n">batch_size</span> <span class="o">=</span> <span class="nb">int</span><span class="p">(</span><span class="n">n</span> <span class="o">/</span> <span class="n">num_batches</span><span class="p">)</span>
|
|
||||||
<span class="n">bcount</span> <span class="o">=</span> <span class="mi">1</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="n">model</span><span class="o">.</span><span class="n">order</span><span class="p">,</span> <span class="n">n</span><span class="p">,</span> <span class="n">batch_size</span><span class="p">):</span>
|
|
||||||
<span class="k">if</span> <span class="n">model</span><span class="o">.</span><span class="n">is_multivariate</span><span class="p">:</span>
|
|
||||||
<span class="n">ndata</span> <span class="o">=</span> <span class="n">data</span><span class="o">.</span><span class="n">iloc</span><span class="p">[</span><span class="n">ct</span> <span class="o">-</span> <span class="n">model</span><span class="o">.</span><span class="n">order</span><span class="p">:</span><span class="n">ct</span> <span class="o">+</span> <span class="n">batch_size</span><span class="p">]</span>
|
|
||||||
<span class="k">else</span><span class="p">:</span>
|
|
||||||
<span class="n">ndata</span> <span class="o">=</span> <span class="n">data</span><span class="p">[</span><span class="n">ct</span> <span class="o">-</span> <span class="n">model</span><span class="o">.</span><span class="n">order</span><span class="p">:</span> <span class="n">ct</span> <span class="o">+</span> <span class="n">batch_size</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">model</span><span class="p">,</span> <span class="n">ndata</span><span class="p">,</span> <span class="n">parameters</span><span class="p">)</span>
|
|
||||||
<span class="n">job</span><span class="o">.</span><span class="n">id</span> <span class="o">=</span> <span class="n">bcount</span> <span class="c1"># associate an ID to identify jobs (if needed later)</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">bcount</span> <span class="o">+=</span> <span class="mi">1</span>
|
|
||||||
|
|
||||||
<span class="n">ret</span> <span class="o">=</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">tmp</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">tmp</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span>
|
|
||||||
<span class="k">if</span> <span class="n">job</span><span class="o">.</span><span class="n">id</span> <span class="o"><</span> <span class="n">batch_size</span><span class="p">:</span>
|
|
||||||
<span class="n">ret</span><span class="o">.</span><span class="n">extend</span><span class="p">(</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="k">else</span><span class="p">:</span>
|
|
||||||
<span class="n">ret</span><span class="o">.</span><span class="n">extend</span><span class="p">(</span><span class="n">tmp</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">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>
|
|
||||||
|
|
||||||
<span class="k">return</span> <span class="n">ret</span></div>
|
|
||||||
</pre></div>
|
</pre></div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
@ -147,7 +147,7 @@
|
|||||||
<span class="k">if</span> <span class="nb">isinstance</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="p">(</span><span class="nb">list</span><span class="p">,</span> <span class="nb">set</span><span class="p">)):</span>
|
<span class="k">if</span> <span class="nb">isinstance</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="p">(</span><span class="nb">list</span><span class="p">,</span> <span class="nb">set</span><span class="p">)):</span>
|
||||||
<span class="k">return</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">s</span><span class="p">]</span><span class="o">.</span><span class="n">centroid</span> <span class="k">for</span> <span class="n">s</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="k">return</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">s</span><span class="p">]</span><span class="o">.</span><span class="n">centroid</span> <span class="k">for</span> <span class="n">s</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="k">elif</span> <span class="nb">isinstance</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="nb">dict</span><span class="p">):</span>
|
<span class="k">elif</span> <span class="nb">isinstance</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="nb">dict</span><span class="p">):</span>
|
||||||
<span class="k">return</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="bp">self</span><span class="o">.</span><span class="n">RHS</span><span class="p">[</span><span class="n">s</span><span class="p">]]</span><span class="o">.</span><span class="n">centroid</span> <span class="k">for</span> <span class="n">s</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></div>
|
<span class="k">return</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">s</span><span class="p">]</span><span class="o">.</span><span class="n">centroid</span> <span class="k">for</span> <span class="n">s</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></div>
|
||||||
|
|
||||||
<div class="viewcode-block" id="FLRG.get_lower"><a class="viewcode-back" href="../../../pyFTS.common.html#pyFTS.common.flrg.FLRG.get_lower">[docs]</a> <span class="k">def</span> <span class="nf">get_lower</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">sets</span><span class="p">):</span>
|
<div class="viewcode-block" id="FLRG.get_lower"><a class="viewcode-back" href="../../../pyFTS.common.html#pyFTS.common.flrg.FLRG.get_lower">[docs]</a> <span class="k">def</span> <span class="nf">get_lower</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="sd">"""</span>
|
<span class="sd">"""</span>
|
||||||
|
68
docs/build/html/_modules/pyFTS/common/fts.html
vendored
68
docs/build/html/_modules/pyFTS/common/fts.html
vendored
@ -112,6 +112,9 @@
|
|||||||
<span class="sd">"""A boolean value indicating if the model support probabilistic forecasting, default: False"""</span>
|
<span class="sd">"""A boolean value indicating if the model support probabilistic forecasting, default: False"""</span>
|
||||||
<span class="bp">self</span><span class="o">.</span><span class="n">is_multivariate</span> <span class="o">=</span> <span class="kc">False</span>
|
<span class="bp">self</span><span class="o">.</span><span class="n">is_multivariate</span> <span class="o">=</span> <span class="kc">False</span>
|
||||||
<span class="sd">"""A boolean value indicating if the model support multivariate time series (Pandas DataFrame), default: False"""</span>
|
<span class="sd">"""A boolean value indicating if the model support multivariate time series (Pandas DataFrame), default: False"""</span>
|
||||||
|
<span class="bp">self</span><span class="o">.</span><span class="n">is_clustered</span> <span class="o">=</span> <span class="kc">False</span>
|
||||||
|
<span class="sd">"""A boolean value indicating if the model support multivariate time series (Pandas DataFrame), but works like </span>
|
||||||
|
<span class="sd"> a monovariate method, default: False"""</span>
|
||||||
<span class="bp">self</span><span class="o">.</span><span class="n">dump</span> <span class="o">=</span> <span class="kc">False</span>
|
<span class="bp">self</span><span class="o">.</span><span class="n">dump</span> <span class="o">=</span> <span class="kc">False</span>
|
||||||
<span class="bp">self</span><span class="o">.</span><span class="n">transformations</span> <span class="o">=</span> <span class="p">[]</span>
|
<span class="bp">self</span><span class="o">.</span><span class="n">transformations</span> <span class="o">=</span> <span class="p">[]</span>
|
||||||
<span class="sd">"""A list with the data transformations (common.Transformations) applied on model pre and post processing, default: []"""</span>
|
<span class="sd">"""A list with the data transformations (common.Transformations) applied on model pre and post processing, default: []"""</span>
|
||||||
@ -135,6 +138,8 @@
|
|||||||
<span class="sd">"""Flag indicating if the test data will be clipped inside the training Universe of Discourse"""</span>
|
<span class="sd">"""Flag indicating if the test data will be clipped inside the training Universe of Discourse"""</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="s2">"alpha_cut"</span><span class="p">,</span> <span class="mf">0.0</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="s2">"alpha_cut"</span><span class="p">,</span> <span class="mf">0.0</span><span class="p">)</span>
|
||||||
<span class="sd">"""A float with the minimal membership to be considered on fuzzyfication process"""</span>
|
<span class="sd">"""A float with the minimal membership to be considered on fuzzyfication process"""</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">"lags"</span><span class="p">,</span> <span class="kc">None</span><span class="p">)</span>
|
||||||
|
<span class="sd">"""The list of lag indexes for high order models"""</span>
|
||||||
<span class="bp">self</span><span class="o">.</span><span class="n">max_lag</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">order</span>
|
<span class="bp">self</span><span class="o">.</span><span class="n">max_lag</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">order</span>
|
||||||
<span class="sd">"""A integer indicating the largest lag used by the model. This value also indicates the minimum number of past lags </span>
|
<span class="sd">"""A integer indicating the largest lag used by the model. This value also indicates the minimum number of past lags </span>
|
||||||
<span class="sd"> needed to forecast a single step ahead"""</span>
|
<span class="sd"> needed to forecast a single step ahead"""</span>
|
||||||
@ -221,10 +226,19 @@
|
|||||||
|
|
||||||
<span class="k">else</span><span class="p">:</span>
|
<span class="k">else</span><span class="p">:</span>
|
||||||
|
|
||||||
|
<span class="k">if</span> <span class="n">distributed</span> <span class="o">==</span> <span class="s1">'dispy'</span><span class="p">:</span>
|
||||||
|
<span class="kn">from</span> <span class="nn">pyFTS.distributed</span> <span class="k">import</span> <span class="n">dispy</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="s2">"nodes"</span><span class="p">,</span> <span class="p">[</span><span class="s1">'127.0.0.1'</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="s2">"nodes"</span><span class="p">,</span> <span class="p">[</span><span class="s1">'127.0.0.1'</span><span class="p">])</span>
|
||||||
<span class="n">num_batches</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">'num_batches'</span><span class="p">,</span> <span class="mi">10</span><span class="p">)</span>
|
<span class="n">num_batches</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">'num_batches'</span><span class="p">,</span> <span class="mi">10</span><span class="p">)</span>
|
||||||
|
|
||||||
<span class="n">ret</span> <span class="o">=</span> <span class="n">Util</span><span class="o">.</span><span class="n">distributed_predict</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">kwargs</span><span class="p">,</span> <span class="n">nodes</span><span class="p">,</span> <span class="n">ndata</span><span class="p">,</span> <span class="n">num_batches</span><span class="p">)</span>
|
<span class="n">ret</span> <span class="o">=</span> <span class="n">dispy</span><span class="o">.</span><span class="n">distributed_predict</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">kwargs</span><span class="p">,</span> <span class="n">nodes</span><span class="p">,</span> <span class="n">ndata</span><span class="p">,</span> <span class="n">num_batches</span><span class="p">)</span>
|
||||||
|
|
||||||
|
<span class="k">elif</span> <span class="n">distributed</span> <span class="o">==</span> <span class="s1">'spark'</span><span class="p">:</span>
|
||||||
|
<span class="kn">from</span> <span class="nn">pyFTS.distributed</span> <span class="k">import</span> <span class="n">spark</span>
|
||||||
|
|
||||||
|
<span class="n">ret</span> <span class="o">=</span> <span class="n">spark</span><span class="o">.</span><span class="n">distributed_predict</span><span class="p">(</span><span class="n">data</span><span class="o">=</span><span class="n">ndata</span><span class="p">,</span> <span class="n">model</span><span class="o">=</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="k">if</span> <span class="ow">not</span> <span class="bp">self</span><span class="o">.</span><span class="n">is_multivariate</span><span class="p">:</span>
|
<span class="k">if</span> <span class="ow">not</span> <span class="bp">self</span><span class="o">.</span><span class="n">is_multivariate</span><span class="p">:</span>
|
||||||
<span class="n">kwargs</span><span class="p">[</span><span class="s1">'type'</span><span class="p">]</span> <span class="o">=</span> <span class="nb">type</span>
|
<span class="n">kwargs</span><span class="p">[</span><span class="s1">'type'</span><span class="p">]</span> <span class="o">=</span> <span class="nb">type</span>
|
||||||
@ -385,7 +399,7 @@
|
|||||||
|
|
||||||
<span class="n">dump</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">'dump'</span><span class="p">,</span> <span class="kc">None</span><span class="p">)</span>
|
<span class="n">dump</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">'dump'</span><span class="p">,</span> <span class="kc">None</span><span class="p">)</span>
|
||||||
|
|
||||||
<span class="n">num_batches</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">'num_batches'</span><span class="p">,</span> <span class="kc">None</span><span class="p">)</span>
|
<span class="n">num_batches</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">'num_batches'</span><span class="p">,</span> <span class="mi">1</span><span class="p">)</span>
|
||||||
|
|
||||||
<span class="n">save</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">'save_model'</span><span class="p">,</span> <span class="kc">False</span><span class="p">)</span> <span class="c1"># save model on disk</span>
|
<span class="n">save</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">'save_model'</span><span class="p">,</span> <span class="kc">False</span><span class="p">)</span> <span class="c1"># save model on disk</span>
|
||||||
|
|
||||||
@ -397,12 +411,21 @@
|
|||||||
|
|
||||||
<span class="n">batch_save_interval</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">'batch_save_interval'</span><span class="p">,</span> <span class="mi">10</span><span class="p">)</span>
|
<span class="n">batch_save_interval</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">'batch_save_interval'</span><span class="p">,</span> <span class="mi">10</span><span class="p">)</span>
|
||||||
|
|
||||||
<span class="k">if</span> <span class="n">distributed</span><span class="p">:</span>
|
<span class="k">if</span> <span class="n">distributed</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span> <span class="ow">and</span> <span class="n">distributed</span><span class="p">:</span>
|
||||||
|
|
||||||
|
<span class="k">if</span> <span class="n">distributed</span> <span class="o">==</span> <span class="s1">'dispy'</span><span class="p">:</span>
|
||||||
|
<span class="kn">from</span> <span class="nn">pyFTS.distributed</span> <span class="k">import</span> <span class="n">dispy</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">'nodes'</span><span class="p">,</span> <span class="kc">False</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">'nodes'</span><span class="p">,</span> <span class="kc">False</span><span class="p">)</span>
|
||||||
<span class="n">train_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">'train_method'</span><span class="p">,</span> <span class="n">Util</span><span class="o">.</span><span class="n">simple_model_train</span><span class="p">)</span>
|
<span class="n">train_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">'train_method'</span><span class="p">,</span> <span class="n">dispy</span><span class="o">.</span><span class="n">simple_model_train</span><span class="p">)</span>
|
||||||
<span class="n">Util</span><span class="o">.</span><span class="n">distributed_train</span><span class="p">(</span><span class="bp">self</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="nb">type</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">num_batches</span><span class="p">,</span> <span class="p">{},</span>
|
<span class="n">dispy</span><span class="o">.</span><span class="n">distributed_train</span><span class="p">(</span><span class="bp">self</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="nb">type</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">num_batches</span><span class="p">,</span> <span class="p">{},</span>
|
||||||
<span class="n">batch_save</span><span class="o">=</span><span class="n">batch_save</span><span class="p">,</span> <span class="n">file_path</span><span class="o">=</span><span class="n">file_path</span><span class="p">,</span>
|
<span class="n">batch_save</span><span class="o">=</span><span class="n">batch_save</span><span class="p">,</span> <span class="n">file_path</span><span class="o">=</span><span class="n">file_path</span><span class="p">,</span>
|
||||||
<span class="n">batch_save_interval</span><span class="o">=</span><span class="n">batch_save_interval</span><span class="p">)</span>
|
<span class="n">batch_save_interval</span><span class="o">=</span><span class="n">batch_save_interval</span><span class="p">)</span>
|
||||||
|
<span class="k">elif</span> <span class="n">distributed</span> <span class="o">==</span> <span class="s1">'spark'</span><span class="p">:</span>
|
||||||
|
<span class="kn">from</span> <span class="nn">pyFTS.distributed</span> <span class="k">import</span> <span class="n">spark</span>
|
||||||
|
<span class="n">url</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">'url'</span><span class="p">,</span> <span class="s1">'spark://192.168.0.110:7077'</span><span class="p">)</span>
|
||||||
|
<span class="n">app</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">'app'</span><span class="p">,</span> <span class="s1">'pyFTS'</span><span class="p">)</span>
|
||||||
|
|
||||||
|
<span class="n">spark</span><span class="o">.</span><span class="n">distributed_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="n">url</span><span class="o">=</span><span class="n">url</span><span class="p">,</span> <span class="n">app</span><span class="o">=</span><span class="n">app</span><span class="p">)</span>
|
||||||
<span class="k">else</span><span class="p">:</span>
|
<span class="k">else</span><span class="p">:</span>
|
||||||
|
|
||||||
<span class="k">if</span> <span class="n">dump</span> <span class="o">==</span> <span class="s1">'time'</span><span class="p">:</span>
|
<span class="k">if</span> <span class="n">dump</span> <span class="o">==</span> <span class="s1">'time'</span><span class="p">:</span>
|
||||||
@ -477,6 +500,26 @@
|
|||||||
<span class="bp">self</span><span class="o">.</span><span class="n">benchmark_only</span> <span class="o">=</span> <span class="n">model</span><span class="o">.</span><span class="n">benchmark_only</span>
|
<span class="bp">self</span><span class="o">.</span><span class="n">benchmark_only</span> <span class="o">=</span> <span class="n">model</span><span class="o">.</span><span class="n">benchmark_only</span>
|
||||||
<span class="bp">self</span><span class="o">.</span><span class="n">indexer</span> <span class="o">=</span> <span class="n">model</span><span class="o">.</span><span class="n">indexer</span></div>
|
<span class="bp">self</span><span class="o">.</span><span class="n">indexer</span> <span class="o">=</span> <span class="n">model</span><span class="o">.</span><span class="n">indexer</span></div>
|
||||||
|
|
||||||
|
<div class="viewcode-block" id="FTS.append_rule"><a class="viewcode-back" href="../../../pyFTS.common.html#pyFTS.common.fts.FTS.append_rule">[docs]</a> <span class="k">def</span> <span class="nf">append_rule</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">flrg</span><span class="p">):</span>
|
||||||
|
<span class="sd">"""</span>
|
||||||
|
<span class="sd"> Append FLRG rule to the model</span>
|
||||||
|
|
||||||
|
<span class="sd"> :param flrg: rule</span>
|
||||||
|
<span class="sd"> :return:</span>
|
||||||
|
<span class="sd"> """</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">else</span><span class="p">:</span>
|
||||||
|
<span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">flrg</span><span class="o">.</span><span class="n">RHS</span><span class="p">,</span> <span class="p">(</span><span class="nb">list</span><span class="p">,</span> <span class="nb">set</span><span class="p">)):</span>
|
||||||
|
<span class="k">for</span> <span class="n">k</span> <span class="ow">in</span> <span class="n">flrg</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">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">k</span><span class="p">)</span>
|
||||||
|
<span class="k">elif</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">flrg</span><span class="o">.</span><span class="n">RHS</span><span class="p">,</span> <span class="nb">dict</span><span class="p">):</span>
|
||||||
|
<span class="k">for</span> <span class="n">key</span><span class="p">,</span> <span class="n">value</span> <span class="ow">in</span> <span class="n">flrg</span><span class="o">.</span><span class="n">RHS</span><span class="o">.</span><span class="n">items</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">key</span><span class="p">,</span> <span class="n">count</span><span class="o">=</span><span class="n">value</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">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">flrg</span><span class="o">.</span><span class="n">RHS</span><span class="p">)</span></div>
|
||||||
|
|
||||||
<div class="viewcode-block" id="FTS.merge"><a class="viewcode-back" href="../../../pyFTS.common.html#pyFTS.common.fts.FTS.merge">[docs]</a> <span class="k">def</span> <span class="nf">merge</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">model</span><span class="p">):</span>
|
<div class="viewcode-block" id="FTS.merge"><a class="viewcode-back" href="../../../pyFTS.common.html#pyFTS.common.fts.FTS.merge">[docs]</a> <span class="k">def</span> <span class="nf">merge</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="sd">"""</span>
|
<span class="sd">"""</span>
|
||||||
<span class="sd"> Merge the FLRG rules from other model</span>
|
<span class="sd"> Merge the FLRG rules from other model</span>
|
||||||
@ -485,19 +528,8 @@
|
|||||||
<span class="sd"> :return:</span>
|
<span class="sd"> :return:</span>
|
||||||
<span class="sd"> """</span>
|
<span class="sd"> """</span>
|
||||||
|
|
||||||
<span class="k">for</span> <span class="n">key</span> <span class="ow">in</span> <span class="n">model</span><span class="o">.</span><span class="n">flrgs</span><span class="o">.</span><span class="n">keys</span><span class="p">():</span>
|
<span class="k">for</span> <span class="n">key</span><span class="p">,</span> <span class="n">flrg</span> <span class="ow">in</span> <span class="n">model</span><span class="o">.</span><span class="n">flrgs</span><span class="o">.</span><span class="n">items</span><span class="p">():</span>
|
||||||
<span class="n">flrg</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">key</span><span class="p">]</span>
|
<span class="bp">self</span><span class="o">.</span><span class="n">append_rule</span><span class="p">(</span><span class="n">flrg</span><span class="p">)</span></div>
|
||||||
<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">else</span><span class="p">:</span>
|
|
||||||
<span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">flrg</span><span class="o">.</span><span class="n">RHS</span><span class="p">,</span> <span class="p">(</span><span class="nb">list</span><span class="p">,</span> <span class="nb">set</span><span class="p">)):</span>
|
|
||||||
<span class="k">for</span> <span class="n">k</span> <span class="ow">in</span> <span class="n">flrg</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">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">k</span><span class="p">)</span>
|
|
||||||
<span class="k">elif</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">flrg</span><span class="o">.</span><span class="n">RHS</span><span class="p">,</span> <span class="nb">dict</span><span class="p">):</span>
|
|
||||||
<span class="k">for</span> <span class="n">k</span> <span class="ow">in</span> <span class="n">flrg</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="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">flrg</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="k">else</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">flrg</span><span class="o">.</span><span class="n">RHS</span><span class="p">)</span></div>
|
|
||||||
|
|
||||||
<div class="viewcode-block" id="FTS.append_transformation"><a class="viewcode-back" href="../../../pyFTS.common.html#pyFTS.common.fts.FTS.append_transformation">[docs]</a> <span class="k">def</span> <span class="nf">append_transformation</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">transformation</span><span class="p">):</span>
|
<div class="viewcode-block" id="FTS.append_transformation"><a class="viewcode-back" href="../../../pyFTS.common.html#pyFTS.common.fts.FTS.append_transformation">[docs]</a> <span class="k">def</span> <span class="nf">append_transformation</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">transformation</span><span class="p">):</span>
|
||||||
<span class="k">if</span> <span class="n">transformation</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span>
|
<span class="k">if</span> <span class="n">transformation</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span>
|
||||||
|
@ -123,11 +123,12 @@
|
|||||||
<span class="bp">self</span><span class="o">.</span><span class="n">w</span> <span class="o">=</span> <span class="kc">None</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>
|
<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="n">count</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">'count'</span><span class="p">,</span><span class="mf">1.0</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="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="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="n">count</span>
|
||||||
<span class="k">else</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">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">RHS</span><span class="p">[</span><span class="n">fset</span><span class="p">]</span> <span class="o">+=</span> <span class="n">count</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>
|
<span class="bp">self</span><span class="o">.</span><span class="n">count</span> <span class="o">+=</span> <span class="n">count</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>
|
<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>
|
<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>
|
||||||
@ -163,7 +164,6 @@
|
|||||||
<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">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">min_order</span> <span class="o">=</span> <span class="mi">1</span>
|
<span class="bp">self</span><span class="o">.</span><span class="n">min_order</span> <span class="o">=</span> <span class="mi">1</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">"order"</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">min_order</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="s2">"order"</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">min_order</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">"lags"</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">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">configure_lags</span><span class="p">(</span><span class="o">**</span><span class="n">kwargs</span><span class="p">)</span>
|
||||||
|
|
||||||
<div class="viewcode-block" id="HighOrderFTS.configure_lags"><a class="viewcode-back" href="../../../pyFTS.models.html#pyFTS.models.hofts.HighOrderFTS.configure_lags">[docs]</a> <span class="k">def</span> <span class="nf">configure_lags</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>
|
<div class="viewcode-block" id="HighOrderFTS.configure_lags"><a class="viewcode-back" href="../../../pyFTS.models.html#pyFTS.models.hofts.HighOrderFTS.configure_lags">[docs]</a> <span class="k">def</span> <span class="nf">configure_lags</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>
|
||||||
|
@ -94,12 +94,13 @@
|
|||||||
<span class="bp">self</span><span class="o">.</span><span class="n">w</span> <span class="o">=</span> <span class="kc">None</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="ImprovedWeightedFLRG.append_rhs"><a class="viewcode-back" href="../../../pyFTS.models.html#pyFTS.models.ismailefendi.ImprovedWeightedFLRG.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">c</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
|
<div class="viewcode-block" id="ImprovedWeightedFLRG.append_rhs"><a class="viewcode-back" href="../../../pyFTS.models.html#pyFTS.models.ismailefendi.ImprovedWeightedFLRG.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">c</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
|
||||||
|
<span class="n">count</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">'count'</span><span class="p">,</span> <span class="mf">1.0</span><span class="p">)</span>
|
||||||
<span class="k">if</span> <span class="n">c</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="k">if</span> <span class="n">c</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">c</span><span class="p">]</span> <span class="o">=</span> <span class="n">c</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="n">c</span>
|
||||||
<span class="bp">self</span><span class="o">.</span><span class="n">rhs_counts</span><span class="p">[</span><span class="n">c</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">rhs_counts</span><span class="p">[</span><span class="n">c</span><span class="p">]</span> <span class="o">=</span> <span class="n">count</span>
|
||||||
<span class="k">else</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">rhs_counts</span><span class="p">[</span><span class="n">c</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">rhs_counts</span><span class="p">[</span><span class="n">c</span><span class="p">]</span> <span class="o">+=</span> <span class="n">count</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>
|
<span class="bp">self</span><span class="o">.</span><span class="n">count</span> <span class="o">+=</span> <span class="n">count</span></div>
|
||||||
|
|
||||||
<div class="viewcode-block" id="ImprovedWeightedFLRG.weights"><a class="viewcode-back" href="../../../pyFTS.models.html#pyFTS.models.ismailefendi.ImprovedWeightedFLRG.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>
|
<div class="viewcode-block" id="ImprovedWeightedFLRG.weights"><a class="viewcode-back" href="../../../pyFTS.models.html#pyFTS.models.ismailefendi.ImprovedWeightedFLRG.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="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>
|
||||||
|
@ -93,7 +93,7 @@
|
|||||||
<span class="bp">self</span><span class="o">.</span><span class="n">RHS</span> <span class="o">=</span> <span class="nb">set</span></div>
|
<span class="bp">self</span><span class="o">.</span><span class="n">RHS</span> <span class="o">=</span> <span class="nb">set</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="k">def</span> <span class="nf">__str__</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
|
||||||
<span class="k">return</span> <span class="nb">str</span><span class="p">([</span><span class="bp">self</span><span class="o">.</span><span class="n">LHS</span><span class="p">[</span><span class="n">k</span><span class="p">]</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">LHS</span><span class="o">.</span><span class="n">keys</span><span class="p">()])</span> <span class="o">+</span> <span class="s2">" -> "</span> <span class="o">+</span> <span class="bp">self</span><span class="o">.</span><span class="n">RHS</span></div>
|
<span class="k">return</span> <span class="s2">"</span><span class="si">{}</span><span class="s2"> -> </span><span class="si">{}</span><span class="s2">"</span><span class="o">.</span><span class="n">format</span><span class="p">([</span><span class="bp">self</span><span class="o">.</span><span class="n">LHS</span><span class="p">[</span><span class="n">k</span><span class="p">]</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">LHS</span><span class="o">.</span><span class="n">keys</span><span class="p">()],</span> <span class="bp">self</span><span class="o">.</span><span class="n">RHS</span><span class="p">)</span></div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -87,13 +87,6 @@
|
|||||||
<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="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="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">'cluster_method'</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">"""The cluster method to be called when a new model is build"""</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">'cluster_params'</span><span class="p">,</span> <span class="p">{})</span>
|
|
||||||
<span class="sd">"""The cluster method parameters"""</span>
|
|
||||||
<span class="bp">self</span><span class="o">.</span><span class="n">cluster</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">'cluster'</span><span class="p">,</span> <span class="kc">None</span><span class="p">)</span>
|
|
||||||
<span class="sd">"""The trained clusterer"""</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">'fts_method'</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="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">'fts_method'</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">"""The FTS method to be called when a new model is build"""</span>
|
<span class="sd">"""The FTS method to be called when a new model is build"""</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">'fts_params'</span><span class="p">,</span> <span class="p">{})</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">'fts_params'</span><span class="p">,</span> <span class="p">{})</span>
|
||||||
@ -104,6 +97,8 @@
|
|||||||
|
|
||||||
<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">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">is_clustered</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">"order"</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">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">"order"</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">"lags"</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">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">"lags"</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">'alpha_cut'</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">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">'alpha_cut'</span><span class="p">,</span> <span class="mf">0.25</span><span class="p">)</span>
|
||||||
@ -117,16 +112,13 @@
|
|||||||
<span class="n">ndata</span> <span class="o">=</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">index</span><span class="p">,</span> <span class="n">row</span> <span class="ow">in</span> <span class="n">data</span><span class="o">.</span><span class="n">iterrows</span><span class="p">():</span>
|
<span class="k">for</span> <span class="n">index</span><span class="p">,</span> <span class="n">row</span> <span class="ow">in</span> <span class="n">data</span><span class="o">.</span><span class="n">iterrows</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">row</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">row</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="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">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">partitioner</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">return</span> <span class="n">ndata</span></div>
|
<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>
|
<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="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">cluster</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">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">partitioner</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="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="o">**</span><span class="bp">self</span><span class="o">.</span><span class="n">cluster_params</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="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">order</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">order</span>
|
||||||
|
|
||||||
@ -134,7 +126,7 @@
|
|||||||
|
|
||||||
<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="bp">self</span><span class="o">.</span><span class="n">pre_fuzzyfy</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="bp">self</span><span class="o">.</span><span class="n">pre_fuzzyfy</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="n">prune</span><span class="p">()</span></div>
|
<span class="bp">self</span><span class="o">.</span><span class="n">partitioner</span><span class="o">.</span><span class="n">prune</span><span class="p">()</span></div>
|
||||||
|
|
||||||
<div class="viewcode-block" id="ClusteredMVFTS.check_data"><a class="viewcode-back" href="../../../../pyFTS.models.multivariate.html#pyFTS.models.multivariate.cmvfts.ClusteredMVFTS.check_data">[docs]</a> <span class="k">def</span> <span class="nf">check_data</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">data</span><span class="p">):</span>
|
<div class="viewcode-block" id="ClusteredMVFTS.check_data"><a class="viewcode-back" href="../../../../pyFTS.models.multivariate.html#pyFTS.models.multivariate.cmvfts.ClusteredMVFTS.check_data">[docs]</a> <span class="k">def</span> <span class="nf">check_data</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="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">pre_fuzzyfy</span><span class="p">:</span>
|
<span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">pre_fuzzyfy</span><span class="p">:</span>
|
||||||
@ -158,8 +150,8 @@
|
|||||||
<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">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="bp">self</span><span class="o">.</span><span class="n">target_variable</span><span class="o">.</span><span class="n">name</span> <span class="o">!=</span> <span class="n">var</span><span class="o">.</span><span class="n">name</span><span class="p">:</span>
|
<span class="k">if</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="o">!=</span> <span class="n">var</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">target_variable</span> <span class="o">=</span> <span class="n">var</span>
|
<span class="bp">self</span><span class="o">.</span><span class="n">target_variable</span> <span class="o">=</span> <span class="n">var</span>
|
||||||
<span class="bp">self</span><span class="o">.</span><span class="n">cluster</span><span class="o">.</span><span class="n">change_target_variable</span><span class="p">(</span><span class="n">var</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">change_target_variable</span><span class="p">(</span><span class="n">var</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">partitioner</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">cluster</span>
|
<span class="bp">self</span><span class="o">.</span><span class="n">model</span><span class="o">.</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="bp">self</span><span class="o">.</span><span class="n">model</span><span class="o">.</span><span class="n">reset_calculated_values</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">reset_calculated_values</span><span class="p">()</span>
|
||||||
|
|
||||||
<span class="n">ret</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="o">=</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="bp">self</span><span class="o">.</span><span class="n">pre_fuzzyfy</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">)</span>
|
<span class="n">ret</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="o">=</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="bp">self</span><span class="o">.</span><span class="n">pre_fuzzyfy</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">)</span>
|
||||||
|
@ -81,12 +81,12 @@
|
|||||||
<span class="sd">"""</span>
|
<span class="sd">"""</span>
|
||||||
<span class="sd"> Multivariate Composite Fuzzy Set</span>
|
<span class="sd"> Multivariate Composite Fuzzy Set</span>
|
||||||
<span class="sd"> """</span>
|
<span class="sd"> """</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="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="sd">"""</span>
|
<span class="sd">"""</span>
|
||||||
<span class="sd"> Create an empty composite fuzzy set</span>
|
<span class="sd"> Create an empty composite fuzzy set</span>
|
||||||
<span class="sd"> :param name: fuzzy set name</span>
|
<span class="sd"> :param name: fuzzy set name</span>
|
||||||
<span class="sd"> """</span>
|
<span class="sd"> """</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="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="s2">""</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">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">'target_variable'</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">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">'target_variable'</span><span class="p">,</span><span class="kc">None</span><span class="p">)</span>
|
||||||
|
|
||||||
@ -100,12 +100,12 @@
|
|||||||
<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="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="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>
|
<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>
|
||||||
|
|
||||||
|
<span class="bp">self</span><span class="o">.</span><span class="n">name</span> <span class="o">+=</span> <span class="nb">set</span><span class="o">.</span><span class="n">name</span></div>
|
||||||
|
|
||||||
<div class="viewcode-block" id="MultivariateFuzzySet.set_target_variable"><a class="viewcode-back" href="../../../../pyFTS.models.multivariate.html#pyFTS.models.multivariate.common.MultivariateFuzzySet.set_target_variable">[docs]</a> <span class="k">def</span> <span class="nf">set_target_variable</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">variable</span><span class="p">):</span>
|
<div class="viewcode-block" id="MultivariateFuzzySet.set_target_variable"><a class="viewcode-back" href="../../../../pyFTS.models.multivariate.html#pyFTS.models.multivariate.common.MultivariateFuzzySet.set_target_variable">[docs]</a> <span class="k">def</span> <span class="nf">set_target_variable</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="c1">#print(self.target_variable, variable)</span>
|
|
||||||
<span class="bp">self</span><span class="o">.</span><span class="n">target_variable</span> <span class="o">=</span> <span class="n">variable</span>
|
<span class="bp">self</span><span class="o">.</span><span class="n">target_variable</span> <span class="o">=</span> <span class="n">variable</span>
|
||||||
<span class="c1">#print(self.centroid,self.sets[variable.name].centroid)</span>
|
|
||||||
<span class="bp">self</span><span class="o">.</span><span class="n">centroid</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">variable</span><span class="o">.</span><span class="n">name</span><span class="p">]</span><span class="o">.</span><span class="n">centroid</span></div>
|
<span class="bp">self</span><span class="o">.</span><span class="n">centroid</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">variable</span><span class="o">.</span><span class="n">name</span><span class="p">]</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>
|
<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>
|
||||||
@ -116,7 +116,6 @@
|
|||||||
<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>
|
<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>
|
<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">'sets'</span><span class="p">,</span> <span class="n">method</span><span class="o">=</span><span class="s1">'fuzzy'</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="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">'sets'</span><span class="p">,</span> <span class="n">method</span><span class="o">=</span><span class="s1">'fuzzy'</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>
|
<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>
|
||||||
|
@ -86,8 +86,8 @@
|
|||||||
<span class="sd"> """</span>
|
<span class="sd"> """</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="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="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">explanatory_variables</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">'explanatory_variables'</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">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">'target_variable'</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">flrgs</span> <span class="o">=</span> <span class="p">{}</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">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">"MVFTS"</span>
|
<span class="bp">self</span><span class="o">.</span><span class="n">shortname</span> <span class="o">=</span> <span class="s2">"MVFTS"</span>
|
||||||
|
@ -72,7 +72,8 @@
|
|||||||
<div class="body" role="main">
|
<div class="body" role="main">
|
||||||
|
|
||||||
<h1>Source code for pyFTS.models.multivariate.variable</h1><div class="highlight"><pre>
|
<h1>Source code for pyFTS.models.multivariate.variable</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></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">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.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">FLR</span> <span class="k">as</span> <span class="n">MVFLR</span>
|
<span class="kn">from</span> <span class="nn">pyFTS.models.multivariate</span> <span class="k">import</span> <span class="n">FLR</span> <span class="k">as</span> <span class="n">MVFLR</span>
|
||||||
|
|
||||||
@ -98,6 +99,10 @@
|
|||||||
<span class="bp">self</span><span class="o">.</span><span class="n">data_label</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">'data_label'</span><span class="p">,</span> <span class="bp">self</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">data_label</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">'data_label'</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">name</span><span class="p">)</span>
|
||||||
<span class="sd">"""A string with the column name on DataFrame"""</span>
|
<span class="sd">"""A string with the column name on DataFrame"""</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">'type'</span><span class="p">,</span> <span class="s1">'common'</span><span class="p">)</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">'type'</span><span class="p">,</span> <span class="s1">'common'</span><span class="p">)</span>
|
||||||
|
<span class="bp">self</span><span class="o">.</span><span class="n">data_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">'data_type'</span><span class="p">,</span> <span class="kc">None</span><span class="p">)</span>
|
||||||
|
<span class="sd">"""The type of the data column on Pandas Dataframe"""</span>
|
||||||
|
<span class="bp">self</span><span class="o">.</span><span class="n">mask</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">'mask'</span><span class="p">,</span> <span class="kc">None</span><span class="p">)</span>
|
||||||
|
<span class="sd">"""The mask for format the data column on Pandas Dataframe"""</span>
|
||||||
<span class="bp">self</span><span class="o">.</span><span class="n">transformation</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">'transformation'</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">transformation</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">'transformation'</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">transformation_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">'transformation_params'</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">transformation_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">'transformation_params'</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">partitioner</span> <span class="o">=</span> <span class="kc">None</span>
|
<span class="bp">self</span><span class="o">.</span><span class="n">partitioner</span> <span class="o">=</span> <span class="kc">None</span>
|
||||||
|
@ -94,11 +94,12 @@
|
|||||||
<span class="bp">self</span><span class="o">.</span><span class="n">w</span> <span class="o">=</span> <span class="kc">None</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>
|
<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="n">count</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">'count'</span><span class="p">,</span> <span class="mf">1.0</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="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="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="n">count</span>
|
||||||
<span class="k">else</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">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">RHS</span><span class="p">[</span><span class="n">fset</span><span class="p">]</span> <span class="o">+=</span> <span class="n">count</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>
|
<span class="bp">self</span><span class="o">.</span><span class="n">count</span> <span class="o">+=</span> <span class="n">count</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>
|
<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="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>
|
||||||
@ -125,10 +126,6 @@
|
|||||||
<span class="sd"> """</span>
|
<span class="sd"> """</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="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="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">"WeightedMVFTS"</span>
|
<span class="bp">self</span><span class="o">.</span><span class="n">shortname</span> <span class="o">=</span> <span class="s2">"WeightedMVFTS"</span>
|
||||||
<span class="bp">self</span><span class="o">.</span><span class="n">name</span> <span class="o">=</span> <span class="s2">"Weighted Multivariate FTS"</span>
|
<span class="bp">self</span><span class="o">.</span><span class="n">name</span> <span class="o">=</span> <span class="s2">"Weighted Multivariate FTS"</span>
|
||||||
|
|
||||||
|
32
docs/build/html/_modules/pyFTS/models/pwfts.html
vendored
32
docs/build/html/_modules/pyFTS/models/pwfts.html
vendored
@ -90,25 +90,23 @@
|
|||||||
<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="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="nb">super</span><span class="p">(</span><span class="n">ProbabilisticWeightedFLRG</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="nb">super</span><span class="p">(</span><span class="n">ProbabilisticWeightedFLRG</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="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">RHS</span> <span class="o">=</span> <span class="p">{}</span>
|
||||||
<span class="bp">self</span><span class="o">.</span><span class="n">rhs_count</span> <span class="o">=</span> <span class="p">{}</span>
|
|
||||||
<span class="bp">self</span><span class="o">.</span><span class="n">frequency_count</span> <span class="o">=</span> <span class="mf">0.0</span>
|
<span class="bp">self</span><span class="o">.</span><span class="n">frequency_count</span> <span class="o">=</span> <span class="mf">0.0</span>
|
||||||
<span class="bp">self</span><span class="o">.</span><span class="n">Z</span> <span class="o">=</span> <span class="kc">None</span>
|
<span class="bp">self</span><span class="o">.</span><span class="n">Z</span> <span class="o">=</span> <span class="kc">None</span>
|
||||||
|
|
||||||
<div class="viewcode-block" id="ProbabilisticWeightedFLRG.get_membership"><a class="viewcode-back" href="../../../pyFTS.models.html#pyFTS.models.pwfts.ProbabilisticWeightedFLRG.get_membership">[docs]</a> <span class="k">def</span> <span class="nf">get_membership</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="p">):</span>
|
<div class="viewcode-block" id="ProbabilisticWeightedFLRG.get_membership"><a class="viewcode-back" href="../../../pyFTS.models.html#pyFTS.models.pwfts.ProbabilisticWeightedFLRG.get_membership">[docs]</a> <span class="k">def</span> <span class="nf">get_membership</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="p">):</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="p">(</span><span class="n">np</span><span class="o">.</span><span class="n">ndarray</span><span class="p">,</span> <span class="nb">list</span><span class="p">)):</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="p">(</span><span class="n">np</span><span class="o">.</span><span class="n">ndarray</span><span class="p">,</span> <span class="nb">list</span><span class="p">,</span> <span class="nb">tuple</span><span class="p">,</span> <span class="nb">set</span><span class="p">)):</span>
|
||||||
<span class="k">return</span> <span class="n">np</span><span class="o">.</span><span class="n">nanprod</span><span class="p">([</span><span class="n">sets</span><span class="p">[</span><span class="n">key</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="n">count</span><span class="p">])</span>
|
<span class="k">return</span> <span class="n">np</span><span class="o">.</span><span class="n">nanprod</span><span class="p">([</span><span class="n">sets</span><span class="p">[</span><span class="n">key</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="n">count</span><span class="p">])</span>
|
||||||
<span class="k">for</span> <span class="n">count</span><span class="p">,</span> <span class="n">key</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">LHS</span><span class="p">,</span> <span class="n">start</span><span class="o">=</span><span class="mi">0</span><span class="p">)])</span>
|
<span class="k">for</span> <span class="n">count</span><span class="p">,</span> <span class="n">key</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">LHS</span><span class="p">,</span> <span class="n">start</span><span class="o">=</span><span class="mi">0</span><span class="p">)])</span>
|
||||||
<span class="k">else</span><span class="p">:</span>
|
<span class="k">else</span><span class="p">:</span>
|
||||||
<span class="k">return</span> <span class="n">sets</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">LHS</span><span class="p">[</span><span class="mi">0</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></div>
|
<span class="k">return</span> <span class="n">sets</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">LHS</span><span class="p">[</span><span class="mi">0</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></div>
|
||||||
|
|
||||||
<div class="viewcode-block" id="ProbabilisticWeightedFLRG.append_rhs"><a class="viewcode-back" href="../../../pyFTS.models.html#pyFTS.models.pwfts.ProbabilisticWeightedFLRG.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">c</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
|
<div class="viewcode-block" id="ProbabilisticWeightedFLRG.append_rhs"><a class="viewcode-back" href="../../../pyFTS.models.html#pyFTS.models.pwfts.ProbabilisticWeightedFLRG.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">c</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
|
||||||
<span class="n">mv</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">'mv'</span><span class="p">,</span> <span class="mf">1.0</span><span class="p">)</span>
|
<span class="n">count</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">'count'</span><span class="p">,</span> <span class="mf">1.0</span><span class="p">)</span>
|
||||||
<span class="bp">self</span><span class="o">.</span><span class="n">frequency_count</span> <span class="o">+=</span> <span class="n">mv</span>
|
<span class="bp">self</span><span class="o">.</span><span class="n">frequency_count</span> <span class="o">+=</span> <span class="n">count</span>
|
||||||
<span class="k">if</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="p">:</span>
|
<span class="k">if</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="p">:</span>
|
||||||
<span class="bp">self</span><span class="o">.</span><span class="n">rhs_count</span><span class="p">[</span><span class="n">c</span><span class="p">]</span> <span class="o">+=</span> <span class="n">mv</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="n">count</span>
|
||||||
<span class="k">else</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">RHS</span><span class="p">[</span><span class="n">c</span><span class="p">]</span> <span class="o">=</span> <span class="n">c</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="n">count</span></div>
|
||||||
<span class="bp">self</span><span class="o">.</span><span class="n">rhs_count</span><span class="p">[</span><span class="n">c</span><span class="p">]</span> <span class="o">=</span> <span class="n">mv</span></div>
|
|
||||||
|
|
||||||
<div class="viewcode-block" id="ProbabilisticWeightedFLRG.lhs_conditional_probability"><a class="viewcode-back" href="../../../pyFTS.models.html#pyFTS.models.pwfts.ProbabilisticWeightedFLRG.lhs_conditional_probability">[docs]</a> <span class="k">def</span> <span class="nf">lhs_conditional_probability</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">sets</span><span class="p">,</span> <span class="n">norm</span><span class="p">,</span> <span class="n">uod</span><span class="p">,</span> <span class="n">nbins</span><span class="p">):</span>
|
<div class="viewcode-block" id="ProbabilisticWeightedFLRG.lhs_conditional_probability"><a class="viewcode-back" href="../../../pyFTS.models.html#pyFTS.models.pwfts.ProbabilisticWeightedFLRG.lhs_conditional_probability">[docs]</a> <span class="k">def</span> <span class="nf">lhs_conditional_probability</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">sets</span><span class="p">,</span> <span class="n">norm</span><span class="p">,</span> <span class="n">uod</span><span class="p">,</span> <span class="n">nbins</span><span class="p">):</span>
|
||||||
<span class="n">pk</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">frequency_count</span> <span class="o">/</span> <span class="n">norm</span>
|
<span class="n">pk</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">frequency_count</span> <span class="o">/</span> <span class="n">norm</span>
|
||||||
@ -118,11 +116,11 @@
|
|||||||
<span class="k">return</span> <span class="n">tmp</span></div>
|
<span class="k">return</span> <span class="n">tmp</span></div>
|
||||||
|
|
||||||
<div class="viewcode-block" id="ProbabilisticWeightedFLRG.rhs_unconditional_probability"><a class="viewcode-back" href="../../../pyFTS.models.html#pyFTS.models.pwfts.ProbabilisticWeightedFLRG.rhs_unconditional_probability">[docs]</a> <span class="k">def</span> <span class="nf">rhs_unconditional_probability</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">c</span><span class="p">):</span>
|
<div class="viewcode-block" id="ProbabilisticWeightedFLRG.rhs_unconditional_probability"><a class="viewcode-back" href="../../../pyFTS.models.html#pyFTS.models.pwfts.ProbabilisticWeightedFLRG.rhs_unconditional_probability">[docs]</a> <span class="k">def</span> <span class="nf">rhs_unconditional_probability</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="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">rhs_count</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">frequency_count</span></div>
|
<span class="k">return</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">frequency_count</span></div>
|
||||||
|
|
||||||
<div class="viewcode-block" id="ProbabilisticWeightedFLRG.rhs_conditional_probability"><a class="viewcode-back" href="../../../pyFTS.models.html#pyFTS.models.pwfts.ProbabilisticWeightedFLRG.rhs_conditional_probability">[docs]</a> <span class="k">def</span> <span class="nf">rhs_conditional_probability</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">sets</span><span class="p">,</span> <span class="n">uod</span><span class="p">,</span> <span class="n">nbins</span><span class="p">):</span>
|
<div class="viewcode-block" id="ProbabilisticWeightedFLRG.rhs_conditional_probability"><a class="viewcode-back" href="../../../pyFTS.models.html#pyFTS.models.pwfts.ProbabilisticWeightedFLRG.rhs_conditional_probability">[docs]</a> <span class="k">def</span> <span class="nf">rhs_conditional_probability</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">sets</span><span class="p">,</span> <span class="n">uod</span><span class="p">,</span> <span class="n">nbins</span><span class="p">):</span>
|
||||||
<span class="n">total</span> <span class="o">=</span> <span class="mf">0.0</span>
|
<span class="n">total</span> <span class="o">=</span> <span class="mf">0.0</span>
|
||||||
<span class="k">for</span> <span class="n">rhs</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="k">for</span> <span class="n">rhs</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="nb">set</span> <span class="o">=</span> <span class="n">sets</span><span class="p">[</span><span class="n">rhs</span><span class="p">]</span>
|
<span class="nb">set</span> <span class="o">=</span> <span class="n">sets</span><span class="p">[</span><span class="n">rhs</span><span class="p">]</span>
|
||||||
<span class="n">wi</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">rhs_unconditional_probability</span><span class="p">(</span><span class="n">rhs</span><span class="p">)</span>
|
<span class="n">wi</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">rhs_unconditional_probability</span><span class="p">(</span><span class="n">rhs</span><span class="p">)</span>
|
||||||
<span class="n">mv</span> <span class="o">=</span> <span class="nb">set</span><span class="o">.</span><span class="n">membership</span><span class="p">(</span><span class="n">x</span><span class="p">)</span> <span class="o">/</span> <span class="nb">set</span><span class="o">.</span><span class="n">partition_function</span><span class="p">(</span><span class="n">uod</span><span class="p">,</span> <span class="n">nbins</span><span class="o">=</span><span class="n">nbins</span><span class="p">)</span>
|
<span class="n">mv</span> <span class="o">=</span> <span class="nb">set</span><span class="o">.</span><span class="n">membership</span><span class="p">(</span><span class="n">x</span><span class="p">)</span> <span class="o">/</span> <span class="nb">set</span><span class="o">.</span><span class="n">partition_function</span><span class="p">(</span><span class="n">uod</span><span class="p">,</span> <span class="n">nbins</span><span class="o">=</span><span class="n">nbins</span><span class="p">)</span>
|
||||||
@ -143,28 +141,30 @@
|
|||||||
<span class="sd">'''Return the expectation of the PWFLRG, the weighted sum'''</span>
|
<span class="sd">'''Return the expectation of the PWFLRG, the weighted sum'''</span>
|
||||||
<span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">midpoint</span> <span class="ow">is</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">midpoint</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">midpoint</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">sum</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="bp">self</span><span class="o">.</span><span class="n">rhs_unconditional_probability</span><span class="p">(</span><span class="n">s</span><span class="p">)</span> <span class="o">*</span> <span class="n">sets</span><span class="p">[</span><span class="n">s</span><span class="p">]</span><span class="o">.</span><span class="n">centroid</span>
|
<span class="bp">self</span><span class="o">.</span><span class="n">midpoint</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">sum</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="bp">self</span><span class="o">.</span><span class="n">rhs_unconditional_probability</span><span class="p">(</span><span class="n">s</span><span class="p">)</span> <span class="o">*</span> <span class="n">sets</span><span class="p">[</span><span class="n">s</span><span class="p">]</span><span class="o">.</span><span class="n">centroid</span>
|
||||||
<span class="k">for</span> <span class="n">s</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="k">for</span> <span class="n">s</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">midpoint</span></div>
|
<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">midpoint</span></div>
|
||||||
|
|
||||||
<div class="viewcode-block" id="ProbabilisticWeightedFLRG.get_upper"><a class="viewcode-back" href="../../../pyFTS.models.html#pyFTS.models.pwfts.ProbabilisticWeightedFLRG.get_upper">[docs]</a> <span class="k">def</span> <span class="nf">get_upper</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">sets</span><span class="p">):</span>
|
<div class="viewcode-block" id="ProbabilisticWeightedFLRG.get_upper"><a class="viewcode-back" href="../../../pyFTS.models.html#pyFTS.models.pwfts.ProbabilisticWeightedFLRG.get_upper">[docs]</a> <span class="k">def</span> <span class="nf">get_upper</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="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">upper</span> <span class="ow">is</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">upper</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">upper</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">sum</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="bp">self</span><span class="o">.</span><span class="n">rhs_unconditional_probability</span><span class="p">(</span><span class="n">s</span><span class="p">)</span> <span class="o">*</span> <span class="n">sets</span><span class="p">[</span><span class="n">s</span><span class="p">]</span><span class="o">.</span><span class="n">upper</span> <span class="k">for</span> <span class="n">s</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">upper</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">sum</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="bp">self</span><span class="o">.</span><span class="n">rhs_unconditional_probability</span><span class="p">(</span><span class="n">s</span><span class="p">)</span> <span class="o">*</span> <span class="n">sets</span><span class="p">[</span><span class="n">s</span><span class="p">]</span><span class="o">.</span><span class="n">upper</span>
|
||||||
|
<span class="k">for</span> <span class="n">s</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">upper</span></div>
|
<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">upper</span></div>
|
||||||
|
|
||||||
<div class="viewcode-block" id="ProbabilisticWeightedFLRG.get_lower"><a class="viewcode-back" href="../../../pyFTS.models.html#pyFTS.models.pwfts.ProbabilisticWeightedFLRG.get_lower">[docs]</a> <span class="k">def</span> <span class="nf">get_lower</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">sets</span><span class="p">):</span>
|
<div class="viewcode-block" id="ProbabilisticWeightedFLRG.get_lower"><a class="viewcode-back" href="../../../pyFTS.models.html#pyFTS.models.pwfts.ProbabilisticWeightedFLRG.get_lower">[docs]</a> <span class="k">def</span> <span class="nf">get_lower</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="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">lower</span> <span class="ow">is</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">lower</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">lower</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">sum</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="bp">self</span><span class="o">.</span><span class="n">rhs_unconditional_probability</span><span class="p">(</span><span class="n">s</span><span class="p">)</span> <span class="o">*</span> <span class="n">sets</span><span class="p">[</span><span class="n">s</span><span class="p">]</span><span class="o">.</span><span class="n">lower</span> <span class="k">for</span> <span class="n">s</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">lower</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">sum</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="bp">self</span><span class="o">.</span><span class="n">rhs_unconditional_probability</span><span class="p">(</span><span class="n">s</span><span class="p">)</span> <span class="o">*</span> <span class="n">sets</span><span class="p">[</span><span class="n">s</span><span class="p">]</span><span class="o">.</span><span class="n">lower</span>
|
||||||
|
<span class="k">for</span> <span class="n">s</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">lower</span></div>
|
<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">lower</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="k">def</span> <span class="nf">__str__</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
|
||||||
<span class="n">tmp2</span> <span class="o">=</span> <span class="s2">""</span>
|
<span class="n">tmp2</span> <span class="o">=</span> <span class="s2">""</span>
|
||||||
<span class="k">for</span> <span class="n">c</span> <span class="ow">in</span> <span class="nb">sorted</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="k">for</span> <span class="n">c</span> <span class="ow">in</span> <span class="nb">sorted</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="n">keys</span><span class="p">()):</span>
|
||||||
<span class="k">if</span> <span class="nb">len</span><span class="p">(</span><span class="n">tmp2</span><span class="p">)</span> <span class="o">></span> <span class="mi">0</span><span class="p">:</span>
|
<span class="k">if</span> <span class="nb">len</span><span class="p">(</span><span class="n">tmp2</span><span class="p">)</span> <span class="o">></span> <span class="mi">0</span><span class="p">:</span>
|
||||||
<span class="n">tmp2</span> <span class="o">=</span> <span class="n">tmp2</span> <span class="o">+</span> <span class="s2">", "</span>
|
<span class="n">tmp2</span> <span class="o">=</span> <span class="n">tmp2</span> <span class="o">+</span> <span class="s2">", "</span>
|
||||||
<span class="n">tmp2</span> <span class="o">=</span> <span class="n">tmp2</span> <span class="o">+</span> <span class="s2">"("</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_count</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">frequency_count</span><span class="p">,</span> <span class="mi">3</span><span class="p">))</span> <span class="o">+</span> <span class="s2">")"</span> <span class="o">+</span> <span class="n">c</span>
|
<span class="n">tmp2</span> <span class="o">=</span> <span class="n">tmp2</span> <span class="o">+</span> <span class="s2">"("</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">c</span><span class="p">]</span> <span class="o">/</span> <span class="bp">self</span><span class="o">.</span><span class="n">frequency_count</span><span class="p">,</span> <span class="mi">3</span><span class="p">))</span> <span class="o">+</span> <span class="s2">")"</span> <span class="o">+</span> <span class="n">c</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">" -> "</span> <span class="o">+</span> <span class="n">tmp2</span></div>
|
<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">" -> "</span> <span class="o">+</span> <span class="n">tmp2</span></div>
|
||||||
|
|
||||||
|
|
||||||
@ -247,7 +247,7 @@
|
|||||||
|
|
||||||
<span class="n">mvs</span> <span class="o">=</span> <span class="p">[]</span>
|
<span class="n">mvs</span> <span class="o">=</span> <span class="p">[]</span>
|
||||||
<span class="k">for</span> <span class="nb">set</span><span class="p">,</span> <span class="n">mv</span> <span class="ow">in</span> <span class="n">fuzzyfied</span><span class="p">:</span>
|
<span class="k">for</span> <span class="nb">set</span><span class="p">,</span> <span class="n">mv</span> <span class="ow">in</span> <span class="n">fuzzyfied</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="nb">set</span><span class="p">,</span> <span class="n">mv</span><span class="o">=</span><span class="n">lhs_mv</span> <span class="o">*</span> <span class="n">mv</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="nb">set</span><span class="p">,</span> <span class="n">count</span><span class="o">=</span><span class="n">lhs_mv</span> <span class="o">*</span> <span class="n">mv</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="n">mv</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="n">mv</span><span class="p">)</span>
|
||||||
|
|
||||||
<span class="n">tmp_fq</span> <span class="o">=</span> <span class="nb">sum</span><span class="p">([</span><span class="n">lhs_mv</span><span class="o">*</span><span class="n">kk</span> <span class="k">for</span> <span class="n">kk</span> <span class="ow">in</span> <span class="n">mvs</span> <span class="k">if</span> <span class="n">kk</span> <span class="o">></span> <span class="mi">0</span><span class="p">])</span>
|
<span class="n">tmp_fq</span> <span class="o">=</span> <span class="nb">sum</span><span class="p">([</span><span class="n">lhs_mv</span><span class="o">*</span><span class="n">kk</span> <span class="k">for</span> <span class="n">kk</span> <span class="ow">in</span> <span class="n">mvs</span> <span class="k">if</span> <span class="n">kk</span> <span class="o">></span> <span class="mi">0</span><span class="p">])</span>
|
||||||
@ -605,7 +605,7 @@
|
|||||||
|
|
||||||
<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="k">def</span> <span class="nf">__str__</span><span class="p">(</span><span class="bp">self</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">name</span> <span class="o">+</span> <span class="s2">":</span><span class="se">\n</span><span class="s2">"</span>
|
<span class="n">tmp</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">name</span> <span class="o">+</span> <span class="s2">":</span><span class="se">\n</span><span class="s2">"</span>
|
||||||
<span class="k">for</span> <span class="n">r</span> <span class="ow">in</span> <span class="nb">sorted</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="k">for</span> <span class="n">r</span> <span class="ow">in</span> <span class="nb">sorted</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">flrgs</span><span class="o">.</span><span class="n">keys</span><span class="p">()):</span>
|
||||||
<span class="n">p</span> <span class="o">=</span> <span class="nb">round</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">r</span><span class="p">]</span><span class="o">.</span><span class="n">frequency_count</span> <span class="o">/</span> <span class="bp">self</span><span class="o">.</span><span class="n">global_frequency_count</span><span class="p">,</span> <span class="mi">3</span><span class="p">)</span>
|
<span class="n">p</span> <span class="o">=</span> <span class="nb">round</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">r</span><span class="p">]</span><span class="o">.</span><span class="n">frequency_count</span> <span class="o">/</span> <span class="bp">self</span><span class="o">.</span><span class="n">global_frequency_count</span><span class="p">,</span> <span class="mi">3</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="s2">"("</span> <span class="o">+</span> <span class="nb">str</span><span class="p">(</span><span class="n">p</span><span class="p">)</span> <span class="o">+</span> <span class="s2">") "</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">flrgs</span><span class="p">[</span><span class="n">r</span><span class="p">])</span> <span class="o">+</span> <span class="s2">"</span><span class="se">\n</span><span class="s2">"</span>
|
<span class="n">tmp</span> <span class="o">=</span> <span class="n">tmp</span> <span class="o">+</span> <span class="s2">"("</span> <span class="o">+</span> <span class="nb">str</span><span class="p">(</span><span class="n">p</span><span class="p">)</span> <span class="o">+</span> <span class="s2">") "</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">flrgs</span><span class="p">[</span><span class="n">r</span><span class="p">])</span> <span class="o">+</span> <span class="s2">"</span><span class="se">\n</span><span class="s2">"</span>
|
||||||
<span class="k">return</span> <span class="n">tmp</span></div>
|
<span class="k">return</span> <span class="n">tmp</span></div>
|
||||||
|
@ -96,8 +96,9 @@
|
|||||||
<span class="bp">self</span><span class="o">.</span><span class="n">w</span> <span class="o">=</span> <span class="kc">None</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="ExponentialyWeightedFLRG.append_rhs"><a class="viewcode-back" href="../../../pyFTS.models.html#pyFTS.models.sadaei.ExponentialyWeightedFLRG.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">c</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
|
<div class="viewcode-block" id="ExponentialyWeightedFLRG.append_rhs"><a class="viewcode-back" href="../../../pyFTS.models.html#pyFTS.models.sadaei.ExponentialyWeightedFLRG.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">c</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
|
||||||
|
<span class="n">count</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">'count'</span><span class="p">,</span> <span class="mf">1.0</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="n">append</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">RHS</span><span class="o">.</span><span class="n">append</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">count</span> <span class="o">=</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>
|
<span class="bp">self</span><span class="o">.</span><span class="n">count</span> <span class="o">+=</span> <span class="n">count</span></div>
|
||||||
|
|
||||||
<div class="viewcode-block" id="ExponentialyWeightedFLRG.weights"><a class="viewcode-back" href="../../../pyFTS.models.html#pyFTS.models.sadaei.ExponentialyWeightedFLRG.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>
|
<div class="viewcode-block" id="ExponentialyWeightedFLRG.weights"><a class="viewcode-back" href="../../../pyFTS.models.html#pyFTS.models.sadaei.ExponentialyWeightedFLRG.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="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>
|
||||||
|
@ -94,8 +94,9 @@
|
|||||||
<span class="bp">self</span><span class="o">.</span><span class="n">w</span> <span class="o">=</span> <span class="kc">None</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.html#pyFTS.models.yu.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">c</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
|
<div class="viewcode-block" id="WeightedFLRG.append_rhs"><a class="viewcode-back" href="../../../pyFTS.models.html#pyFTS.models.yu.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">c</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
|
||||||
|
<span class="n">count</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">'count'</span><span class="p">,</span> <span class="mf">1.0</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="n">append</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">RHS</span><span class="o">.</span><span class="n">append</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">count</span> <span class="o">=</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>
|
<span class="bp">self</span><span class="o">.</span><span class="n">count</span> <span class="o">+=</span> <span class="n">count</span></div>
|
||||||
|
|
||||||
<div class="viewcode-block" id="WeightedFLRG.weights"><a class="viewcode-back" href="../../../pyFTS.models.html#pyFTS.models.yu.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="n">sets</span><span class="p">):</span>
|
<div class="viewcode-block" id="WeightedFLRG.weights"><a class="viewcode-back" href="../../../pyFTS.models.html#pyFTS.models.yu.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="n">sets</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="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>
|
||||||
|
@ -95,6 +95,15 @@
|
|||||||
|
|
||||||
<span class="bp">self</span><span class="o">.</span><span class="n">partitions</span> <span class="o">=</span> <span class="mi">0</span>
|
<span class="bp">self</span><span class="o">.</span><span class="n">partitions</span> <span class="o">=</span> <span class="mi">0</span>
|
||||||
|
|
||||||
|
<div class="viewcode-block" id="SimplePartitioner.append_complex"><a class="viewcode-back" href="../../../pyFTS.partitioners.html#pyFTS.partitioners.Simple.SimplePartitioner.append_complex">[docs]</a> <span class="k">def</span> <span class="nf">append_complex</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">fs</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">fs</span><span class="o">.</span><span class="n">name</span><span class="p">]</span> <span class="o">=</span> <span class="n">fs</span>
|
||||||
|
<span class="bp">self</span><span class="o">.</span><span class="n">partitions</span> <span class="o">+=</span> <span class="mi">1</span>
|
||||||
|
|
||||||
|
<span class="bp">self</span><span class="o">.</span><span class="n">ordered_sets</span> <span class="o">=</span> <span class="p">[</span><span class="n">key</span> <span class="k">for</span> <span class="n">key</span> <span class="ow">in</span> <span class="nb">sorted</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="n">keys</span><span class="p">(),</span> <span class="n">key</span><span class="o">=</span><span class="k">lambda</span> <span class="n">k</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">k</span><span class="p">]</span><span class="o">.</span><span class="n">centroid</span><span class="p">)]</span>
|
||||||
|
|
||||||
|
<span class="bp">self</span><span class="o">.</span><span class="n">min</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="bp">self</span><span class="o">.</span><span class="n">ordered_sets</span><span class="p">[</span><span class="mi">0</span><span class="p">]]</span><span class="o">.</span><span class="n">lower</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">sets</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">ordered_sets</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">upper</span></div>
|
||||||
|
|
||||||
<div class="viewcode-block" id="SimplePartitioner.append"><a class="viewcode-back" href="../../../pyFTS.partitioners.html#pyFTS.partitioners.Simple.SimplePartitioner.append">[docs]</a> <span class="k">def</span> <span class="nf">append</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">mf</span><span class="p">,</span> <span class="n">parameters</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
|
<div class="viewcode-block" id="SimplePartitioner.append"><a class="viewcode-back" href="../../../pyFTS.partitioners.html#pyFTS.partitioners.Simple.SimplePartitioner.append">[docs]</a> <span class="k">def</span> <span class="nf">append</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">mf</span><span class="p">,</span> <span class="n">parameters</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
|
||||||
<span class="sd">"""</span>
|
<span class="sd">"""</span>
|
||||||
<span class="sd"> Append a new partition (fuzzy set) to the partitioner</span>
|
<span class="sd"> Append a new partition (fuzzy set) to the partitioner</span>
|
||||||
@ -113,7 +122,7 @@
|
|||||||
<span class="k">if</span> <span class="n">mf</span> <span class="ow">is</span> <span class="kc">None</span> <span class="ow">or</span> <span class="n">mf</span> <span class="ow">not</span> <span class="ow">in</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="n">Membership</span><span class="o">.</span><span class="n">gaussmf</span><span class="p">,</span>
|
<span class="k">if</span> <span class="n">mf</span> <span class="ow">is</span> <span class="kc">None</span> <span class="ow">or</span> <span class="n">mf</span> <span class="ow">not</span> <span class="ow">in</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="n">Membership</span><span class="o">.</span><span class="n">gaussmf</span><span class="p">,</span>
|
||||||
<span class="n">Membership</span><span class="o">.</span><span class="n">trapmf</span><span class="p">,</span> <span class="n">Membership</span><span class="o">.</span><span class="n">singleton</span><span class="p">,</span>
|
<span class="n">Membership</span><span class="o">.</span><span class="n">trapmf</span><span class="p">,</span> <span class="n">Membership</span><span class="o">.</span><span class="n">singleton</span><span class="p">,</span>
|
||||||
<span class="n">Membership</span><span class="o">.</span><span class="n">sigmf</span><span class="p">):</span>
|
<span class="n">Membership</span><span class="o">.</span><span class="n">sigmf</span><span class="p">):</span>
|
||||||
<span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span><span class="s2">"The mf parameter should be one of pyFTS.common.Membership functions"</span><span class="p">)</span>
|
<span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span><span class="s2">"The mf parameter should be one of pyFTS.common.Membership functions, not </span><span class="si">{}</span><span class="s2">"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">mf</span><span class="p">))</span>
|
||||||
|
|
||||||
<span class="k">if</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="p">:</span>
|
<span class="k">if</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="p">:</span>
|
||||||
<span class="k">if</span> <span class="nb">len</span><span class="p">(</span><span class="n">parameters</span><span class="p">)</span> <span class="o">!=</span> <span class="mi">3</span><span class="p">:</span>
|
<span class="k">if</span> <span class="nb">len</span><span class="p">(</span><span class="n">parameters</span><span class="p">)</span> <span class="o">!=</span> <span class="mi">3</span><span class="p">:</span>
|
||||||
|
42
docs/build/html/genindex.html
vendored
42
docs/build/html/genindex.html
vendored
@ -136,6 +136,8 @@
|
|||||||
<li><a href="pyFTS.probabilistic.html#pyFTS.probabilistic.ProbabilityDistribution.ProbabilityDistribution.append">(pyFTS.probabilistic.ProbabilityDistribution.ProbabilityDistribution method)</a>
|
<li><a href="pyFTS.probabilistic.html#pyFTS.probabilistic.ProbabilityDistribution.ProbabilityDistribution.append">(pyFTS.probabilistic.ProbabilityDistribution.ProbabilityDistribution method)</a>
|
||||||
</li>
|
</li>
|
||||||
</ul></li>
|
</ul></li>
|
||||||
|
<li><a href="pyFTS.partitioners.html#pyFTS.partitioners.Simple.SimplePartitioner.append_complex">append_complex() (pyFTS.partitioners.Simple.SimplePartitioner method)</a>
|
||||||
|
</li>
|
||||||
<li><a href="pyFTS.probabilistic.html#pyFTS.probabilistic.ProbabilityDistribution.ProbabilityDistribution.append_interval">append_interval() (pyFTS.probabilistic.ProbabilityDistribution.ProbabilityDistribution method)</a>
|
<li><a href="pyFTS.probabilistic.html#pyFTS.probabilistic.ProbabilityDistribution.ProbabilityDistribution.append_interval">append_interval() (pyFTS.probabilistic.ProbabilityDistribution.ProbabilityDistribution method)</a>
|
||||||
</li>
|
</li>
|
||||||
<li><a href="pyFTS.models.html#pyFTS.models.hofts.HighOrderFLRG.append_lhs">append_lhs() (pyFTS.models.hofts.HighOrderFLRG method)</a>
|
<li><a href="pyFTS.models.html#pyFTS.models.hofts.HighOrderFLRG.append_lhs">append_lhs() (pyFTS.models.hofts.HighOrderFLRG method)</a>
|
||||||
@ -184,6 +186,8 @@
|
|||||||
</ul></li>
|
</ul></li>
|
||||||
</ul></td>
|
</ul></td>
|
||||||
<td style="width: 33%; vertical-align: top;"><ul>
|
<td style="width: 33%; vertical-align: top;"><ul>
|
||||||
|
<li><a href="pyFTS.common.html#pyFTS.common.fts.FTS.append_rule">append_rule() (pyFTS.common.fts.FTS method)</a>
|
||||||
|
</li>
|
||||||
<li><a href="pyFTS.common.html#pyFTS.common.Composite.FuzzySet.append_set">append_set() (pyFTS.common.Composite.FuzzySet method)</a>
|
<li><a href="pyFTS.common.html#pyFTS.common.Composite.FuzzySet.append_set">append_set() (pyFTS.common.Composite.FuzzySet method)</a>
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
@ -340,22 +344,16 @@
|
|||||||
<li><a href="pyFTS.models.multivariate.html#pyFTS.models.multivariate.mvfts.MVFTS.clone_parameters">(pyFTS.models.multivariate.mvfts.MVFTS method)</a>
|
<li><a href="pyFTS.models.multivariate.html#pyFTS.models.multivariate.mvfts.MVFTS.clone_parameters">(pyFTS.models.multivariate.mvfts.MVFTS method)</a>
|
||||||
</li>
|
</li>
|
||||||
</ul></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.hyperparam.html#pyFTS.hyperparam.GridSearch.cluster_method">cluster_method() (in module pyFTS.hyperparam.GridSearch)</a>
|
<li><a href="pyFTS.hyperparam.html#pyFTS.hyperparam.GridSearch.cluster_method">cluster_method() (in module pyFTS.hyperparam.GridSearch)</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>
|
||||||
<li><a href="pyFTS.models.multivariate.html#pyFTS.models.multivariate.cmvfts.ClusteredMVFTS">ClusteredMVFTS (class in pyFTS.models.multivariate.cmvfts)</a>
|
<li><a href="pyFTS.models.multivariate.html#pyFTS.models.multivariate.cmvfts.ClusteredMVFTS">ClusteredMVFTS (class in pyFTS.models.multivariate.cmvfts)</a>
|
||||||
</li>
|
</li>
|
||||||
</ul></td>
|
|
||||||
<td style="width: 33%; vertical-align: top;"><ul>
|
|
||||||
<li><a href="pyFTS.partitioners.html#pyFTS.partitioners.CMeans.CMeansPartitioner">CMeansPartitioner (class in pyFTS.partitioners.CMeans)</a>
|
<li><a href="pyFTS.partitioners.html#pyFTS.partitioners.CMeans.CMeansPartitioner">CMeansPartitioner (class in pyFTS.partitioners.CMeans)</a>
|
||||||
</li>
|
</li>
|
||||||
<li><a href="pyFTS.benchmarks.html#pyFTS.benchmarks.ResidualAnalysis.compare_residuals">compare_residuals() (in module pyFTS.benchmarks.ResidualAnalysis)</a>
|
<li><a href="pyFTS.benchmarks.html#pyFTS.benchmarks.ResidualAnalysis.compare_residuals">compare_residuals() (in module pyFTS.benchmarks.ResidualAnalysis)</a>
|
||||||
</li>
|
</li>
|
||||||
|
</ul></td>
|
||||||
|
<td style="width: 33%; vertical-align: top;"><ul>
|
||||||
<li><a href="pyFTS.benchmarks.html#pyFTS.benchmarks.benchmarks.compareModelsPlot">compareModelsPlot() (in module pyFTS.benchmarks.benchmarks)</a>
|
<li><a href="pyFTS.benchmarks.html#pyFTS.benchmarks.benchmarks.compareModelsPlot">compareModelsPlot() (in module pyFTS.benchmarks.benchmarks)</a>
|
||||||
</li>
|
</li>
|
||||||
<li><a href="pyFTS.benchmarks.html#pyFTS.benchmarks.benchmarks.compareModelsTable">compareModelsTable() (in module pyFTS.benchmarks.benchmarks)</a>
|
<li><a href="pyFTS.benchmarks.html#pyFTS.benchmarks.benchmarks.compareModelsTable">compareModelsTable() (in module pyFTS.benchmarks.benchmarks)</a>
|
||||||
@ -409,6 +407,8 @@
|
|||||||
<table style="width: 100%" class="indextable genindextable"><tr>
|
<table style="width: 100%" class="indextable genindextable"><tr>
|
||||||
<td style="width: 33%; vertical-align: top;"><ul>
|
<td style="width: 33%; vertical-align: top;"><ul>
|
||||||
<li><a href="pyFTS.models.multivariate.html#pyFTS.models.multivariate.variable.Variable.data_label">data_label (pyFTS.models.multivariate.variable.Variable attribute)</a>
|
<li><a href="pyFTS.models.multivariate.html#pyFTS.models.multivariate.variable.Variable.data_label">data_label (pyFTS.models.multivariate.variable.Variable attribute)</a>
|
||||||
|
</li>
|
||||||
|
<li><a href="pyFTS.models.multivariate.html#pyFTS.models.multivariate.variable.Variable.data_type">data_type (pyFTS.models.multivariate.variable.Variable attribute)</a>
|
||||||
</li>
|
</li>
|
||||||
<li><a href="pyFTS.models.seasonal.html#pyFTS.models.seasonal.SeasonalIndexer.DataFrameSeasonalIndexer">DataFrameSeasonalIndexer (class in pyFTS.models.seasonal.SeasonalIndexer)</a>
|
<li><a href="pyFTS.models.seasonal.html#pyFTS.models.seasonal.SeasonalIndexer.DataFrameSeasonalIndexer">DataFrameSeasonalIndexer (class in pyFTS.models.seasonal.SeasonalIndexer)</a>
|
||||||
</li>
|
</li>
|
||||||
@ -420,12 +420,12 @@
|
|||||||
</li>
|
</li>
|
||||||
<li><a href="pyFTS.models.seasonal.html#pyFTS.models.seasonal.common.DateTime.day_of_week">day_of_week (pyFTS.models.seasonal.common.DateTime attribute)</a>
|
<li><a href="pyFTS.models.seasonal.html#pyFTS.models.seasonal.common.DateTime.day_of_week">day_of_week (pyFTS.models.seasonal.common.DateTime attribute)</a>
|
||||||
</li>
|
</li>
|
||||||
|
</ul></td>
|
||||||
|
<td style="width: 33%; vertical-align: top;"><ul>
|
||||||
<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><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>
|
</li>
|
||||||
<li><a href="pyFTS.probabilistic.html#pyFTS.probabilistic.ProbabilityDistribution.ProbabilityDistribution.density">density() (pyFTS.probabilistic.ProbabilityDistribution.ProbabilityDistribution method)</a>
|
<li><a href="pyFTS.probabilistic.html#pyFTS.probabilistic.ProbabilityDistribution.ProbabilityDistribution.density">density() (pyFTS.probabilistic.ProbabilityDistribution.ProbabilityDistribution method)</a>
|
||||||
</li>
|
</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><a href="pyFTS.common.html#pyFTS.common.fts.FTS.detail">detail (pyFTS.common.fts.FTS attribute)</a>
|
||||||
</li>
|
</li>
|
||||||
<li><a href="pyFTS.hyperparam.html#pyFTS.hyperparam.GridSearch.dict_individual">dict_individual() (in module pyFTS.hyperparam.GridSearch)</a>
|
<li><a href="pyFTS.hyperparam.html#pyFTS.hyperparam.GridSearch.dict_individual">dict_individual() (in module pyFTS.hyperparam.GridSearch)</a>
|
||||||
@ -435,10 +435,6 @@
|
|||||||
<li><a href="pyFTS.probabilistic.html#pyFTS.probabilistic.ProbabilityDistribution.ProbabilityDistribution.differential_offset">differential_offset() (pyFTS.probabilistic.ProbabilityDistribution.ProbabilityDistribution method)</a>
|
<li><a href="pyFTS.probabilistic.html#pyFTS.probabilistic.ProbabilityDistribution.ProbabilityDistribution.differential_offset">differential_offset() (pyFTS.probabilistic.ProbabilityDistribution.ProbabilityDistribution method)</a>
|
||||||
</li>
|
</li>
|
||||||
<li><a href="pyFTS.partitioners.html#pyFTS.partitioners.CMeans.distance">distance() (in module pyFTS.partitioners.CMeans)</a>
|
<li><a href="pyFTS.partitioners.html#pyFTS.partitioners.CMeans.distance">distance() (in module pyFTS.partitioners.CMeans)</a>
|
||||||
</li>
|
|
||||||
<li><a href="pyFTS.common.html#pyFTS.common.Util.distributed_predict">distributed_predict() (in module pyFTS.common.Util)</a>
|
|
||||||
</li>
|
|
||||||
<li><a href="pyFTS.common.html#pyFTS.common.Util.distributed_train">distributed_train() (in module pyFTS.common.Util)</a>
|
|
||||||
</li>
|
</li>
|
||||||
<li><a href="pyFTS.common.html#pyFTS.common.Util.draw_sets_on_axis">draw_sets_on_axis() (in module pyFTS.common.Util)</a>
|
<li><a href="pyFTS.common.html#pyFTS.common.Util.draw_sets_on_axis">draw_sets_on_axis() (in module pyFTS.common.Util)</a>
|
||||||
</li>
|
</li>
|
||||||
@ -1158,6 +1154,8 @@
|
|||||||
<li><a href="pyFTS.common.html#pyFTS.common.Transformations.Transformation.inverse">(pyFTS.common.Transformations.Transformation method)</a>
|
<li><a href="pyFTS.common.html#pyFTS.common.Transformations.Transformation.inverse">(pyFTS.common.Transformations.Transformation method)</a>
|
||||||
</li>
|
</li>
|
||||||
</ul></li>
|
</ul></li>
|
||||||
|
<li><a href="pyFTS.common.html#pyFTS.common.fts.FTS.is_clustered">is_clustered (pyFTS.common.fts.FTS attribute)</a>
|
||||||
|
</li>
|
||||||
<li><a href="pyFTS.common.html#pyFTS.common.fts.FTS.is_high_order">is_high_order (pyFTS.common.fts.FTS attribute)</a>
|
<li><a href="pyFTS.common.html#pyFTS.common.fts.FTS.is_high_order">is_high_order (pyFTS.common.fts.FTS attribute)</a>
|
||||||
</li>
|
</li>
|
||||||
<li><a href="pyFTS.common.html#pyFTS.common.fts.FTS.is_multivariate">is_multivariate (pyFTS.common.fts.FTS attribute)</a>
|
<li><a href="pyFTS.common.html#pyFTS.common.fts.FTS.is_multivariate">is_multivariate (pyFTS.common.fts.FTS attribute)</a>
|
||||||
@ -1191,6 +1189,8 @@
|
|||||||
<table style="width: 100%" class="indextable genindextable"><tr>
|
<table style="width: 100%" class="indextable genindextable"><tr>
|
||||||
<td style="width: 33%; vertical-align: top;"><ul>
|
<td style="width: 33%; vertical-align: top;"><ul>
|
||||||
<li><a href="pyFTS.probabilistic.html#pyFTS.probabilistic.ProbabilityDistribution.ProbabilityDistribution.labels">labels (pyFTS.probabilistic.ProbabilityDistribution.ProbabilityDistribution attribute)</a>
|
<li><a href="pyFTS.probabilistic.html#pyFTS.probabilistic.ProbabilityDistribution.ProbabilityDistribution.labels">labels (pyFTS.probabilistic.ProbabilityDistribution.ProbabilityDistribution attribute)</a>
|
||||||
|
</li>
|
||||||
|
<li><a href="pyFTS.common.html#pyFTS.common.fts.FTS.lags">lags (pyFTS.common.fts.FTS attribute)</a>
|
||||||
</li>
|
</li>
|
||||||
<li><a href="pyFTS.common.html#pyFTS.common.fts.FTS.len_total">len_total() (pyFTS.common.fts.FTS method)</a>
|
<li><a href="pyFTS.common.html#pyFTS.common.fts.FTS.len_total">len_total() (pyFTS.common.fts.FTS method)</a>
|
||||||
</li>
|
</li>
|
||||||
@ -1231,6 +1231,8 @@
|
|||||||
<li><a href="pyFTS.benchmarks.html#pyFTS.benchmarks.Measures.mape">mape() (in module pyFTS.benchmarks.Measures)</a>
|
<li><a href="pyFTS.benchmarks.html#pyFTS.benchmarks.Measures.mape">mape() (in module pyFTS.benchmarks.Measures)</a>
|
||||||
</li>
|
</li>
|
||||||
<li><a href="pyFTS.benchmarks.html#pyFTS.benchmarks.Measures.mape_interval">mape_interval() (in module pyFTS.benchmarks.Measures)</a>
|
<li><a href="pyFTS.benchmarks.html#pyFTS.benchmarks.Measures.mape_interval">mape_interval() (in module pyFTS.benchmarks.Measures)</a>
|
||||||
|
</li>
|
||||||
|
<li><a href="pyFTS.models.multivariate.html#pyFTS.models.multivariate.variable.Variable.mask">mask (pyFTS.models.multivariate.variable.Variable attribute)</a>
|
||||||
</li>
|
</li>
|
||||||
<li><a href="pyFTS.common.html#pyFTS.common.fts.FTS.max_lag">max_lag (pyFTS.common.fts.FTS attribute)</a>
|
<li><a href="pyFTS.common.html#pyFTS.common.fts.FTS.max_lag">max_lag (pyFTS.common.fts.FTS attribute)</a>
|
||||||
</li>
|
</li>
|
||||||
@ -1828,12 +1830,12 @@
|
|||||||
</ul></li>
|
</ul></li>
|
||||||
<li><a href="pyFTS.common.html#pyFTS.common.FuzzySet.set_ordered">set_ordered() (in module pyFTS.common.FuzzySet)</a>
|
<li><a href="pyFTS.common.html#pyFTS.common.FuzzySet.set_ordered">set_ordered() (in module pyFTS.common.FuzzySet)</a>
|
||||||
</li>
|
</li>
|
||||||
|
</ul></td>
|
||||||
|
<td style="width: 33%; vertical-align: top;"><ul>
|
||||||
<li><a href="pyFTS.models.multivariate.html#pyFTS.models.multivariate.FLR.FLR.set_rhs">set_rhs() (pyFTS.models.multivariate.FLR.FLR method)</a>
|
<li><a href="pyFTS.models.multivariate.html#pyFTS.models.multivariate.FLR.FLR.set_rhs">set_rhs() (pyFTS.models.multivariate.FLR.FLR method)</a>
|
||||||
</li>
|
</li>
|
||||||
<li><a href="pyFTS.models.multivariate.html#pyFTS.models.multivariate.common.MultivariateFuzzySet.set_target_variable">set_target_variable() (pyFTS.models.multivariate.common.MultivariateFuzzySet method)</a>
|
<li><a href="pyFTS.models.multivariate.html#pyFTS.models.multivariate.common.MultivariateFuzzySet.set_target_variable">set_target_variable() (pyFTS.models.multivariate.common.MultivariateFuzzySet method)</a>
|
||||||
</li>
|
</li>
|
||||||
</ul></td>
|
|
||||||
<td style="width: 33%; vertical-align: top;"><ul>
|
|
||||||
<li><a href="pyFTS.models.ensemble.html#pyFTS.models.ensemble.ensemble.AllMethodEnsembleFTS.set_transformations">set_transformations() (pyFTS.models.ensemble.ensemble.AllMethodEnsembleFTS method)</a>
|
<li><a href="pyFTS.models.ensemble.html#pyFTS.models.ensemble.ensemble.AllMethodEnsembleFTS.set_transformations">set_transformations() (pyFTS.models.ensemble.ensemble.AllMethodEnsembleFTS method)</a>
|
||||||
</li>
|
</li>
|
||||||
<li><a href="pyFTS.partitioners.html#pyFTS.partitioners.partitioner.Partitioner.setnames">setnames (pyFTS.partitioners.partitioner.Partitioner attribute)</a>
|
<li><a href="pyFTS.partitioners.html#pyFTS.partitioners.partitioner.Partitioner.setnames">setnames (pyFTS.partitioners.partitioner.Partitioner attribute)</a>
|
||||||
@ -1847,10 +1849,6 @@
|
|||||||
<li><a href="pyFTS.common.html#pyFTS.common.Util.show_and_save_image">show_and_save_image() (in module pyFTS.common.Util)</a>
|
<li><a href="pyFTS.common.html#pyFTS.common.Util.show_and_save_image">show_and_save_image() (in module pyFTS.common.Util)</a>
|
||||||
</li>
|
</li>
|
||||||
<li><a href="pyFTS.common.html#pyFTS.common.Membership.sigmf">sigmf() (in module pyFTS.common.Membership)</a>
|
<li><a href="pyFTS.common.html#pyFTS.common.Membership.sigmf">sigmf() (in module pyFTS.common.Membership)</a>
|
||||||
</li>
|
|
||||||
<li><a href="pyFTS.common.html#pyFTS.common.Util.simple_model_predict">simple_model_predict() (in module pyFTS.common.Util)</a>
|
|
||||||
</li>
|
|
||||||
<li><a href="pyFTS.common.html#pyFTS.common.Util.simple_model_train">simple_model_train() (in module pyFTS.common.Util)</a>
|
|
||||||
</li>
|
</li>
|
||||||
<li><a href="pyFTS.models.nonstationary.html#pyFTS.models.nonstationary.partitioners.simplenonstationary_gridpartitioner_builder">simplenonstationary_gridpartitioner_builder() (in module pyFTS.models.nonstationary.partitioners)</a>
|
<li><a href="pyFTS.models.nonstationary.html#pyFTS.models.nonstationary.partitioners.simplenonstationary_gridpartitioner_builder">simplenonstationary_gridpartitioner_builder() (in module pyFTS.models.nonstationary.partitioners)</a>
|
||||||
</li>
|
</li>
|
||||||
@ -1879,12 +1877,8 @@
|
|||||||
<li><a href="pyFTS.partitioners.html#pyFTS.partitioners.Entropy.splitAbove">splitAbove() (in module pyFTS.partitioners.Entropy)</a>
|
<li><a href="pyFTS.partitioners.html#pyFTS.partitioners.Entropy.splitAbove">splitAbove() (in module pyFTS.partitioners.Entropy)</a>
|
||||||
</li>
|
</li>
|
||||||
<li><a href="pyFTS.partitioners.html#pyFTS.partitioners.Entropy.splitBelow">splitBelow() (in module pyFTS.partitioners.Entropy)</a>
|
<li><a href="pyFTS.partitioners.html#pyFTS.partitioners.Entropy.splitBelow">splitBelow() (in module pyFTS.partitioners.Entropy)</a>
|
||||||
</li>
|
|
||||||
<li><a href="pyFTS.common.html#pyFTS.common.Util.start_dispy_cluster">start_dispy_cluster() (in module pyFTS.common.Util)</a>
|
|
||||||
</li>
|
</li>
|
||||||
<li><a href="pyFTS.benchmarks.html#pyFTS.benchmarks.Util.stats">stats() (in module pyFTS.benchmarks.Util)</a>
|
<li><a href="pyFTS.benchmarks.html#pyFTS.benchmarks.Util.stats">stats() (in module pyFTS.benchmarks.Util)</a>
|
||||||
</li>
|
|
||||||
<li><a href="pyFTS.common.html#pyFTS.common.Util.stop_dispy_cluster">stop_dispy_cluster() (in module pyFTS.common.Util)</a>
|
|
||||||
</li>
|
</li>
|
||||||
<li><a href="pyFTS.models.seasonal.html#pyFTS.models.seasonal.common.strip_datepart">strip_datepart() (in module pyFTS.models.seasonal.common)</a>
|
<li><a href="pyFTS.models.seasonal.html#pyFTS.models.seasonal.common.strip_datepart">strip_datepart() (in module pyFTS.models.seasonal.common)</a>
|
||||||
</li>
|
</li>
|
||||||
|
BIN
docs/build/html/objects.inv
vendored
BIN
docs/build/html/objects.inv
vendored
Binary file not shown.
69
docs/build/html/pyFTS.common.html
vendored
69
docs/build/html/pyFTS.common.html
vendored
@ -452,8 +452,8 @@
|
|||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
<p>values for all fuzzy sets, both: return a list with tuples (fuzzy set, membership value) )
|
<p>values for all fuzzy sets, both: return a list with tuples (fuzzy set, membership value) )</p>
|
||||||
:returns a list with the fuzzyfied values, depending on the mode</p>
|
<p>:returns a list with the fuzzyfied values, depending on the mode</p>
|
||||||
</dd></dl>
|
</dd></dl>
|
||||||
|
|
||||||
<dl class="function">
|
<dl class="function">
|
||||||
@ -651,17 +651,15 @@
|
|||||||
<col class="field-name" />
|
<col class="field-name" />
|
||||||
<col class="field-body" />
|
<col class="field-body" />
|
||||||
<tbody valign="top">
|
<tbody valign="top">
|
||||||
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
|
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
|
||||||
<li><strong>x</strong> – </li>
|
<li><strong>x</strong> – </li>
|
||||||
<li><strong>parameters</strong> – an list with 2 real values (smoothness and midpoint)</li>
|
<li><strong>parameters</strong> – an list with 2 real values (smoothness and midpoint)</li>
|
||||||
</ul>
|
</ul>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last"></p>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
<p>:return</p>
|
||||||
</dd></dl>
|
</dd></dl>
|
||||||
|
|
||||||
<dl class="function">
|
<dl class="function">
|
||||||
@ -1192,16 +1190,6 @@ bisect but with a simpler API and support for key functions.</p>
|
|||||||
<code class="descclassname">pyFTS.common.Util.</code><code class="descname">current_milli_time</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#pyFTS.common.Util.current_milli_time" title="Permalink to this definition">¶</a></dt>
|
<code class="descclassname">pyFTS.common.Util.</code><code class="descname">current_milli_time</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#pyFTS.common.Util.current_milli_time" title="Permalink to this definition">¶</a></dt>
|
||||||
<dd></dd></dl>
|
<dd></dd></dl>
|
||||||
|
|
||||||
<dl class="function">
|
|
||||||
<dt id="pyFTS.common.Util.distributed_predict">
|
|
||||||
<code class="descclassname">pyFTS.common.Util.</code><code class="descname">distributed_predict</code><span class="sig-paren">(</span><em>model</em>, <em>parameters</em>, <em>nodes</em>, <em>data</em>, <em>num_batches</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pyFTS/common/Util.html#distributed_predict"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyFTS.common.Util.distributed_predict" title="Permalink to this definition">¶</a></dt>
|
|
||||||
<dd></dd></dl>
|
|
||||||
|
|
||||||
<dl class="function">
|
|
||||||
<dt id="pyFTS.common.Util.distributed_train">
|
|
||||||
<code class="descclassname">pyFTS.common.Util.</code><code class="descname">distributed_train</code><span class="sig-paren">(</span><em>model</em>, <em>train_method</em>, <em>nodes</em>, <em>fts_method</em>, <em>data</em>, <em>num_batches=10</em>, <em>train_parameters={}</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pyFTS/common/Util.html#distributed_train"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyFTS.common.Util.distributed_train" title="Permalink to this definition">¶</a></dt>
|
|
||||||
<dd></dd></dl>
|
|
||||||
|
|
||||||
<dl class="function">
|
<dl class="function">
|
||||||
<dt id="pyFTS.common.Util.draw_sets_on_axis">
|
<dt id="pyFTS.common.Util.draw_sets_on_axis">
|
||||||
<code class="descclassname">pyFTS.common.Util.</code><code class="descname">draw_sets_on_axis</code><span class="sig-paren">(</span><em>axis</em>, <em>model</em>, <em>size</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pyFTS/common/Util.html#draw_sets_on_axis"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyFTS.common.Util.draw_sets_on_axis" title="Permalink to this definition">¶</a></dt>
|
<code class="descclassname">pyFTS.common.Util.</code><code class="descname">draw_sets_on_axis</code><span class="sig-paren">(</span><em>axis</em>, <em>model</em>, <em>size</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pyFTS/common/Util.html#draw_sets_on_axis"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyFTS.common.Util.draw_sets_on_axis" title="Permalink to this definition">¶</a></dt>
|
||||||
@ -1290,16 +1278,6 @@ bisect but with a simpler API and support for key functions.</p>
|
|||||||
</table>
|
</table>
|
||||||
</dd></dl>
|
</dd></dl>
|
||||||
|
|
||||||
<dl class="function">
|
|
||||||
<dt id="pyFTS.common.Util.simple_model_predict">
|
|
||||||
<code class="descclassname">pyFTS.common.Util.</code><code class="descname">simple_model_predict</code><span class="sig-paren">(</span><em>model</em>, <em>data</em>, <em>parameters</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pyFTS/common/Util.html#simple_model_predict"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyFTS.common.Util.simple_model_predict" title="Permalink to this definition">¶</a></dt>
|
|
||||||
<dd></dd></dl>
|
|
||||||
|
|
||||||
<dl class="function">
|
|
||||||
<dt id="pyFTS.common.Util.simple_model_train">
|
|
||||||
<code class="descclassname">pyFTS.common.Util.</code><code class="descname">simple_model_train</code><span class="sig-paren">(</span><em>model</em>, <em>data</em>, <em>parameters</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pyFTS/common/Util.html#simple_model_train"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyFTS.common.Util.simple_model_train" title="Permalink to this definition">¶</a></dt>
|
|
||||||
<dd></dd></dl>
|
|
||||||
|
|
||||||
<dl class="function">
|
<dl class="function">
|
||||||
<dt id="pyFTS.common.Util.sliding_window">
|
<dt id="pyFTS.common.Util.sliding_window">
|
||||||
<code class="descclassname">pyFTS.common.Util.</code><code class="descname">sliding_window</code><span class="sig-paren">(</span><em>data</em>, <em>windowsize</em>, <em>train=0.8</em>, <em>inc=0.1</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pyFTS/common/Util.html#sliding_window"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyFTS.common.Util.sliding_window" title="Permalink to this definition">¶</a></dt>
|
<code class="descclassname">pyFTS.common.Util.</code><code class="descname">sliding_window</code><span class="sig-paren">(</span><em>data</em>, <em>windowsize</em>, <em>train=0.8</em>, <em>inc=0.1</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pyFTS/common/Util.html#sliding_window"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyFTS.common.Util.sliding_window" title="Permalink to this definition">¶</a></dt>
|
||||||
@ -1323,16 +1301,6 @@ bisect but with a simpler API and support for key functions.</p>
|
|||||||
</table>
|
</table>
|
||||||
</dd></dl>
|
</dd></dl>
|
||||||
|
|
||||||
<dl class="function">
|
|
||||||
<dt id="pyFTS.common.Util.start_dispy_cluster">
|
|
||||||
<code class="descclassname">pyFTS.common.Util.</code><code class="descname">start_dispy_cluster</code><span class="sig-paren">(</span><em>method</em>, <em>nodes</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pyFTS/common/Util.html#start_dispy_cluster"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyFTS.common.Util.start_dispy_cluster" title="Permalink to this definition">¶</a></dt>
|
|
||||||
<dd></dd></dl>
|
|
||||||
|
|
||||||
<dl class="function">
|
|
||||||
<dt id="pyFTS.common.Util.stop_dispy_cluster">
|
|
||||||
<code class="descclassname">pyFTS.common.Util.</code><code class="descname">stop_dispy_cluster</code><span class="sig-paren">(</span><em>cluster</em>, <em>http_server</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pyFTS/common/Util.html#stop_dispy_cluster"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyFTS.common.Util.stop_dispy_cluster" title="Permalink to this definition">¶</a></dt>
|
|
||||||
<dd></dd></dl>
|
|
||||||
|
|
||||||
<dl class="function">
|
<dl class="function">
|
||||||
<dt id="pyFTS.common.Util.uniquefilename">
|
<dt id="pyFTS.common.Util.uniquefilename">
|
||||||
<code class="descclassname">pyFTS.common.Util.</code><code class="descname">uniquefilename</code><span class="sig-paren">(</span><em>name</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pyFTS/common/Util.html#uniquefilename"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyFTS.common.Util.uniquefilename" title="Permalink to this definition">¶</a></dt>
|
<code class="descclassname">pyFTS.common.Util.</code><code class="descname">uniquefilename</code><span class="sig-paren">(</span><em>name</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pyFTS/common/Util.html#uniquefilename"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyFTS.common.Util.uniquefilename" title="Permalink to this definition">¶</a></dt>
|
||||||
@ -1472,6 +1440,22 @@ when the LHS pattern is identified on time t.</p>
|
|||||||
<dd><p>A float with the minimal membership to be considered on fuzzyfication process</p>
|
<dd><p>A float with the minimal membership to be considered on fuzzyfication process</p>
|
||||||
</dd></dl>
|
</dd></dl>
|
||||||
|
|
||||||
|
<dl class="method">
|
||||||
|
<dt id="pyFTS.common.fts.FTS.append_rule">
|
||||||
|
<code class="descname">append_rule</code><span class="sig-paren">(</span><em>flrg</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pyFTS/common/fts.html#FTS.append_rule"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyFTS.common.fts.FTS.append_rule" title="Permalink to this definition">¶</a></dt>
|
||||||
|
<dd><p>Append FLRG rule 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>flrg</strong> – rule</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="method">
|
<dl class="method">
|
||||||
<dt id="pyFTS.common.fts.FTS.append_transformation">
|
<dt id="pyFTS.common.fts.FTS.append_transformation">
|
||||||
<code class="descname">append_transformation</code><span class="sig-paren">(</span><em>transformation</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pyFTS/common/fts.html#FTS.append_transformation"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyFTS.common.fts.FTS.append_transformation" title="Permalink to this definition">¶</a></dt>
|
<code class="descname">append_transformation</code><span class="sig-paren">(</span><em>transformation</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pyFTS/common/fts.html#FTS.append_transformation"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyFTS.common.fts.FTS.append_transformation" title="Permalink to this definition">¶</a></dt>
|
||||||
@ -1808,6 +1792,13 @@ when the LHS pattern is identified on time t.</p>
|
|||||||
<dd><p>An pyFTS.models.seasonal.Indexer object for indexing the time series data</p>
|
<dd><p>An pyFTS.models.seasonal.Indexer object for indexing the time series data</p>
|
||||||
</dd></dl>
|
</dd></dl>
|
||||||
|
|
||||||
|
<dl class="attribute">
|
||||||
|
<dt id="pyFTS.common.fts.FTS.is_clustered">
|
||||||
|
<code class="descname">is_clustered</code><em class="property"> = None</em><a class="headerlink" href="#pyFTS.common.fts.FTS.is_clustered" title="Permalink to this definition">¶</a></dt>
|
||||||
|
<dd><p>A boolean value indicating if the model support multivariate time series (Pandas DataFrame), but works like
|
||||||
|
a monovariate method, default: False</p>
|
||||||
|
</dd></dl>
|
||||||
|
|
||||||
<dl class="attribute">
|
<dl class="attribute">
|
||||||
<dt id="pyFTS.common.fts.FTS.is_high_order">
|
<dt id="pyFTS.common.fts.FTS.is_high_order">
|
||||||
<code class="descname">is_high_order</code><em class="property"> = None</em><a class="headerlink" href="#pyFTS.common.fts.FTS.is_high_order" title="Permalink to this definition">¶</a></dt>
|
<code class="descname">is_high_order</code><em class="property"> = None</em><a class="headerlink" href="#pyFTS.common.fts.FTS.is_high_order" title="Permalink to this definition">¶</a></dt>
|
||||||
@ -1820,6 +1811,12 @@ when the LHS pattern is identified on time t.</p>
|
|||||||
<dd><p>A boolean value indicating if the model support multivariate time series (Pandas DataFrame), default: False</p>
|
<dd><p>A boolean value indicating if the model support multivariate time series (Pandas DataFrame), default: False</p>
|
||||||
</dd></dl>
|
</dd></dl>
|
||||||
|
|
||||||
|
<dl class="attribute">
|
||||||
|
<dt id="pyFTS.common.fts.FTS.lags">
|
||||||
|
<code class="descname">lags</code><em class="property"> = None</em><a class="headerlink" href="#pyFTS.common.fts.FTS.lags" title="Permalink to this definition">¶</a></dt>
|
||||||
|
<dd><p>The list of lag indexes for high order models</p>
|
||||||
|
</dd></dl>
|
||||||
|
|
||||||
<dl class="method">
|
<dl class="method">
|
||||||
<dt id="pyFTS.common.fts.FTS.len_total">
|
<dt id="pyFTS.common.fts.FTS.len_total">
|
||||||
<code class="descname">len_total</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/pyFTS/common/fts.html#FTS.len_total"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyFTS.common.fts.FTS.len_total" title="Permalink to this definition">¶</a></dt>
|
<code class="descname">len_total</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/pyFTS/common/fts.html#FTS.len_total"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyFTS.common.fts.FTS.len_total" title="Permalink to this definition">¶</a></dt>
|
||||||
|
32
docs/build/html/pyFTS.models.multivariate.html
vendored
32
docs/build/html/pyFTS.models.multivariate.html
vendored
@ -143,7 +143,7 @@
|
|||||||
<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>
|
<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">
|
<dl class="class">
|
||||||
<dt id="pyFTS.models.multivariate.common.MultivariateFuzzySet">
|
<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>
|
<em class="property">class </em><code class="descclassname">pyFTS.models.multivariate.common.</code><code class="descname">MultivariateFuzzySet</code><span class="sig-paren">(</span><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>
|
<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>
|
<p>Multivariate Composite Fuzzy Set</p>
|
||||||
<dl class="method">
|
<dl class="method">
|
||||||
@ -243,6 +243,18 @@ transformations and partitioners.</p>
|
|||||||
<dd><p>A string with the column name on DataFrame</p>
|
<dd><p>A string with the column name on DataFrame</p>
|
||||||
</dd></dl>
|
</dd></dl>
|
||||||
|
|
||||||
|
<dl class="attribute">
|
||||||
|
<dt id="pyFTS.models.multivariate.variable.Variable.data_type">
|
||||||
|
<code class="descname">data_type</code><em class="property"> = None</em><a class="headerlink" href="#pyFTS.models.multivariate.variable.Variable.data_type" title="Permalink to this definition">¶</a></dt>
|
||||||
|
<dd><p>The type of the data column on Pandas Dataframe</p>
|
||||||
|
</dd></dl>
|
||||||
|
|
||||||
|
<dl class="attribute">
|
||||||
|
<dt id="pyFTS.models.multivariate.variable.Variable.mask">
|
||||||
|
<code class="descname">mask</code><em class="property"> = None</em><a class="headerlink" href="#pyFTS.models.multivariate.variable.Variable.mask" title="Permalink to this definition">¶</a></dt>
|
||||||
|
<dd><p>The mask for format the data column on Pandas Dataframe</p>
|
||||||
|
</dd></dl>
|
||||||
|
|
||||||
<dl class="attribute">
|
<dl class="attribute">
|
||||||
<dt id="pyFTS.models.multivariate.variable.Variable.name">
|
<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>
|
<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>
|
||||||
@ -497,24 +509,6 @@ transformations and partitioners.</p>
|
|||||||
<code class="descname">check_data</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.check_data"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyFTS.models.multivariate.cmvfts.ClusteredMVFTS.check_data" title="Permalink to this definition">¶</a></dt>
|
<code class="descname">check_data</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.check_data"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyFTS.models.multivariate.cmvfts.ClusteredMVFTS.check_data" title="Permalink to this definition">¶</a></dt>
|
||||||
<dd></dd></dl>
|
<dd></dd></dl>
|
||||||
|
|
||||||
<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 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">
|
<dl class="method">
|
||||||
<dt id="pyFTS.models.multivariate.cmvfts.ClusteredMVFTS.forecast">
|
<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>
|
<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>
|
||||||
|
5
docs/build/html/pyFTS.partitioners.html
vendored
5
docs/build/html/pyFTS.partitioners.html
vendored
@ -533,6 +533,11 @@ Fuzzy Sets Syst., vol. 123, no. 3, pp. 387–394, Nov. 2001.</p>
|
|||||||
</table>
|
</table>
|
||||||
</dd></dl>
|
</dd></dl>
|
||||||
|
|
||||||
|
<dl class="method">
|
||||||
|
<dt id="pyFTS.partitioners.Simple.SimplePartitioner.append_complex">
|
||||||
|
<code class="descname">append_complex</code><span class="sig-paren">(</span><em>fs</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pyFTS/partitioners/Simple.html#SimplePartitioner.append_complex"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyFTS.partitioners.Simple.SimplePartitioner.append_complex" title="Permalink to this definition">¶</a></dt>
|
||||||
|
<dd></dd></dl>
|
||||||
|
|
||||||
</dd></dl>
|
</dd></dl>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
2
docs/build/html/searchindex.js
vendored
2
docs/build/html/searchindex.js
vendored
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user