Time Series sample classification infrastructure; WMVFTS is the first method with a functional implementation
This commit is contained in:
parent
4c77ecc73f
commit
7f6ab34b78
BIN
docs/build/doctrees/environment.pickle
vendored
BIN
docs/build/doctrees/environment.pickle
vendored
Binary file not shown.
BIN
docs/build/doctrees/index.doctree
vendored
BIN
docs/build/doctrees/index.doctree
vendored
Binary file not shown.
BIN
docs/build/doctrees/modules.doctree
vendored
BIN
docs/build/doctrees/modules.doctree
vendored
Binary file not shown.
BIN
docs/build/doctrees/pyFTS.benchmarks.doctree
vendored
BIN
docs/build/doctrees/pyFTS.benchmarks.doctree
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.data.doctree
vendored
BIN
docs/build/doctrees/pyFTS.data.doctree
vendored
Binary file not shown.
BIN
docs/build/doctrees/pyFTS.distributed.doctree
vendored
BIN
docs/build/doctrees/pyFTS.distributed.doctree
vendored
Binary file not shown.
BIN
docs/build/doctrees/pyFTS.doctree
vendored
BIN
docs/build/doctrees/pyFTS.doctree
vendored
Binary file not shown.
BIN
docs/build/doctrees/pyFTS.hyperparam.doctree
vendored
BIN
docs/build/doctrees/pyFTS.hyperparam.doctree
vendored
Binary file not shown.
BIN
docs/build/doctrees/pyFTS.models.doctree
vendored
BIN
docs/build/doctrees/pyFTS.models.doctree
vendored
Binary file not shown.
BIN
docs/build/doctrees/pyFTS.models.ensemble.doctree
vendored
BIN
docs/build/doctrees/pyFTS.models.ensemble.doctree
vendored
Binary file not shown.
BIN
docs/build/doctrees/pyFTS.models.incremental.doctree
vendored
BIN
docs/build/doctrees/pyFTS.models.incremental.doctree
vendored
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
docs/build/doctrees/pyFTS.models.seasonal.doctree
vendored
BIN
docs/build/doctrees/pyFTS.models.seasonal.doctree
vendored
Binary file not shown.
BIN
docs/build/doctrees/pyFTS.partitioners.doctree
vendored
BIN
docs/build/doctrees/pyFTS.partitioners.doctree
vendored
Binary file not shown.
BIN
docs/build/doctrees/pyFTS.probabilistic.doctree
vendored
BIN
docs/build/doctrees/pyFTS.probabilistic.doctree
vendored
Binary file not shown.
BIN
docs/build/doctrees/quickstart.doctree
vendored
BIN
docs/build/doctrees/quickstart.doctree
vendored
Binary file not shown.
2
docs/build/html/.buildinfo
vendored
2
docs/build/html/.buildinfo
vendored
@ -1,4 +1,4 @@
|
||||
# Sphinx build info version 1
|
||||
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
|
||||
config: 792c0fe81cc036dc5c5ce8f82ec8126e
|
||||
config: 1b798fc21ce10bb6cf5babd06a1805c0
|
||||
tags: 645f666f9bcd5a90fca523b33c5a78b7
|
||||
|
50
docs/build/html/_modules/index.html
vendored
50
docs/build/html/_modules/index.html
vendored
@ -42,24 +42,13 @@
|
||||
<div class="body" role="main">
|
||||
|
||||
<h1>All modules for which code is available</h1>
|
||||
<ul><li><a href="pyFTS/benchmarks/BSTS.html">pyFTS.benchmarks.BSTS</a></li>
|
||||
<li><a href="pyFTS/benchmarks/Measures.html">pyFTS.benchmarks.Measures</a></li>
|
||||
<li><a href="pyFTS/benchmarks/ResidualAnalysis.html">pyFTS.benchmarks.ResidualAnalysis</a></li>
|
||||
<li><a href="pyFTS/benchmarks/Tests.html">pyFTS.benchmarks.Tests</a></li>
|
||||
<li><a href="pyFTS/benchmarks/Util.html">pyFTS.benchmarks.Util</a></li>
|
||||
<li><a href="pyFTS/benchmarks/arima.html">pyFTS.benchmarks.arima</a></li>
|
||||
<li><a href="pyFTS/benchmarks/benchmarks.html">pyFTS.benchmarks.benchmarks</a></li>
|
||||
<li><a href="pyFTS/benchmarks/knn.html">pyFTS.benchmarks.knn</a></li>
|
||||
<li><a href="pyFTS/benchmarks/naive.html">pyFTS.benchmarks.naive</a></li>
|
||||
<li><a href="pyFTS/benchmarks/quantreg.html">pyFTS.benchmarks.quantreg</a></li>
|
||||
<ul><li><a href="pyFTS/common/Activations.html">pyFTS.common.Activations</a></li>
|
||||
<li><a href="pyFTS/common/Composite.html">pyFTS.common.Composite</a></li>
|
||||
<li><a href="pyFTS/common/FLR.html">pyFTS.common.FLR</a></li>
|
||||
<li><a href="pyFTS/common/FuzzySet.html">pyFTS.common.FuzzySet</a></li>
|
||||
<li><a href="pyFTS/common/Membership.html">pyFTS.common.Membership</a></li>
|
||||
<li><a href="pyFTS/common/SortedCollection.html">pyFTS.common.SortedCollection</a></li>
|
||||
<li><a href="pyFTS/common/Util.html">pyFTS.common.Util</a></li>
|
||||
<li><a href="pyFTS/common/flrg.html">pyFTS.common.flrg</a></li>
|
||||
<li><a href="pyFTS/common/fts.html">pyFTS.common.fts</a></li>
|
||||
<li><a href="pyFTS/common/transformations/boxcox.html">pyFTS.common.transformations.boxcox</a></li>
|
||||
<li><a href="pyFTS/common/transformations/differential.html">pyFTS.common.transformations.differential</a></li>
|
||||
<li><a href="pyFTS/common/transformations/normalization.html">pyFTS.common.transformations.normalization</a></li>
|
||||
@ -68,7 +57,6 @@
|
||||
<li><a href="pyFTS/common/transformations/smoothing.html">pyFTS.common.transformations.smoothing</a></li>
|
||||
<li><a href="pyFTS/common/transformations/som.html">pyFTS.common.transformations.som</a></li>
|
||||
<li><a href="pyFTS/common/transformations/transformation.html">pyFTS.common.transformations.transformation</a></li>
|
||||
<li><a href="pyFTS/common/transformations/trend.html">pyFTS.common.transformations.trend</a></li>
|
||||
<li><a href="pyFTS/common/tree.html">pyFTS.common.tree</a></li>
|
||||
<li><a href="pyFTS/data/AirPassengers.html">pyFTS.data.AirPassengers</a></li>
|
||||
<li><a href="pyFTS/data/Bitcoin.html">pyFTS.data.Bitcoin</a></li>
|
||||
@ -92,60 +80,28 @@
|
||||
<li><a href="pyFTS/data/mackey_glass.html">pyFTS.data.mackey_glass</a></li>
|
||||
<li><a href="pyFTS/data/rossler.html">pyFTS.data.rossler</a></li>
|
||||
<li><a href="pyFTS/data/sunspots.html">pyFTS.data.sunspots</a></li>
|
||||
<li><a href="pyFTS/hyperparam/Evolutionary.html">pyFTS.hyperparam.Evolutionary</a></li>
|
||||
<li><a href="pyFTS/hyperparam/GridSearch.html">pyFTS.hyperparam.GridSearch</a></li>
|
||||
<li><a href="pyFTS/hyperparam/Util.html">pyFTS.hyperparam.Util</a></li>
|
||||
<li><a href="pyFTS/models/chen.html">pyFTS.models.chen</a></li>
|
||||
<li><a href="pyFTS/models/cheng.html">pyFTS.models.cheng</a></li>
|
||||
<li><a href="pyFTS/models/ensemble/ensemble.html">pyFTS.models.ensemble.ensemble</a></li>
|
||||
<li><a href="pyFTS/models/ensemble/multiseasonal.html">pyFTS.models.ensemble.multiseasonal</a></li>
|
||||
<li><a href="pyFTS/models/hofts.html">pyFTS.models.hofts</a></li>
|
||||
<li><a href="pyFTS/models/hwang.html">pyFTS.models.hwang</a></li>
|
||||
<li><a href="pyFTS/models/ifts.html">pyFTS.models.ifts</a></li>
|
||||
<li><a href="pyFTS/models/incremental/IncrementalEnsemble.html">pyFTS.models.incremental.IncrementalEnsemble</a></li>
|
||||
<li><a href="pyFTS/models/incremental/TimeVariant.html">pyFTS.models.incremental.TimeVariant</a></li>
|
||||
<li><a href="pyFTS/models/ismailefendi.html">pyFTS.models.ismailefendi</a></li>
|
||||
<li><a href="pyFTS/models/multivariate/FLR.html">pyFTS.models.multivariate.FLR</a></li>
|
||||
<li><a href="pyFTS/models/multivariate/cmvfts.html">pyFTS.models.multivariate.cmvfts</a></li>
|
||||
<li><a href="pyFTS/models/multivariate/common.html">pyFTS.models.multivariate.common</a></li>
|
||||
<li><a href="pyFTS/models/multivariate/flrg.html">pyFTS.models.multivariate.flrg</a></li>
|
||||
<li><a href="pyFTS/models/multivariate/granular.html">pyFTS.models.multivariate.granular</a></li>
|
||||
<li><a href="pyFTS/models/multivariate/grid.html">pyFTS.models.multivariate.grid</a></li>
|
||||
<li><a href="pyFTS/models/multivariate/mvfts.html">pyFTS.models.multivariate.mvfts</a></li>
|
||||
<li><a href="pyFTS/models/multivariate/partitioner.html">pyFTS.models.multivariate.partitioner</a></li>
|
||||
<li><a href="pyFTS/models/multivariate/variable.html">pyFTS.models.multivariate.variable</a></li>
|
||||
<li><a href="pyFTS/models/multivariate/wmvfts.html">pyFTS.models.multivariate.wmvfts</a></li>
|
||||
<li><a href="pyFTS/models/nonstationary/common.html">pyFTS.models.nonstationary.common</a></li>
|
||||
<li><a href="pyFTS/models/nonstationary/cvfts.html">pyFTS.models.nonstationary.cvfts</a></li>
|
||||
<li><a href="pyFTS/models/nonstationary/flrg.html">pyFTS.models.nonstationary.flrg</a></li>
|
||||
<li><a href="pyFTS/models/nonstationary/honsfts.html">pyFTS.models.nonstationary.honsfts</a></li>
|
||||
<li><a href="pyFTS/models/nonstationary/nsfts.html">pyFTS.models.nonstationary.nsfts</a></li>
|
||||
<li><a href="pyFTS/models/nonstationary/partitioners.html">pyFTS.models.nonstationary.partitioners</a></li>
|
||||
<li><a href="pyFTS/models/nonstationary/perturbation.html">pyFTS.models.nonstationary.perturbation</a></li>
|
||||
<li><a href="pyFTS/models/nonstationary/util.html">pyFTS.models.nonstationary.util</a></li>
|
||||
<li><a href="pyFTS/models/pwfts.html">pyFTS.models.pwfts</a></li>
|
||||
<li><a href="pyFTS/models/sadaei.html">pyFTS.models.sadaei</a></li>
|
||||
<li><a href="pyFTS/models/seasonal/SeasonalIndexer.html">pyFTS.models.seasonal.SeasonalIndexer</a></li>
|
||||
<li><a href="pyFTS/models/seasonal/cmsfts.html">pyFTS.models.seasonal.cmsfts</a></li>
|
||||
<li><a href="pyFTS/models/seasonal/common.html">pyFTS.models.seasonal.common</a></li>
|
||||
<li><a href="pyFTS/models/seasonal/msfts.html">pyFTS.models.seasonal.msfts</a></li>
|
||||
<li><a href="pyFTS/models/seasonal/partitioner.html">pyFTS.models.seasonal.partitioner</a></li>
|
||||
<li><a href="pyFTS/models/seasonal/sfts.html">pyFTS.models.seasonal.sfts</a></li>
|
||||
<li><a href="pyFTS/models/song.html">pyFTS.models.song</a></li>
|
||||
<li><a href="pyFTS/models/yu.html">pyFTS.models.yu</a></li>
|
||||
<li><a href="pyFTS/partitioners/CMeans.html">pyFTS.partitioners.CMeans</a></li>
|
||||
<li><a href="pyFTS/partitioners/ClassPartitioner.html">pyFTS.partitioners.ClassPartitioner</a></li>
|
||||
<li><a href="pyFTS/partitioners/Entropy.html">pyFTS.partitioners.Entropy</a></li>
|
||||
<li><a href="pyFTS/partitioners/FCM.html">pyFTS.partitioners.FCM</a></li>
|
||||
<li><a href="pyFTS/partitioners/Grid.html">pyFTS.partitioners.Grid</a></li>
|
||||
<li><a href="pyFTS/partitioners/Huarng.html">pyFTS.partitioners.Huarng</a></li>
|
||||
<li><a href="pyFTS/partitioners/Simple.html">pyFTS.partitioners.Simple</a></li>
|
||||
<li><a href="pyFTS/partitioners/Singleton.html">pyFTS.partitioners.Singleton</a></li>
|
||||
<li><a href="pyFTS/partitioners/SubClust.html">pyFTS.partitioners.SubClust</a></li>
|
||||
<li><a href="pyFTS/partitioners/Util.html">pyFTS.partitioners.Util</a></li>
|
||||
<li><a href="pyFTS/partitioners/parallel_util.html">pyFTS.partitioners.parallel_util</a></li>
|
||||
<li><a href="pyFTS/partitioners/partitioner.html">pyFTS.partitioners.partitioner</a></li>
|
||||
<li><a href="pyFTS/probabilistic/ProbabilityDistribution.html">pyFTS.probabilistic.ProbabilityDistribution</a></li>
|
||||
<li><a href="pyFTS/probabilistic/kde.html">pyFTS.probabilistic.kde</a></li>
|
||||
</ul>
|
||||
|
||||
<div class="clearer"></div>
|
||||
@ -183,7 +139,7 @@
|
||||
</div>
|
||||
<div class="footer" role="contentinfo">
|
||||
© Copyright 2022, Machine Intelligence and Data Science Laboratory - UFMG - Brazil.
|
||||
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 4.5.0.
|
||||
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 4.3.2.
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
106
docs/build/html/_modules/pyFTS/common/Activations.html
vendored
Normal file
106
docs/build/html/_modules/pyFTS/common/Activations.html
vendored
Normal file
@ -0,0 +1,106 @@
|
||||
|
||||
|
||||
<!doctype html>
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>pyFTS.common.Activations — pyFTS 1.7 documentation</title>
|
||||
<link rel="stylesheet" type="text/css" href="../../../_static/pygments.css" />
|
||||
<link rel="stylesheet" type="text/css" href="../../../_static/bizstyle.css" />
|
||||
|
||||
<script data-url_root="../../../" id="documentation_options" src="../../../_static/documentation_options.js"></script>
|
||||
<script src="../../../_static/jquery.js"></script>
|
||||
<script src="../../../_static/underscore.js"></script>
|
||||
<script src="../../../_static/doctools.js"></script>
|
||||
<script src="../../../_static/bizstyle.js"></script>
|
||||
<link rel="index" title="Index" href="../../../genindex.html" />
|
||||
<link rel="search" title="Search" href="../../../search.html" />
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1.0" />
|
||||
<!--[if lt IE 9]>
|
||||
<script src="_static/css3-mediaqueries.js"></script>
|
||||
<![endif]-->
|
||||
</head><body>
|
||||
<div class="related" role="navigation" aria-label="related navigation">
|
||||
<h3>Navigation</h3>
|
||||
<ul>
|
||||
<li class="right" style="margin-right: 10px">
|
||||
<a href="../../../genindex.html" title="General Index"
|
||||
accesskey="I">index</a></li>
|
||||
<li class="right" >
|
||||
<a href="../../../py-modindex.html" title="Python Module Index"
|
||||
>modules</a> |</li>
|
||||
<li class="nav-item nav-item-0"><a href="../../../index.html">pyFTS 1.7 documentation</a> »</li>
|
||||
<li class="nav-item nav-item-1"><a href="../../index.html" accesskey="U">Module code</a> »</li>
|
||||
<li class="nav-item nav-item-this"><a href="">pyFTS.common.Activations</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="document">
|
||||
<div class="documentwrapper">
|
||||
<div class="bodywrapper">
|
||||
<div class="body" role="main">
|
||||
|
||||
<h1>Source code for pyFTS.common.Activations</h1><div class="highlight"><pre>
|
||||
<span></span><span class="sd">"""</span>
|
||||
<span class="sd">Activation functions for Time Series Classification</span>
|
||||
<span class="sd">"""</span>
|
||||
|
||||
<span class="kn">import</span> <span class="nn">numpy</span> <span class="k">as</span> <span class="nn">np</span>
|
||||
<span class="kn">import</span> <span class="nn">math</span>
|
||||
<span class="kn">from</span> <span class="nn">pyFTS</span> <span class="kn">import</span> <span class="o">*</span>
|
||||
|
||||
<div class="viewcode-block" id="scale"><a class="viewcode-back" href="../../../pyFTS.common.html#pyFTS.common.Activations.scale">[docs]</a><span class="k">def</span> <span class="nf">scale</span><span class="p">(</span><span class="n">dist</span> <span class="p">:</span> <span class="nb">dict</span><span class="p">)</span> <span class="o">-></span> <span class="nb">dict</span><span class="p">:</span>
|
||||
<span class="n">norm</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">v</span> <span class="k">for</span> <span class="n">v</span> <span class="ow">in</span> <span class="n">dist</span><span class="o">.</span><span class="n">values</span><span class="p">()])</span>
|
||||
<span class="k">return</span> <span class="p">{</span><span class="n">k</span> <span class="p">:</span> <span class="p">(</span><span class="n">v</span> <span class="o">/</span> <span class="n">norm</span><span class="p">)</span> <span class="k">for</span> <span class="n">k</span><span class="p">,</span><span class="n">v</span> <span class="ow">in</span> <span class="n">dist</span><span class="o">.</span><span class="n">items</span><span class="p">()</span> <span class="p">}</span></div>
|
||||
|
||||
<div class="viewcode-block" id="softmax"><a class="viewcode-back" href="../../../pyFTS.common.html#pyFTS.common.Activations.softmax">[docs]</a><span class="k">def</span> <span class="nf">softmax</span><span class="p">(</span><span class="n">dist</span> <span class="p">:</span> <span class="nb">dict</span><span class="p">)</span> <span class="o">-></span> <span class="nb">dict</span><span class="p">:</span>
|
||||
<span class="n">norm</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">exp</span><span class="p">(</span><span class="n">v</span><span class="p">)</span> <span class="k">for</span> <span class="n">v</span> <span class="ow">in</span> <span class="n">dist</span><span class="o">.</span><span class="n">values</span><span class="p">()])</span>
|
||||
<span class="k">return</span> <span class="p">{</span><span class="n">k</span> <span class="p">:</span> <span class="p">(</span><span class="n">np</span><span class="o">.</span><span class="n">exp</span><span class="p">(</span><span class="n">v</span><span class="p">)</span> <span class="o">/</span> <span class="n">norm</span><span class="p">)</span> <span class="k">for</span> <span class="n">k</span><span class="p">,</span><span class="n">v</span> <span class="ow">in</span> <span class="n">dist</span><span class="o">.</span><span class="n">items</span><span class="p">()</span> <span class="p">}</span></div>
|
||||
|
||||
<div class="viewcode-block" id="argmax"><a class="viewcode-back" href="../../../pyFTS.common.html#pyFTS.common.Activations.argmax">[docs]</a><span class="k">def</span> <span class="nf">argmax</span><span class="p">(</span><span class="n">dist</span> <span class="p">:</span> <span class="nb">dict</span><span class="p">)</span> <span class="o">-></span> <span class="nb">str</span><span class="p">:</span>
|
||||
<span class="n">mx</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">max</span><span class="p">([</span><span class="n">v</span> <span class="k">for</span> <span class="n">v</span> <span class="ow">in</span> <span class="n">dist</span><span class="o">.</span><span class="n">values</span><span class="p">()])</span>
|
||||
<span class="k">return</span> <span class="p">[</span><span class="n">k</span> <span class="k">for</span> <span class="n">k</span><span class="p">,</span><span class="n">v</span> <span class="ow">in</span> <span class="n">dist</span><span class="o">.</span><span class="n">items</span><span class="p">()</span> <span class="k">if</span> <span class="n">v</span> <span class="o">==</span> <span class="n">mx</span> <span class="p">][</span><span class="mi">0</span><span class="p">]</span></div>
|
||||
</pre></div>
|
||||
|
||||
<div class="clearer"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
|
||||
<div class="sphinxsidebarwrapper">
|
||||
<div id="searchbox" style="display: none" role="search">
|
||||
<h3 id="searchlabel">Quick search</h3>
|
||||
<div class="searchformwrapper">
|
||||
<form class="search" action="../../../search.html" method="get">
|
||||
<input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
|
||||
<input type="submit" value="Go" />
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<script>$('#searchbox').show(0);</script>
|
||||
</div>
|
||||
</div>
|
||||
<div class="clearer"></div>
|
||||
</div>
|
||||
<div class="related" role="navigation" aria-label="related navigation">
|
||||
<h3>Navigation</h3>
|
||||
<ul>
|
||||
<li class="right" style="margin-right: 10px">
|
||||
<a href="../../../genindex.html" title="General Index"
|
||||
>index</a></li>
|
||||
<li class="right" >
|
||||
<a href="../../../py-modindex.html" title="Python Module Index"
|
||||
>modules</a> |</li>
|
||||
<li class="nav-item nav-item-0"><a href="../../../index.html">pyFTS 1.7 documentation</a> »</li>
|
||||
<li class="nav-item nav-item-1"><a href="../../index.html" >Module code</a> »</li>
|
||||
<li class="nav-item nav-item-this"><a href="">pyFTS.common.Activations</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="footer" role="contentinfo">
|
||||
© Copyright 2022, Machine Intelligence and Data Science Laboratory - UFMG - Brazil.
|
||||
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 4.3.2.
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
@ -48,16 +48,16 @@
|
||||
<span class="sd">"""</span>
|
||||
|
||||
<span class="kn">import</span> <span class="nn">numpy</span> <span class="k">as</span> <span class="nn">np</span>
|
||||
<span class="kn">from</span> <span class="nn">pyFTS</span> <span class="k">import</span> <span class="o">*</span>
|
||||
<span class="kn">from</span> <span class="nn">pyFTS.common</span> <span class="k">import</span> <span class="n">Membership</span><span class="p">,</span> <span class="n">FuzzySet</span>
|
||||
<span class="kn">from</span> <span class="nn">pyFTS</span> <span class="kn">import</span> <span class="o">*</span>
|
||||
<span class="kn">from</span> <span class="nn">pyFTS.common</span> <span class="kn">import</span> <span class="n">Membership</span><span class="p">,</span> <span class="n">FuzzySet</span>
|
||||
|
||||
|
||||
<div class="viewcode-block" id="FuzzySet"><a class="viewcode-back" href="../../../pyFTS.common.html#pyFTS.common.Composite.FuzzySet">[docs]</a><span class="k">class</span> <span class="nc">FuzzySet</span><span class="p">(</span><span class="n">FuzzySet</span><span class="o">.</span><span class="n">FuzzySet</span><span class="p">):</span>
|
||||
<span class="sd">"""</span>
|
||||
<span class="w"> </span><span class="sd">"""</span>
|
||||
<span class="sd"> Composite Fuzzy Set</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="n">superset</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
|
||||
<span class="sd">"""</span>
|
||||
<span class="k">def</span> <span class="fm">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">name</span><span class="p">,</span> <span class="n">superset</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
|
||||
<span class="w"> </span><span class="sd">"""</span>
|
||||
<span class="sd"> Create an empty composite fuzzy set</span>
|
||||
<span class="sd"> :param name: fuzzy set name</span>
|
||||
<span class="sd"> """</span>
|
||||
@ -77,7 +77,7 @@
|
||||
|
||||
|
||||
<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="w"> </span><span class="sd">"""</span>
|
||||
<span class="sd"> Calculate the membership value of a given input</span>
|
||||
|
||||
<span class="sd"> :param x: input value</span>
|
||||
@ -92,7 +92,7 @@
|
||||
<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">sets</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span><span class="o">.</span><span class="n">transform</span><span class="p">(</span><span class="n">x</span><span class="p">)</span></div>
|
||||
|
||||
<div class="viewcode-block" id="FuzzySet.append"><a class="viewcode-back" href="../../../pyFTS.common.html#pyFTS.common.Composite.FuzzySet.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">mf</span><span class="p">,</span> <span class="n">parameters</span><span class="p">):</span>
|
||||
<span class="sd">"""</span>
|
||||
<span class="w"> </span><span class="sd">"""</span>
|
||||
<span class="sd"> Adds a new function to composition</span>
|
||||
|
||||
<span class="sd"> :param mf:</span>
|
||||
@ -103,7 +103,7 @@
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">parameters</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">parameters</span><span class="p">)</span></div>
|
||||
|
||||
<div class="viewcode-block" id="FuzzySet.append_set"><a class="viewcode-back" href="../../../pyFTS.common.html#pyFTS.common.Composite.FuzzySet.append_set">[docs]</a> <span class="k">def</span> <span class="nf">append_set</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="nb">set</span><span class="p">):</span>
|
||||
<span class="sd">"""</span>
|
||||
<span class="w"> </span><span class="sd">"""</span>
|
||||
<span class="sd"> Adds a new function to composition</span>
|
||||
|
||||
<span class="sd"> :param mf:</span>
|
||||
@ -122,7 +122,7 @@
|
||||
<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="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="fm">__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="nb">str</span><span class="p">([</span><span class="nb">str</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">sets</span><span class="p">])</span>
|
||||
<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">name</span><span class="p">,</span> <span class="n">tmp</span><span class="p">)</span></div>
|
||||
|
||||
@ -165,7 +165,7 @@
|
||||
</div>
|
||||
<div class="footer" role="contentinfo">
|
||||
© Copyright 2022, Machine Intelligence and Data Science Laboratory - UFMG - Brazil.
|
||||
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 4.5.0.
|
||||
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 4.3.2.
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
34
docs/build/html/_modules/pyFTS/common/FLR.html
vendored
34
docs/build/html/_modules/pyFTS/common/FLR.html
vendored
@ -48,44 +48,44 @@
|
||||
<span class="sd">"""</span>
|
||||
|
||||
<span class="kn">import</span> <span class="nn">numpy</span> <span class="k">as</span> <span class="nn">np</span>
|
||||
<span class="kn">from</span> <span class="nn">pyFTS.common</span> <span class="k">import</span> <span class="n">FuzzySet</span>
|
||||
<span class="kn">from</span> <span class="nn">pyFTS.common</span> <span class="kn">import</span> <span class="n">FuzzySet</span>
|
||||
|
||||
|
||||
<div class="viewcode-block" id="FLR"><a class="viewcode-back" href="../../../pyFTS.common.html#pyFTS.common.FLR.FLR">[docs]</a><span class="k">class</span> <span class="nc">FLR</span><span class="p">(</span><span class="nb">object</span><span class="p">):</span>
|
||||
<span class="sd">"""</span>
|
||||
<span class="w"> </span><span class="sd">"""</span>
|
||||
<span class="sd"> Fuzzy Logical Relationship</span>
|
||||
|
||||
<span class="sd"> Represents a temporal transition of the fuzzy set LHS on time t for the fuzzy set RHS on time t+1.</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">LHS</span><span class="p">,</span> <span class="n">RHS</span><span class="p">):</span>
|
||||
<span class="sd">"""</span>
|
||||
<span class="k">def</span> <span class="fm">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">LHS</span><span class="p">,</span> <span class="n">RHS</span><span class="p">):</span>
|
||||
<span class="w"> </span><span class="sd">"""</span>
|
||||
<span class="sd"> Creates a Fuzzy Logical Relationship</span>
|
||||
<span class="sd"> """</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">LHS</span> <span class="o">=</span> <span class="n">LHS</span>
|
||||
<span class="sd">"""Left Hand Side fuzzy set"""</span>
|
||||
<span class="w"> </span><span class="sd">"""Left Hand Side fuzzy set"""</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">RHS</span> <span class="o">=</span> <span class="n">RHS</span>
|
||||
<span class="sd">"""Right Hand Side fuzzy set"""</span>
|
||||
<span class="w"> </span><span class="sd">"""Right Hand Side fuzzy set"""</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">def</span> <span class="fm">__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="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">RHS</span><span class="p">)</span></div>
|
||||
|
||||
|
||||
<div class="viewcode-block" id="IndexedFLR"><a class="viewcode-back" href="../../../pyFTS.common.html#pyFTS.common.FLR.IndexedFLR">[docs]</a><span class="k">class</span> <span class="nc">IndexedFLR</span><span class="p">(</span><span class="n">FLR</span><span class="p">):</span>
|
||||
<span class="sd">"""Season Indexed Fuzzy Logical Relationship"""</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">index</span><span class="p">,</span> <span class="n">LHS</span><span class="p">,</span> <span class="n">RHS</span><span class="p">):</span>
|
||||
<span class="sd">"""</span>
|
||||
<span class="w"> </span><span class="sd">"""Season Indexed Fuzzy Logical Relationship"""</span>
|
||||
<span class="k">def</span> <span class="fm">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">index</span><span class="p">,</span> <span class="n">LHS</span><span class="p">,</span> <span class="n">RHS</span><span class="p">):</span>
|
||||
<span class="w"> </span><span class="sd">"""</span>
|
||||
<span class="sd"> Create a Season Indexed Fuzzy Logical Relationship</span>
|
||||
<span class="sd"> """</span>
|
||||
<span class="nb">super</span><span class="p">(</span><span class="n">IndexedFLR</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">LHS</span><span class="p">,</span> <span class="n">RHS</span><span class="p">)</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">index</span> <span class="o">=</span> <span class="n">index</span>
|
||||
<span class="sd">"""seasonal index"""</span>
|
||||
<span class="w"> </span><span class="sd">"""seasonal index"""</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">def</span> <span class="fm">__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">index</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">LHS</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">RHS</span><span class="p">)</span></div>
|
||||
|
||||
|
||||
<div class="viewcode-block" id="generate_high_order_recurrent_flr"><a class="viewcode-back" href="../../../pyFTS.common.html#pyFTS.common.FLR.generate_high_order_recurrent_flr">[docs]</a><span class="k">def</span> <span class="nf">generate_high_order_recurrent_flr</span><span class="p">(</span><span class="n">fuzzyData</span><span class="p">):</span>
|
||||
<span class="sd">"""</span>
|
||||
<span class="w"> </span><span class="sd">"""</span>
|
||||
<span class="sd"> Create a ordered FLR set from a list of fuzzy sets with recurrence</span>
|
||||
|
||||
<span class="sd"> :param fuzzyData: ordered list of fuzzy sets</span>
|
||||
@ -107,7 +107,7 @@
|
||||
|
||||
|
||||
<div class="viewcode-block" id="generate_recurrent_flrs"><a class="viewcode-back" href="../../../pyFTS.common.html#pyFTS.common.FLR.generate_recurrent_flrs">[docs]</a><span class="k">def</span> <span class="nf">generate_recurrent_flrs</span><span class="p">(</span><span class="n">fuzzyData</span><span class="p">,</span> <span class="n">steps</span> <span class="o">=</span> <span class="mi">1</span><span class="p">):</span>
|
||||
<span class="sd">"""</span>
|
||||
<span class="w"> </span><span class="sd">"""</span>
|
||||
<span class="sd"> Create a ordered FLR set from a list of fuzzy sets with recurrence</span>
|
||||
|
||||
<span class="sd"> :param fuzzyData: ordered list of fuzzy sets</span>
|
||||
@ -127,7 +127,7 @@
|
||||
|
||||
|
||||
<div class="viewcode-block" id="generate_non_recurrent_flrs"><a class="viewcode-back" href="../../../pyFTS.common.html#pyFTS.common.FLR.generate_non_recurrent_flrs">[docs]</a><span class="k">def</span> <span class="nf">generate_non_recurrent_flrs</span><span class="p">(</span><span class="n">fuzzyData</span><span class="p">,</span> <span class="n">steps</span> <span class="o">=</span> <span class="mi">1</span><span class="p">):</span>
|
||||
<span class="sd">"""</span>
|
||||
<span class="w"> </span><span class="sd">"""</span>
|
||||
<span class="sd"> Create a ordered FLR set from a list of fuzzy sets without recurrence</span>
|
||||
|
||||
<span class="sd"> :param fuzzyData: ordered list of fuzzy sets</span>
|
||||
@ -141,7 +141,7 @@
|
||||
|
||||
|
||||
<div class="viewcode-block" id="generate_indexed_flrs"><a class="viewcode-back" href="../../../pyFTS.common.html#pyFTS.common.FLR.generate_indexed_flrs">[docs]</a><span class="k">def</span> <span class="nf">generate_indexed_flrs</span><span class="p">(</span><span class="n">sets</span><span class="p">,</span> <span class="n">indexer</span><span class="p">,</span> <span class="n">data</span><span class="p">,</span> <span class="n">transformation</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">alpha_cut</span><span class="o">=</span><span class="mf">0.0</span><span class="p">):</span>
|
||||
<span class="sd">"""</span>
|
||||
<span class="w"> </span><span class="sd">"""</span>
|
||||
<span class="sd"> Create a season-indexed ordered FLR set from a list of fuzzy sets with recurrence</span>
|
||||
|
||||
<span class="sd"> :param sets: fuzzy sets</span>
|
||||
@ -201,7 +201,7 @@
|
||||
</div>
|
||||
<div class="footer" role="contentinfo">
|
||||
© Copyright 2022, Machine Intelligence and Data Science Laboratory - UFMG - Brazil.
|
||||
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 4.5.0.
|
||||
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 4.3.2.
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
@ -44,35 +44,35 @@
|
||||
|
||||
<h1>Source code for pyFTS.common.FuzzySet</h1><div class="highlight"><pre>
|
||||
<span></span><span class="kn">import</span> <span class="nn">numpy</span> <span class="k">as</span> <span class="nn">np</span>
|
||||
<span class="kn">from</span> <span class="nn">pyFTS</span> <span class="k">import</span> <span class="o">*</span>
|
||||
<span class="kn">from</span> <span class="nn">pyFTS.common</span> <span class="k">import</span> <span class="n">Membership</span>
|
||||
<span class="kn">from</span> <span class="nn">pyFTS</span> <span class="kn">import</span> <span class="o">*</span>
|
||||
<span class="kn">from</span> <span class="nn">pyFTS.common</span> <span class="kn">import</span> <span class="n">Membership</span>
|
||||
|
||||
|
||||
<div class="viewcode-block" id="FuzzySet"><a class="viewcode-back" href="../../../pyFTS.common.html#pyFTS.common.FuzzySet.FuzzySet">[docs]</a><span class="k">class</span> <span class="nc">FuzzySet</span><span class="p">(</span><span class="nb">object</span><span class="p">):</span>
|
||||
<span class="sd">"""</span>
|
||||
<span class="w"> </span><span class="sd">"""</span>
|
||||
<span class="sd"> Fuzzy Set</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="nb">str</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="nb">list</span><span class="p">,</span> <span class="n">centroid</span> <span class="p">:</span> <span class="nb">float</span><span class="p">,</span> <span class="n">alpha</span> <span class="p">:</span> <span class="nb">float</span><span class="o">=</span><span class="mf">1.0</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
|
||||
<span class="sd">"""</span>
|
||||
<span class="k">def</span> <span class="fm">__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="nb">str</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="nb">list</span><span class="p">,</span> <span class="n">centroid</span> <span class="p">:</span> <span class="nb">float</span><span class="p">,</span> <span class="n">alpha</span> <span class="p">:</span> <span class="nb">float</span><span class="o">=</span><span class="mf">1.0</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
|
||||
<span class="w"> </span><span class="sd">"""</span>
|
||||
<span class="sd"> Create a Fuzzy Set</span>
|
||||
<span class="sd"> """</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">name</span> <span class="p">:</span> <span class="nb">str</span> <span class="o">=</span> <span class="n">name</span>
|
||||
<span class="sd">"""The fuzzy set name"""</span>
|
||||
<span class="w"> </span><span class="sd">"""The fuzzy set name"""</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">mf</span> <span class="o">=</span> <span class="n">mf</span>
|
||||
<span class="sd">"""The membership function"""</span>
|
||||
<span class="w"> </span><span class="sd">"""The membership function"""</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">parameters</span> <span class="p">:</span> <span class="nb">list</span> <span class="o">=</span> <span class="n">parameters</span>
|
||||
<span class="sd">"""The parameters of the membership function"""</span>
|
||||
<span class="w"> </span><span class="sd">"""The parameters of the membership function"""</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">centroid</span> <span class="p">:</span> <span class="nb">float</span> <span class="o">=</span> <span class="n">centroid</span>
|
||||
<span class="sd">"""The fuzzy set center of mass (or midpoint)"""</span>
|
||||
<span class="w"> </span><span class="sd">"""The fuzzy set center of mass (or midpoint)"""</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">alpha</span> <span class="p">:</span> <span class="nb">float</span> <span class="o">=</span> <span class="n">alpha</span>
|
||||
<span class="sd">"""The alpha cut value"""</span>
|
||||
<span class="w"> </span><span class="sd">"""The alpha cut value"""</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">type</span> <span class="p">:</span> <span class="nb">str</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="sd">"""The fuzzy set type (common, composite, nonstationary, etc)"""</span>
|
||||
<span class="w"> </span><span class="sd">"""The fuzzy set type (common, composite, nonstationary, etc)"""</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">variable</span> <span class="o">=</span> <span class="n">kwargs</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">'variable'</span><span class="p">,</span> <span class="kc">None</span><span class="p">)</span>
|
||||
<span class="sd">"""In multivariate time series, indicate for which variable this fuzzy set belogs"""</span>
|
||||
<span class="w"> </span><span class="sd">"""In multivariate time series, indicate for which variable this fuzzy set belogs"""</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="w"> </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>
|
||||
@ -89,7 +89,7 @@
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">metadata</span> <span class="o">=</span> <span class="p">{}</span>
|
||||
|
||||
<div class="viewcode-block" id="FuzzySet.transform"><a class="viewcode-back" href="../../../pyFTS.common.html#pyFTS.common.FuzzySet.FuzzySet.transform">[docs]</a> <span class="k">def</span> <span class="nf">transform</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">x</span><span class="p">):</span>
|
||||
<span class="sd">"""</span>
|
||||
<span class="w"> </span><span class="sd">"""</span>
|
||||
<span class="sd"> Preprocess the data point for non native types</span>
|
||||
|
||||
<span class="sd"> :param x:</span>
|
||||
@ -99,7 +99,7 @@
|
||||
<span class="k">return</span> <span class="n">x</span></div>
|
||||
|
||||
<div class="viewcode-block" id="FuzzySet.membership"><a class="viewcode-back" href="../../../pyFTS.common.html#pyFTS.common.FuzzySet.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="w"> </span><span class="sd">"""</span>
|
||||
<span class="sd"> Calculate the membership value of a given input</span>
|
||||
|
||||
<span class="sd"> :param x: input value </span>
|
||||
@ -108,7 +108,7 @@
|
||||
<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">mf</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">transform</span><span class="p">(</span><span class="n">x</span><span class="p">),</span> <span class="bp">self</span><span class="o">.</span><span class="n">parameters</span><span class="p">)</span> <span class="o">*</span> <span class="bp">self</span><span class="o">.</span><span class="n">alpha</span></div>
|
||||
|
||||
<div class="viewcode-block" id="FuzzySet.partition_function"><a class="viewcode-back" href="../../../pyFTS.common.html#pyFTS.common.FuzzySet.FuzzySet.partition_function">[docs]</a> <span class="k">def</span> <span class="nf">partition_function</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">uod</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">nbins</span><span class="o">=</span><span class="mi">100</span><span class="p">):</span>
|
||||
<span class="sd">"""</span>
|
||||
<span class="w"> </span><span class="sd">"""</span>
|
||||
<span class="sd"> Calculate the partition function over the membership function.</span>
|
||||
|
||||
<span class="sd"> :param uod:</span>
|
||||
@ -122,12 +122,12 @@
|
||||
|
||||
<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">Z</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="fm">__str__</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
|
||||
<span class="k">return</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="o">+</span> <span class="nb">str</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="vm">__name__</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">parameters</span><span class="p">)</span> <span class="o">+</span> <span class="s2">")"</span></div>
|
||||
|
||||
|
||||
<span class="k">def</span> <span class="nf">__binary_search</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="n">fuzzy_sets</span><span class="p">,</span> <span class="n">ordered_sets</span><span class="p">):</span>
|
||||
<span class="sd">"""</span>
|
||||
<span class="w"> </span><span class="sd">"""</span>
|
||||
<span class="sd"> Search for elegible fuzzy sets to fuzzyfy x</span>
|
||||
|
||||
<span class="sd"> :param x: input value to be fuzzyfied</span>
|
||||
@ -160,7 +160,7 @@
|
||||
|
||||
|
||||
<div class="viewcode-block" id="fuzzyfy"><a class="viewcode-back" href="../../../pyFTS.common.html#pyFTS.common.FuzzySet.fuzzyfy">[docs]</a><span class="k">def</span> <span class="nf">fuzzyfy</span><span class="p">(</span><span class="n">data</span><span class="p">,</span> <span class="n">partitioner</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
|
||||
<span class="sd">"""</span>
|
||||
<span class="w"> </span><span class="sd">"""</span>
|
||||
<span class="sd"> A general method for fuzzyfication.</span>
|
||||
|
||||
<span class="sd"> :param data: input value to be fuzzyfied</span>
|
||||
@ -170,6 +170,7 @@
|
||||
<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"> 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"> """</span>
|
||||
@ -204,7 +205,7 @@
|
||||
|
||||
|
||||
<div class="viewcode-block" id="set_ordered"><a class="viewcode-back" href="../../../pyFTS.common.html#pyFTS.common.FuzzySet.set_ordered">[docs]</a><span class="k">def</span> <span class="nf">set_ordered</span><span class="p">(</span><span class="n">fuzzy_sets</span><span class="p">):</span>
|
||||
<span class="sd">"""</span>
|
||||
<span class="w"> </span><span class="sd">"""</span>
|
||||
<span class="sd"> Order a fuzzy set list by their centroids</span>
|
||||
|
||||
<span class="sd"> :param fuzzy_sets: a dictionary where the key is the fuzzy set name and the value is the fuzzy set object.</span>
|
||||
@ -216,7 +217,7 @@
|
||||
|
||||
|
||||
<div class="viewcode-block" id="fuzzyfy_instance"><a class="viewcode-back" href="../../../pyFTS.common.html#pyFTS.common.FuzzySet.fuzzyfy_instance">[docs]</a><span class="k">def</span> <span class="nf">fuzzyfy_instance</span><span class="p">(</span><span class="n">inst</span><span class="p">,</span> <span class="n">fuzzy_sets</span> <span class="p">:</span> <span class="nb">dict</span> <span class="p">,</span> <span class="n">ordered_sets</span> <span class="p">:</span> <span class="nb">list</span> <span class="o">=</span><span class="kc">None</span><span class="p">):</span>
|
||||
<span class="sd">"""</span>
|
||||
<span class="w"> </span><span class="sd">"""</span>
|
||||
<span class="sd"> Calculate the membership values for a data point given fuzzy sets</span>
|
||||
|
||||
<span class="sd"> :param inst: data point</span>
|
||||
@ -237,7 +238,7 @@
|
||||
|
||||
|
||||
<div class="viewcode-block" id="fuzzyfy_instances"><a class="viewcode-back" href="../../../pyFTS.common.html#pyFTS.common.FuzzySet.fuzzyfy_instances">[docs]</a><span class="k">def</span> <span class="nf">fuzzyfy_instances</span><span class="p">(</span><span class="n">data</span> <span class="p">:</span> <span class="nb">list</span><span class="p">,</span> <span class="n">fuzzy_sets</span> <span class="p">:</span> <span class="nb">dict</span><span class="p">,</span> <span class="n">ordered_sets</span><span class="o">=</span><span class="kc">None</span><span class="p">)</span> <span class="o">-></span> <span class="nb">list</span><span class="p">:</span>
|
||||
<span class="sd">"""</span>
|
||||
<span class="w"> </span><span class="sd">"""</span>
|
||||
<span class="sd"> Calculate the membership values for a data point given fuzzy sets</span>
|
||||
|
||||
<span class="sd"> :param inst: data point</span>
|
||||
@ -255,7 +256,7 @@
|
||||
|
||||
|
||||
<div class="viewcode-block" id="get_fuzzysets"><a class="viewcode-back" href="../../../pyFTS.common.html#pyFTS.common.FuzzySet.get_fuzzysets">[docs]</a><span class="k">def</span> <span class="nf">get_fuzzysets</span><span class="p">(</span><span class="n">inst</span><span class="p">,</span> <span class="n">fuzzy_sets</span> <span class="p">:</span> <span class="nb">dict</span><span class="p">,</span> <span class="n">ordered_sets</span> <span class="p">:</span> <span class="nb">list</span> <span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">alpha_cut</span> <span class="p">:</span> <span class="nb">float</span> <span class="o">=</span><span class="mf">0.0</span><span class="p">)</span> <span class="o">-></span> <span class="nb">list</span><span class="p">:</span>
|
||||
<span class="sd">"""</span>
|
||||
<span class="w"> </span><span class="sd">"""</span>
|
||||
<span class="sd"> Return the fuzzy sets which membership value for a inst is greater than the alpha_cut</span>
|
||||
|
||||
<span class="sd"> :param inst: data point</span>
|
||||
@ -278,7 +279,7 @@
|
||||
|
||||
|
||||
<div class="viewcode-block" id="get_maximum_membership_fuzzyset"><a class="viewcode-back" href="../../../pyFTS.common.html#pyFTS.common.FuzzySet.get_maximum_membership_fuzzyset">[docs]</a><span class="k">def</span> <span class="nf">get_maximum_membership_fuzzyset</span><span class="p">(</span><span class="n">inst</span><span class="p">,</span> <span class="n">fuzzy_sets</span><span class="p">,</span> <span class="n">ordered_sets</span><span class="o">=</span><span class="kc">None</span><span class="p">)</span> <span class="o">-></span> <span class="n">FuzzySet</span><span class="p">:</span>
|
||||
<span class="sd">"""</span>
|
||||
<span class="w"> </span><span class="sd">"""</span>
|
||||
<span class="sd"> Fuzzify a data point, returning the fuzzy set with maximum membership value</span>
|
||||
|
||||
<span class="sd"> :param inst: data point</span>
|
||||
@ -294,7 +295,7 @@
|
||||
|
||||
|
||||
<div class="viewcode-block" id="get_maximum_membership_fuzzyset_index"><a class="viewcode-back" href="../../../pyFTS.common.html#pyFTS.common.FuzzySet.get_maximum_membership_fuzzyset_index">[docs]</a><span class="k">def</span> <span class="nf">get_maximum_membership_fuzzyset_index</span><span class="p">(</span><span class="n">inst</span><span class="p">,</span> <span class="n">fuzzy_sets</span><span class="p">)</span> <span class="o">-></span> <span class="nb">int</span><span class="p">:</span>
|
||||
<span class="sd">"""</span>
|
||||
<span class="w"> </span><span class="sd">"""</span>
|
||||
<span class="sd"> Fuzzify a data point, returning the fuzzy set with maximum membership value</span>
|
||||
|
||||
<span class="sd"> :param inst: data point</span>
|
||||
@ -391,7 +392,7 @@
|
||||
</div>
|
||||
<div class="footer" role="contentinfo">
|
||||
© Copyright 2022, Machine Intelligence and Data Science Laboratory - UFMG - Brazil.
|
||||
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 4.5.0.
|
||||
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 4.3.2.
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
@ -49,11 +49,11 @@
|
||||
|
||||
<span class="kn">import</span> <span class="nn">numpy</span> <span class="k">as</span> <span class="nn">np</span>
|
||||
<span class="kn">import</span> <span class="nn">math</span>
|
||||
<span class="kn">from</span> <span class="nn">pyFTS</span> <span class="k">import</span> <span class="o">*</span>
|
||||
<span class="kn">from</span> <span class="nn">pyFTS</span> <span class="kn">import</span> <span class="o">*</span>
|
||||
|
||||
|
||||
<div class="viewcode-block" id="trimf"><a class="viewcode-back" href="../../../pyFTS.common.html#pyFTS.common.Membership.trimf">[docs]</a><span class="k">def</span> <span class="nf">trimf</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="n">parameters</span><span class="p">):</span>
|
||||
<span class="sd">"""</span>
|
||||
<span class="w"> </span><span class="sd">"""</span>
|
||||
<span class="sd"> Triangular fuzzy membership function</span>
|
||||
|
||||
<span class="sd"> :param x: data point</span>
|
||||
@ -73,7 +73,7 @@
|
||||
|
||||
|
||||
<div class="viewcode-block" id="trapmf"><a class="viewcode-back" href="../../../pyFTS.common.html#pyFTS.common.Membership.trapmf">[docs]</a><span class="k">def</span> <span class="nf">trapmf</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="n">parameters</span><span class="p">):</span>
|
||||
<span class="sd">"""</span>
|
||||
<span class="w"> </span><span class="sd">"""</span>
|
||||
<span class="sd"> Trapezoidal fuzzy membership function</span>
|
||||
|
||||
<span class="sd"> :param x: data point</span>
|
||||
@ -94,7 +94,7 @@
|
||||
|
||||
|
||||
<div class="viewcode-block" id="gaussmf"><a class="viewcode-back" href="../../../pyFTS.common.html#pyFTS.common.Membership.gaussmf">[docs]</a><span class="k">def</span> <span class="nf">gaussmf</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="n">parameters</span><span class="p">):</span>
|
||||
<span class="sd">"""</span>
|
||||
<span class="w"> </span><span class="sd">"""</span>
|
||||
<span class="sd"> Gaussian fuzzy membership function</span>
|
||||
|
||||
<span class="sd"> :param x: data point</span>
|
||||
@ -106,7 +106,7 @@
|
||||
|
||||
|
||||
<div class="viewcode-block" id="bellmf"><a class="viewcode-back" href="../../../pyFTS.common.html#pyFTS.common.Membership.bellmf">[docs]</a><span class="k">def</span> <span class="nf">bellmf</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="n">parameters</span><span class="p">):</span>
|
||||
<span class="sd">"""</span>
|
||||
<span class="w"> </span><span class="sd">"""</span>
|
||||
<span class="sd"> Bell shaped membership function</span>
|
||||
|
||||
<span class="sd"> :param x:</span>
|
||||
@ -118,7 +118,7 @@
|
||||
|
||||
|
||||
<div class="viewcode-block" id="sigmf"><a class="viewcode-back" href="../../../pyFTS.common.html#pyFTS.common.Membership.sigmf">[docs]</a><span class="k">def</span> <span class="nf">sigmf</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="n">parameters</span><span class="p">):</span>
|
||||
<span class="sd">"""</span>
|
||||
<span class="w"> </span><span class="sd">"""</span>
|
||||
<span class="sd"> Sigmoid / Logistic membership function</span>
|
||||
|
||||
<span class="sd"> :param x:</span>
|
||||
@ -129,7 +129,7 @@
|
||||
|
||||
|
||||
<div class="viewcode-block" id="singleton"><a class="viewcode-back" href="../../../pyFTS.common.html#pyFTS.common.Membership.singleton">[docs]</a><span class="k">def</span> <span class="nf">singleton</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="n">parameters</span><span class="p">):</span>
|
||||
<span class="sd">"""</span>
|
||||
<span class="w"> </span><span class="sd">"""</span>
|
||||
<span class="sd"> Singleton membership function, a single value fuzzy function</span>
|
||||
|
||||
<span class="sd"> :param x:</span>
|
||||
@ -175,7 +175,7 @@
|
||||
</div>
|
||||
<div class="footer" role="contentinfo">
|
||||
© Copyright 2022, Machine Intelligence and Data Science Laboratory - UFMG - Brazil.
|
||||
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 4.5.0.
|
||||
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 4.3.2.
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
@ -43,7 +43,7 @@
|
||||
<div class="body" role="main">
|
||||
|
||||
<h1>Source code for pyFTS.common.SortedCollection</h1><div class="highlight"><pre>
|
||||
<span></span><span class="kn">from</span> <span class="nn">bisect</span> <span class="k">import</span> <span class="n">bisect_left</span><span class="p">,</span> <span class="n">bisect_right</span>
|
||||
<span></span><span class="kn">from</span> <span class="nn">bisect</span> <span class="kn">import</span> <span class="n">bisect_left</span><span class="p">,</span> <span class="n">bisect_right</span>
|
||||
|
||||
<span class="c1">#</span>
|
||||
<span class="c1"># Original Source Code: https://code.activestate.com/recipes/577197-sortedcollection/</span>
|
||||
@ -51,7 +51,7 @@
|
||||
|
||||
|
||||
<div class="viewcode-block" id="SortedCollection"><a class="viewcode-back" href="../../../pyFTS.common.html#pyFTS.common.SortedCollection.SortedCollection">[docs]</a><span class="k">class</span> <span class="nc">SortedCollection</span><span class="p">(</span><span class="nb">object</span><span class="p">):</span>
|
||||
<span class="sd">'''Sequence sorted by a key function.</span>
|
||||
<span class="w"> </span><span class="sd">'''Sequence sorted by a key function.</span>
|
||||
|
||||
<span class="sd"> SortedCollection() is much easier to work with than using bisect() directly.</span>
|
||||
<span class="sd"> It supports key functions like those use in sorted(), min(), and max().</span>
|
||||
@ -119,7 +119,7 @@
|
||||
|
||||
<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">iterable</span><span class="o">=</span><span class="p">(),</span> <span class="n">key</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span>
|
||||
<span class="k">def</span> <span class="fm">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">iterable</span><span class="o">=</span><span class="p">(),</span> <span class="n">key</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">_given_key</span> <span class="o">=</span> <span class="n">key</span>
|
||||
<span class="n">key</span> <span class="o">=</span> <span class="p">(</span><span class="k">lambda</span> <span class="n">x</span><span class="p">:</span> <span class="n">x</span><span class="p">)</span> <span class="k">if</span> <span class="n">key</span> <span class="ow">is</span> <span class="kc">None</span> <span class="k">else</span> <span class="n">key</span>
|
||||
<span class="n">decorated</span> <span class="o">=</span> <span class="nb">sorted</span><span class="p">((</span><span class="n">key</span><span class="p">(</span><span class="n">item</span><span class="p">),</span> <span class="n">item</span><span class="p">)</span> <span class="k">for</span> <span class="n">item</span> <span class="ow">in</span> <span class="n">iterable</span><span class="p">)</span>
|
||||
@ -145,19 +145,19 @@
|
||||
<div class="viewcode-block" id="SortedCollection.copy"><a class="viewcode-back" href="../../../pyFTS.common.html#pyFTS.common.SortedCollection.SortedCollection.copy">[docs]</a> <span class="k">def</span> <span class="nf">copy</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
|
||||
<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="vm">__class__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">_key</span><span class="p">)</span></div>
|
||||
|
||||
<span class="k">def</span> <span class="nf">__len__</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
|
||||
<span class="k">def</span> <span class="fm">__len__</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
|
||||
<span class="k">return</span> <span class="nb">len</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">_items</span><span class="p">)</span>
|
||||
|
||||
<span class="k">def</span> <span class="nf">__getitem__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">i</span><span class="p">):</span>
|
||||
<span class="k">def</span> <span class="fm">__getitem__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">i</span><span class="p">):</span>
|
||||
<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_items</span><span class="p">[</span><span class="n">i</span><span class="p">]</span>
|
||||
|
||||
<span class="k">def</span> <span class="nf">__iter__</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
|
||||
<span class="k">def</span> <span class="fm">__iter__</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
|
||||
<span class="k">return</span> <span class="nb">iter</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">_items</span><span class="p">)</span>
|
||||
|
||||
<span class="k">def</span> <span class="nf">__reversed__</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
|
||||
<span class="k">def</span> <span class="fm">__reversed__</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
|
||||
<span class="k">return</span> <span class="nb">reversed</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">_items</span><span class="p">)</span>
|
||||
|
||||
<span class="k">def</span> <span class="nf">__repr__</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
|
||||
<span class="k">def</span> <span class="fm">__repr__</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
|
||||
<span class="k">return</span> <span class="s1">'</span><span class="si">%s</span><span class="s1">(</span><span class="si">%r</span><span class="s1">, key=</span><span class="si">%s</span><span class="s1">)'</span> <span class="o">%</span> <span class="p">(</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="vm">__class__</span><span class="o">.</span><span class="vm">__name__</span><span class="p">,</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">_items</span><span class="p">,</span>
|
||||
@ -167,7 +167,7 @@
|
||||
<span class="k">def</span> <span class="nf">__reduce__</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
|
||||
<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="vm">__class__</span><span class="p">,</span> <span class="p">(</span><span class="bp">self</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">_given_key</span><span class="p">)</span>
|
||||
|
||||
<span class="k">def</span> <span class="nf">__contains__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">item</span><span class="p">):</span>
|
||||
<span class="k">def</span> <span class="fm">__contains__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">item</span><span class="p">):</span>
|
||||
<span class="n">k</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">_key</span><span class="p">(</span><span class="n">item</span><span class="p">)</span>
|
||||
<span class="n">i</span> <span class="o">=</span> <span class="n">bisect_left</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">_keys</span><span class="p">,</span> <span class="n">k</span><span class="p">)</span>
|
||||
<span class="n">j</span> <span class="o">=</span> <span class="n">bisect_right</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">_keys</span><span class="p">,</span> <span class="n">k</span><span class="p">)</span>
|
||||
@ -308,7 +308,7 @@
|
||||
</div>
|
||||
<div class="footer" role="contentinfo">
|
||||
© Copyright 2022, Machine Intelligence and Data Science Laboratory - UFMG - Brazil.
|
||||
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 4.5.0.
|
||||
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 4.3.2.
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
24
docs/build/html/_modules/pyFTS/common/flrg.html
vendored
24
docs/build/html/_modules/pyFTS/common/flrg.html
vendored
@ -47,20 +47,20 @@
|
||||
|
||||
|
||||
<div class="viewcode-block" id="FLRG"><a class="viewcode-back" href="../../../pyFTS.common.html#pyFTS.common.flrg.FLRG">[docs]</a><span class="k">class</span> <span class="nc">FLRG</span><span class="p">(</span><span class="nb">object</span><span class="p">):</span>
|
||||
<span class="sd">"""</span>
|
||||
<span class="w"> </span><span class="sd">"""</span>
|
||||
<span class="sd"> Fuzzy Logical Relationship Group</span>
|
||||
|
||||
<span class="sd"> Group a set of FLR's with the same LHS. Represents the temporal patterns for time t+1 (the RHS fuzzy sets)</span>
|
||||
<span class="sd"> when the LHS pattern is identified on time t.</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">order</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="fm">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">order</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">LHS</span> <span class="o">=</span> <span class="kc">None</span>
|
||||
<span class="sd">"""Left Hand Side of the rule"""</span>
|
||||
<span class="w"> </span><span class="sd">"""Left Hand Side of the rule"""</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">RHS</span> <span class="o">=</span> <span class="kc">None</span>
|
||||
<span class="sd">"""Right Hand Side of the rule"""</span>
|
||||
<span class="w"> </span><span class="sd">"""Right Hand Side of the rule"""</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">order</span> <span class="o">=</span> <span class="n">order</span>
|
||||
<span class="sd">"""Number of lags on LHS"""</span>
|
||||
<span class="w"> </span><span class="sd">"""Number of lags on LHS"""</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">midpoint</span> <span class="o">=</span> <span class="kc">None</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>
|
||||
@ -70,7 +70,7 @@
|
||||
<span class="k">pass</span></div>
|
||||
|
||||
<div class="viewcode-block" id="FLRG.get_key"><a class="viewcode-back" href="../../../pyFTS.common.html#pyFTS.common.flrg.FLRG.get_key">[docs]</a> <span class="k">def</span> <span class="nf">get_key</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
|
||||
<span class="sd">"""Returns a unique identifier for this FLRG"""</span>
|
||||
<span class="w"> </span><span class="sd">"""Returns a unique identifier for this FLRG"""</span>
|
||||
<span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">key</span> <span class="ow">is</span> <span class="kc">None</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">LHS</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="n">names</span> <span class="o">=</span> <span class="p">[</span><span class="n">c</span> <span class="k">for</span> <span class="n">c</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">LHS</span><span class="p">]</span>
|
||||
@ -88,7 +88,7 @@
|
||||
<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">key</span></div>
|
||||
|
||||
<div class="viewcode-block" id="FLRG.get_membership"><a class="viewcode-back" href="../../../pyFTS.common.html#pyFTS.common.flrg.FLRG.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="sd">"""</span>
|
||||
<span class="w"> </span><span class="sd">"""</span>
|
||||
<span class="sd"> Returns the membership value of the FLRG for the input data</span>
|
||||
|
||||
<span class="sd"> :param data: input data</span>
|
||||
@ -104,7 +104,7 @@
|
||||
<span class="k">return</span> <span class="n">ret</span></div>
|
||||
|
||||
<div class="viewcode-block" id="FLRG.get_midpoint"><a class="viewcode-back" href="../../../pyFTS.common.html#pyFTS.common.flrg.FLRG.get_midpoint">[docs]</a> <span class="k">def</span> <span class="nf">get_midpoint</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">sets</span><span class="p">):</span>
|
||||
<span class="sd">"""</span>
|
||||
<span class="w"> </span><span class="sd">"""</span>
|
||||
<span class="sd"> Returns the midpoint value for the RHS fuzzy sets</span>
|
||||
|
||||
<span class="sd"> :param sets: fuzzy sets</span>
|
||||
@ -121,7 +121,7 @@
|
||||
<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>
|
||||
<span class="sd">"""</span>
|
||||
<span class="w"> </span><span class="sd">"""</span>
|
||||
<span class="sd"> Returns the lower bound value for the RHS fuzzy sets</span>
|
||||
|
||||
<span class="sd"> :param sets: fuzzy sets</span>
|
||||
@ -135,7 +135,7 @@
|
||||
<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">lower</span></div>
|
||||
|
||||
<div class="viewcode-block" id="FLRG.get_upper"><a class="viewcode-back" href="../../../pyFTS.common.html#pyFTS.common.flrg.FLRG.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="sd">"""</span>
|
||||
<span class="w"> </span><span class="sd">"""</span>
|
||||
<span class="sd"> Returns the upper bound value for the RHS fuzzy sets</span>
|
||||
|
||||
<span class="sd"> :param sets: fuzzy sets</span>
|
||||
@ -148,7 +148,7 @@
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">upper</span> <span class="o">=</span> <span class="nb">max</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">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">def</span> <span class="nf">__len__</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
|
||||
<span class="k">def</span> <span class="fm">__len__</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
|
||||
<span class="k">return</span> <span class="nb">len</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">RHS</span><span class="p">)</span>
|
||||
|
||||
<div class="viewcode-block" id="FLRG.reset_calculated_values"><a class="viewcode-back" href="../../../pyFTS.common.html#pyFTS.common.flrg.FLRG.reset_calculated_values">[docs]</a> <span class="k">def</span> <span class="nf">reset_calculated_values</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
|
||||
@ -195,7 +195,7 @@
|
||||
</div>
|
||||
<div class="footer" role="contentinfo">
|
||||
© Copyright 2022, Machine Intelligence and Data Science Laboratory - UFMG - Brazil.
|
||||
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 4.5.0.
|
||||
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 4.3.2.
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
119
docs/build/html/_modules/pyFTS/common/transformations/boxcox.html
vendored
Normal file
119
docs/build/html/_modules/pyFTS/common/transformations/boxcox.html
vendored
Normal file
@ -0,0 +1,119 @@
|
||||
|
||||
|
||||
<!doctype html>
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>pyFTS.common.transformations.boxcox — pyFTS 1.7 documentation</title>
|
||||
<link rel="stylesheet" type="text/css" href="../../../../_static/pygments.css" />
|
||||
<link rel="stylesheet" type="text/css" href="../../../../_static/bizstyle.css" />
|
||||
|
||||
<script data-url_root="../../../../" id="documentation_options" src="../../../../_static/documentation_options.js"></script>
|
||||
<script src="../../../../_static/jquery.js"></script>
|
||||
<script src="../../../../_static/underscore.js"></script>
|
||||
<script src="../../../../_static/doctools.js"></script>
|
||||
<script src="../../../../_static/bizstyle.js"></script>
|
||||
<link rel="index" title="Index" href="../../../../genindex.html" />
|
||||
<link rel="search" title="Search" href="../../../../search.html" />
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1.0" />
|
||||
<!--[if lt IE 9]>
|
||||
<script src="_static/css3-mediaqueries.js"></script>
|
||||
<![endif]-->
|
||||
</head><body>
|
||||
<div class="related" role="navigation" aria-label="related navigation">
|
||||
<h3>Navigation</h3>
|
||||
<ul>
|
||||
<li class="right" style="margin-right: 10px">
|
||||
<a href="../../../../genindex.html" title="General Index"
|
||||
accesskey="I">index</a></li>
|
||||
<li class="right" >
|
||||
<a href="../../../../py-modindex.html" title="Python Module Index"
|
||||
>modules</a> |</li>
|
||||
<li class="nav-item nav-item-0"><a href="../../../../index.html">pyFTS 1.7 documentation</a> »</li>
|
||||
<li class="nav-item nav-item-1"><a href="../../../index.html" accesskey="U">Module code</a> »</li>
|
||||
<li class="nav-item nav-item-this"><a href="">pyFTS.common.transformations.boxcox</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="document">
|
||||
<div class="documentwrapper">
|
||||
<div class="bodywrapper">
|
||||
<div class="body" role="main">
|
||||
|
||||
<h1>Source code for pyFTS.common.transformations.boxcox</h1><div class="highlight"><pre>
|
||||
<span></span><span class="kn">from</span> <span class="nn">pyFTS.common.transformations.transformation</span> <span class="kn">import</span> <span class="n">Transformation</span>
|
||||
|
||||
|
||||
<div class="viewcode-block" id="BoxCox"><a class="viewcode-back" href="../../../../pyFTS.common.transformations.html#pyFTS.common.transformations.boxcox.BoxCox">[docs]</a><span class="k">class</span> <span class="nc">BoxCox</span><span class="p">(</span><span class="n">Transformation</span><span class="p">):</span>
|
||||
<span class="w"> </span><span class="sd">"""</span>
|
||||
<span class="sd"> Box-Cox power transformation</span>
|
||||
|
||||
<span class="sd"> y'(t) = log( y(t) )</span>
|
||||
<span class="sd"> y(t) = exp( y'(t) )</span>
|
||||
<span class="sd"> """</span>
|
||||
<span class="k">def</span> <span class="fm">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">plambda</span><span class="p">):</span>
|
||||
<span class="nb">super</span><span class="p">(</span><span class="n">BoxCox</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="bp">self</span><span class="o">.</span><span class="n">plambda</span> <span class="o">=</span> <span class="n">plambda</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">name</span> <span class="o">=</span> <span class="s1">'BoxCox'</span>
|
||||
|
||||
<span class="nd">@property</span>
|
||||
<span class="k">def</span> <span class="nf">parameters</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
|
||||
<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">plambda</span>
|
||||
|
||||
<div class="viewcode-block" id="BoxCox.apply"><a class="viewcode-back" href="../../../../pyFTS.common.transformations.html#pyFTS.common.transformations.boxcox.BoxCox.apply">[docs]</a> <span class="k">def</span> <span class="nf">apply</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">param</span><span class="o">=</span><span class="kc">None</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">plambda</span> <span class="o">!=</span> <span class="mi">0</span><span class="p">:</span>
|
||||
<span class="n">modified</span> <span class="o">=</span> <span class="p">[(</span><span class="n">dat</span> <span class="o">**</span> <span class="bp">self</span><span class="o">.</span><span class="n">plambda</span> <span class="o">-</span> <span class="mi">1</span><span class="p">)</span> <span class="o">/</span> <span class="bp">self</span><span class="o">.</span><span class="n">plambda</span> <span class="k">for</span> <span class="n">dat</span> <span class="ow">in</span> <span class="n">data</span><span class="p">]</span>
|
||||
<span class="k">else</span><span class="p">:</span>
|
||||
<span class="n">modified</span> <span class="o">=</span> <span class="p">[</span><span class="n">np</span><span class="o">.</span><span class="n">log</span><span class="p">(</span><span class="n">dat</span><span class="p">)</span> <span class="k">for</span> <span class="n">dat</span> <span class="ow">in</span> <span class="n">data</span><span class="p">]</span>
|
||||
<span class="k">return</span> <span class="n">np</span><span class="o">.</span><span class="n">array</span><span class="p">(</span><span class="n">modified</span><span class="p">)</span></div>
|
||||
|
||||
<div class="viewcode-block" id="BoxCox.inverse"><a class="viewcode-back" href="../../../../pyFTS.common.transformations.html#pyFTS.common.transformations.boxcox.BoxCox.inverse">[docs]</a> <span class="k">def</span> <span class="nf">inverse</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">param</span><span class="o">=</span><span class="kc">None</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">plambda</span> <span class="o">!=</span> <span class="mi">0</span><span class="p">:</span>
|
||||
<span class="n">modified</span> <span class="o">=</span> <span class="p">[</span><span class="n">np</span><span class="o">.</span><span class="n">exp</span><span class="p">(</span><span class="n">np</span><span class="o">.</span><span class="n">log</span><span class="p">(</span><span class="n">dat</span> <span class="o">*</span> <span class="bp">self</span><span class="o">.</span><span class="n">plambda</span> <span class="o">+</span> <span class="mi">1</span><span class="p">)</span> <span class="p">)</span> <span class="o">/</span> <span class="bp">self</span><span class="o">.</span><span class="n">plambda</span> <span class="k">for</span> <span class="n">dat</span> <span class="ow">in</span> <span class="n">data</span><span class="p">]</span>
|
||||
<span class="k">else</span><span class="p">:</span>
|
||||
<span class="n">modified</span> <span class="o">=</span> <span class="p">[</span><span class="n">np</span><span class="o">.</span><span class="n">exp</span><span class="p">(</span><span class="n">dat</span><span class="p">)</span> <span class="k">for</span> <span class="n">dat</span> <span class="ow">in</span> <span class="n">data</span><span class="p">]</span>
|
||||
<span class="k">return</span> <span class="n">np</span><span class="o">.</span><span class="n">array</span><span class="p">(</span><span class="n">modified</span><span class="p">)</span></div></div>
|
||||
</pre></div>
|
||||
|
||||
<div class="clearer"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
|
||||
<div class="sphinxsidebarwrapper">
|
||||
<div id="searchbox" style="display: none" role="search">
|
||||
<h3 id="searchlabel">Quick search</h3>
|
||||
<div class="searchformwrapper">
|
||||
<form class="search" action="../../../../search.html" method="get">
|
||||
<input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
|
||||
<input type="submit" value="Go" />
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<script>$('#searchbox').show(0);</script>
|
||||
</div>
|
||||
</div>
|
||||
<div class="clearer"></div>
|
||||
</div>
|
||||
<div class="related" role="navigation" aria-label="related navigation">
|
||||
<h3>Navigation</h3>
|
||||
<ul>
|
||||
<li class="right" style="margin-right: 10px">
|
||||
<a href="../../../../genindex.html" title="General Index"
|
||||
>index</a></li>
|
||||
<li class="right" >
|
||||
<a href="../../../../py-modindex.html" title="Python Module Index"
|
||||
>modules</a> |</li>
|
||||
<li class="nav-item nav-item-0"><a href="../../../../index.html">pyFTS 1.7 documentation</a> »</li>
|
||||
<li class="nav-item nav-item-1"><a href="../../../index.html" >Module code</a> »</li>
|
||||
<li class="nav-item nav-item-this"><a href="">pyFTS.common.transformations.boxcox</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="footer" role="contentinfo">
|
||||
© Copyright 2022, Machine Intelligence and Data Science Laboratory - UFMG - Brazil.
|
||||
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 4.3.2.
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
168
docs/build/html/_modules/pyFTS/common/transformations/differential.html
vendored
Normal file
168
docs/build/html/_modules/pyFTS/common/transformations/differential.html
vendored
Normal file
@ -0,0 +1,168 @@
|
||||
|
||||
|
||||
<!doctype html>
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>pyFTS.common.transformations.differential — pyFTS 1.7 documentation</title>
|
||||
<link rel="stylesheet" type="text/css" href="../../../../_static/pygments.css" />
|
||||
<link rel="stylesheet" type="text/css" href="../../../../_static/bizstyle.css" />
|
||||
|
||||
<script data-url_root="../../../../" id="documentation_options" src="../../../../_static/documentation_options.js"></script>
|
||||
<script src="../../../../_static/jquery.js"></script>
|
||||
<script src="../../../../_static/underscore.js"></script>
|
||||
<script src="../../../../_static/doctools.js"></script>
|
||||
<script src="../../../../_static/bizstyle.js"></script>
|
||||
<link rel="index" title="Index" href="../../../../genindex.html" />
|
||||
<link rel="search" title="Search" href="../../../../search.html" />
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1.0" />
|
||||
<!--[if lt IE 9]>
|
||||
<script src="_static/css3-mediaqueries.js"></script>
|
||||
<![endif]-->
|
||||
</head><body>
|
||||
<div class="related" role="navigation" aria-label="related navigation">
|
||||
<h3>Navigation</h3>
|
||||
<ul>
|
||||
<li class="right" style="margin-right: 10px">
|
||||
<a href="../../../../genindex.html" title="General Index"
|
||||
accesskey="I">index</a></li>
|
||||
<li class="right" >
|
||||
<a href="../../../../py-modindex.html" title="Python Module Index"
|
||||
>modules</a> |</li>
|
||||
<li class="nav-item nav-item-0"><a href="../../../../index.html">pyFTS 1.7 documentation</a> »</li>
|
||||
<li class="nav-item nav-item-1"><a href="../../../index.html" accesskey="U">Module code</a> »</li>
|
||||
<li class="nav-item nav-item-this"><a href="">pyFTS.common.transformations.differential</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="document">
|
||||
<div class="documentwrapper">
|
||||
<div class="bodywrapper">
|
||||
<div class="body" role="main">
|
||||
|
||||
<h1>Source code for pyFTS.common.transformations.differential</h1><div class="highlight"><pre>
|
||||
<span></span><span class="kn">import</span> <span class="nn">numpy</span> <span class="k">as</span> <span class="nn">np</span>
|
||||
<span class="kn">from</span> <span class="nn">pyFTS.common.transformations.transformation</span> <span class="kn">import</span> <span class="n">Transformation</span>
|
||||
|
||||
|
||||
<div class="viewcode-block" id="Differential"><a class="viewcode-back" href="../../../../pyFTS.common.transformations.html#pyFTS.common.transformations.differential.Differential">[docs]</a><span class="k">class</span> <span class="nc">Differential</span><span class="p">(</span><span class="n">Transformation</span><span class="p">):</span>
|
||||
<span class="w"> </span><span class="sd">"""</span>
|
||||
<span class="sd"> Differentiation data transform</span>
|
||||
|
||||
<span class="sd"> y'(t) = y(t) - y(t-1)</span>
|
||||
<span class="sd"> y(t) = y(t-1) + y'(t)</span>
|
||||
<span class="sd"> """</span>
|
||||
<span class="k">def</span> <span class="fm">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">lag</span><span class="p">):</span>
|
||||
<span class="nb">super</span><span class="p">(</span><span class="n">Differential</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="bp">self</span><span class="o">.</span><span class="n">lag</span> <span class="o">=</span> <span class="n">lag</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">minimal_length</span> <span class="o">=</span> <span class="mi">2</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">name</span> <span class="o">=</span> <span class="s1">'Diff'</span>
|
||||
|
||||
<span class="nd">@property</span>
|
||||
<span class="k">def</span> <span class="nf">parameters</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
|
||||
<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">lag</span>
|
||||
|
||||
<div class="viewcode-block" id="Differential.apply"><a class="viewcode-back" href="../../../../pyFTS.common.transformations.html#pyFTS.common.transformations.differential.Differential.apply">[docs]</a> <span class="k">def</span> <span class="nf">apply</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">param</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
|
||||
<span class="k">if</span> <span class="n">param</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">lag</span> <span class="o">=</span> <span class="n">param</span>
|
||||
|
||||
<span class="k">if</span> <span class="ow">not</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="nb">list</span><span class="p">,</span> <span class="n">np</span><span class="o">.</span><span class="n">ndarray</span><span class="p">,</span> <span class="n">np</span><span class="o">.</span><span class="n">generic</span><span class="p">)):</span>
|
||||
<span class="n">data</span> <span class="o">=</span> <span class="p">[</span><span class="n">data</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="n">np</span><span class="o">.</span><span class="n">generic</span><span class="p">)):</span>
|
||||
<span class="n">data</span> <span class="o">=</span> <span class="n">data</span><span class="o">.</span><span class="n">tolist</span><span class="p">()</span>
|
||||
|
||||
<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">diff</span> <span class="o">=</span> <span class="p">[</span><span class="n">data</span><span class="p">[</span><span class="n">t</span><span class="p">]</span> <span class="o">-</span> <span class="n">data</span><span class="p">[</span><span class="n">t</span> <span class="o">-</span> <span class="bp">self</span><span class="o">.</span><span class="n">lag</span><span class="p">]</span> <span class="k">for</span> <span class="n">t</span> <span class="ow">in</span> <span class="n">np</span><span class="o">.</span><span class="n">arange</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">lag</span><span class="p">,</span> <span class="n">n</span><span class="p">)]</span>
|
||||
<span class="k">for</span> <span class="n">t</span> <span class="ow">in</span> <span class="n">np</span><span class="o">.</span><span class="n">arange</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">lag</span><span class="p">):</span> <span class="n">diff</span><span class="o">.</span><span class="n">insert</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">)</span>
|
||||
<span class="k">return</span> <span class="n">diff</span></div>
|
||||
|
||||
<div class="viewcode-block" id="Differential.inverse"><a class="viewcode-back" href="../../../../pyFTS.common.transformations.html#pyFTS.common.transformations.differential.Differential.inverse">[docs]</a> <span class="k">def</span> <span class="nf">inverse</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">param</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
|
||||
|
||||
<span class="nb">type</span> <span class="o">=</span> <span class="n">kwargs</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"type"</span><span class="p">,</span><span class="s2">"point"</span><span class="p">)</span>
|
||||
<span class="n">steps_ahead</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">"steps_ahead"</span><span class="p">,</span> <span class="mi">1</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="n">np</span><span class="o">.</span><span class="n">generic</span><span class="p">)):</span>
|
||||
<span class="n">data</span> <span class="o">=</span> <span class="n">data</span><span class="o">.</span><span class="n">tolist</span><span class="p">()</span>
|
||||
|
||||
<span class="k">if</span> <span class="ow">not</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">data</span><span class="p">,</span> <span class="nb">list</span><span class="p">):</span>
|
||||
<span class="n">data</span> <span class="o">=</span> <span class="p">[</span><span class="n">data</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="c1"># print(n)</span>
|
||||
<span class="c1"># print(len(param))</span>
|
||||
|
||||
<span class="k">if</span> <span class="n">steps_ahead</span> <span class="o">==</span> <span class="mi">1</span><span class="p">:</span>
|
||||
<span class="k">if</span> <span class="nb">type</span> <span class="o">==</span> <span class="s2">"point"</span><span class="p">:</span>
|
||||
<span class="n">inc</span> <span class="o">=</span> <span class="p">[</span><span class="n">data</span><span class="p">[</span><span class="n">t</span><span class="p">]</span> <span class="o">+</span> <span class="n">param</span><span class="p">[</span><span class="n">t</span><span class="p">]</span> <span class="k">for</span> <span class="n">t</span> <span class="ow">in</span> <span class="n">np</span><span class="o">.</span><span class="n">arange</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="n">n</span><span class="p">)]</span>
|
||||
<span class="k">elif</span> <span class="nb">type</span> <span class="o">==</span> <span class="s2">"interval"</span><span class="p">:</span>
|
||||
<span class="n">inc</span> <span class="o">=</span> <span class="p">[[</span><span class="n">data</span><span class="p">[</span><span class="n">t</span><span class="p">][</span><span class="mi">0</span><span class="p">]</span> <span class="o">+</span> <span class="n">param</span><span class="p">[</span><span class="n">t</span><span class="p">],</span> <span class="n">data</span><span class="p">[</span><span class="n">t</span><span class="p">][</span><span class="mi">1</span><span class="p">]</span> <span class="o">+</span> <span class="n">param</span><span class="p">[</span><span class="n">t</span><span class="p">]]</span> <span class="k">for</span> <span class="n">t</span> <span class="ow">in</span> <span class="n">np</span><span class="o">.</span><span class="n">arange</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="n">n</span><span class="p">)]</span>
|
||||
<span class="k">elif</span> <span class="nb">type</span> <span class="o">==</span> <span class="s2">"distribution"</span><span class="p">:</span>
|
||||
<span class="k">for</span> <span class="n">t</span> <span class="ow">in</span> <span class="n">np</span><span class="o">.</span><span class="n">arange</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="n">n</span><span class="p">):</span>
|
||||
<span class="n">data</span><span class="p">[</span><span class="n">t</span><span class="p">]</span><span class="o">.</span><span class="n">differential_offset</span><span class="p">(</span><span class="n">param</span><span class="p">[</span><span class="n">t</span><span class="p">])</span>
|
||||
<span class="n">inc</span> <span class="o">=</span> <span class="n">data</span>
|
||||
<span class="k">else</span><span class="p">:</span>
|
||||
<span class="k">if</span> <span class="nb">type</span> <span class="o">==</span> <span class="s2">"point"</span><span class="p">:</span>
|
||||
<span class="n">inc</span> <span class="o">=</span> <span class="p">[</span><span class="n">data</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> <span class="o">+</span> <span class="n">param</span><span class="p">[</span><span class="mi">0</span><span class="p">]]</span>
|
||||
<span class="k">for</span> <span class="n">t</span> <span class="ow">in</span> <span class="n">np</span><span class="o">.</span><span class="n">arange</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="n">steps_ahead</span><span class="p">):</span>
|
||||
<span class="n">inc</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">data</span><span class="p">[</span><span class="n">t</span><span class="p">]</span> <span class="o">+</span> <span class="n">inc</span><span class="p">[</span><span class="n">t</span><span class="o">-</span><span class="mi">1</span><span class="p">])</span>
|
||||
<span class="k">elif</span> <span class="nb">type</span> <span class="o">==</span> <span class="s2">"interval"</span><span class="p">:</span>
|
||||
<span class="n">inc</span> <span class="o">=</span> <span class="p">[[</span><span class="n">data</span><span class="p">[</span><span class="mi">0</span><span class="p">][</span><span class="mi">0</span><span class="p">]</span> <span class="o">+</span> <span class="n">param</span><span class="p">[</span><span class="mi">0</span><span class="p">],</span> <span class="n">data</span><span class="p">[</span><span class="mi">0</span><span class="p">][</span><span class="mi">1</span><span class="p">]</span> <span class="o">+</span> <span class="n">param</span><span class="p">[</span><span class="mi">0</span><span class="p">]]]</span>
|
||||
<span class="k">for</span> <span class="n">t</span> <span class="ow">in</span> <span class="n">np</span><span class="o">.</span><span class="n">arange</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="n">steps_ahead</span><span class="p">):</span>
|
||||
<span class="n">inc</span><span class="o">.</span><span class="n">append</span><span class="p">([</span><span class="n">data</span><span class="p">[</span><span class="n">t</span><span class="p">][</span><span class="mi">0</span><span class="p">]</span> <span class="o">+</span> <span class="n">np</span><span class="o">.</span><span class="n">nanmean</span><span class="p">(</span><span class="n">inc</span><span class="p">[</span><span class="n">t</span><span class="o">-</span><span class="mi">1</span><span class="p">]),</span> <span class="n">data</span><span class="p">[</span><span class="n">t</span><span class="p">][</span><span class="mi">1</span><span class="p">]</span> <span class="o">+</span> <span class="n">np</span><span class="o">.</span><span class="n">nanmean</span><span class="p">(</span><span class="n">inc</span><span class="p">[</span><span class="n">t</span><span class="o">-</span><span class="mi">1</span><span class="p">])])</span>
|
||||
<span class="k">elif</span> <span class="nb">type</span> <span class="o">==</span> <span class="s2">"distribution"</span><span class="p">:</span>
|
||||
<span class="n">data</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span><span class="o">.</span><span class="n">differential_offset</span><span class="p">(</span><span class="n">param</span><span class="p">[</span><span class="mi">0</span><span class="p">])</span>
|
||||
<span class="k">for</span> <span class="n">t</span> <span class="ow">in</span> <span class="n">np</span><span class="o">.</span><span class="n">arange</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="n">steps_ahead</span><span class="p">):</span>
|
||||
<span class="n">ex</span> <span class="o">=</span> <span class="n">data</span><span class="p">[</span><span class="n">t</span><span class="o">-</span><span class="mi">1</span><span class="p">]</span><span class="o">.</span><span class="n">expected_value</span><span class="p">()</span>
|
||||
<span class="n">data</span><span class="p">[</span><span class="n">t</span><span class="p">]</span><span class="o">.</span><span class="n">differential_offset</span><span class="p">(</span><span class="n">ex</span><span class="p">)</span>
|
||||
<span class="n">inc</span> <span class="o">=</span> <span class="n">data</span>
|
||||
|
||||
<span class="k">if</span> <span class="n">n</span> <span class="o">==</span> <span class="mi">1</span><span class="p">:</span>
|
||||
<span class="k">return</span> <span class="n">inc</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span>
|
||||
<span class="k">else</span><span class="p">:</span>
|
||||
<span class="k">return</span> <span class="n">inc</span></div></div>
|
||||
</pre></div>
|
||||
|
||||
<div class="clearer"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
|
||||
<div class="sphinxsidebarwrapper">
|
||||
<div id="searchbox" style="display: none" role="search">
|
||||
<h3 id="searchlabel">Quick search</h3>
|
||||
<div class="searchformwrapper">
|
||||
<form class="search" action="../../../../search.html" method="get">
|
||||
<input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
|
||||
<input type="submit" value="Go" />
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<script>$('#searchbox').show(0);</script>
|
||||
</div>
|
||||
</div>
|
||||
<div class="clearer"></div>
|
||||
</div>
|
||||
<div class="related" role="navigation" aria-label="related navigation">
|
||||
<h3>Navigation</h3>
|
||||
<ul>
|
||||
<li class="right" style="margin-right: 10px">
|
||||
<a href="../../../../genindex.html" title="General Index"
|
||||
>index</a></li>
|
||||
<li class="right" >
|
||||
<a href="../../../../py-modindex.html" title="Python Module Index"
|
||||
>modules</a> |</li>
|
||||
<li class="nav-item nav-item-0"><a href="../../../../index.html">pyFTS 1.7 documentation</a> »</li>
|
||||
<li class="nav-item nav-item-1"><a href="../../../index.html" >Module code</a> »</li>
|
||||
<li class="nav-item nav-item-this"><a href="">pyFTS.common.transformations.differential</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="footer" role="contentinfo">
|
||||
© Copyright 2022, Machine Intelligence and Data Science Laboratory - UFMG - Brazil.
|
||||
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 4.3.2.
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
110
docs/build/html/_modules/pyFTS/common/transformations/normalization.html
vendored
Normal file
110
docs/build/html/_modules/pyFTS/common/transformations/normalization.html
vendored
Normal file
@ -0,0 +1,110 @@
|
||||
|
||||
|
||||
<!doctype html>
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>pyFTS.common.transformations.normalization — pyFTS 1.7 documentation</title>
|
||||
<link rel="stylesheet" type="text/css" href="../../../../_static/pygments.css" />
|
||||
<link rel="stylesheet" type="text/css" href="../../../../_static/bizstyle.css" />
|
||||
|
||||
<script data-url_root="../../../../" id="documentation_options" src="../../../../_static/documentation_options.js"></script>
|
||||
<script src="../../../../_static/jquery.js"></script>
|
||||
<script src="../../../../_static/underscore.js"></script>
|
||||
<script src="../../../../_static/doctools.js"></script>
|
||||
<script src="../../../../_static/bizstyle.js"></script>
|
||||
<link rel="index" title="Index" href="../../../../genindex.html" />
|
||||
<link rel="search" title="Search" href="../../../../search.html" />
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1.0" />
|
||||
<!--[if lt IE 9]>
|
||||
<script src="_static/css3-mediaqueries.js"></script>
|
||||
<![endif]-->
|
||||
</head><body>
|
||||
<div class="related" role="navigation" aria-label="related navigation">
|
||||
<h3>Navigation</h3>
|
||||
<ul>
|
||||
<li class="right" style="margin-right: 10px">
|
||||
<a href="../../../../genindex.html" title="General Index"
|
||||
accesskey="I">index</a></li>
|
||||
<li class="right" >
|
||||
<a href="../../../../py-modindex.html" title="Python Module Index"
|
||||
>modules</a> |</li>
|
||||
<li class="nav-item nav-item-0"><a href="../../../../index.html">pyFTS 1.7 documentation</a> »</li>
|
||||
<li class="nav-item nav-item-1"><a href="../../../index.html" accesskey="U">Module code</a> »</li>
|
||||
<li class="nav-item nav-item-this"><a href="">pyFTS.common.transformations.normalization</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="document">
|
||||
<div class="documentwrapper">
|
||||
<div class="bodywrapper">
|
||||
<div class="body" role="main">
|
||||
|
||||
<h1>Source code for pyFTS.common.transformations.normalization</h1><div class="highlight"><pre>
|
||||
<span></span><span class="kn">from</span> <span class="nn">pyFTS.common.transformations.transformation</span> <span class="kn">import</span> <span class="n">Transformation</span>
|
||||
|
||||
|
||||
<div class="viewcode-block" id="Normalization"><a class="viewcode-back" href="../../../../pyFTS.common.transformations.html#pyFTS.common.transformations.normalization.Normalization">[docs]</a><span class="k">class</span> <span class="nc">Normalization</span><span class="p">(</span><span class="n">Transformation</span><span class="p">):</span>
|
||||
<span class="k">def</span> <span class="fm">__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">Normalization</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="bp">self</span><span class="o">.</span><span class="n">name</span> <span class="o">=</span> <span class="s1">'Normalization'</span>
|
||||
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">mu</span> <span class="o">=</span> <span class="mi">0</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">sigma</span> <span class="o">=</span> <span class="mi">0</span>
|
||||
|
||||
|
||||
<div class="viewcode-block" id="Normalization.train"><a class="viewcode-back" href="../../../../pyFTS.common.transformations.html#pyFTS.common.transformations.normalization.Normalization.train">[docs]</a> <span class="k">def</span> <span class="nf">train</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">data</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">mu</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">mean</span><span class="p">(</span><span class="n">data</span><span class="p">)</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">sigma</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">std</span><span class="p">(</span><span class="n">data</span><span class="p">)</span></div>
|
||||
|
||||
<div class="viewcode-block" id="Normalization.apply"><a class="viewcode-back" href="../../../../pyFTS.common.transformations.html#pyFTS.common.transformations.normalization.Normalization.apply">[docs]</a> <span class="k">def</span> <span class="nf">apply</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">param</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
|
||||
<span class="n">modified</span> <span class="o">=</span> <span class="p">(</span><span class="n">data</span> <span class="o">-</span> <span class="bp">self</span><span class="o">.</span><span class="n">mu</span><span class="p">)</span> <span class="o">/</span> <span class="bp">self</span><span class="o">.</span><span class="n">sigma</span>
|
||||
<span class="k">return</span> <span class="n">modified</span></div>
|
||||
|
||||
<div class="viewcode-block" id="Normalization.inverse"><a class="viewcode-back" href="../../../../pyFTS.common.transformations.html#pyFTS.common.transformations.normalization.Normalization.inverse">[docs]</a> <span class="k">def</span> <span class="nf">inverse</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">param</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
|
||||
<span class="n">modified</span> <span class="o">=</span> <span class="p">(</span><span class="n">data</span> <span class="o">*</span> <span class="bp">self</span><span class="o">.</span><span class="n">sigma</span><span class="p">)</span> <span class="o">+</span> <span class="bp">self</span><span class="o">.</span><span class="n">mu</span>
|
||||
<span class="k">return</span> <span class="n">modified</span></div></div>
|
||||
</pre></div>
|
||||
|
||||
<div class="clearer"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
|
||||
<div class="sphinxsidebarwrapper">
|
||||
<div id="searchbox" style="display: none" role="search">
|
||||
<h3 id="searchlabel">Quick search</h3>
|
||||
<div class="searchformwrapper">
|
||||
<form class="search" action="../../../../search.html" method="get">
|
||||
<input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
|
||||
<input type="submit" value="Go" />
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<script>$('#searchbox').show(0);</script>
|
||||
</div>
|
||||
</div>
|
||||
<div class="clearer"></div>
|
||||
</div>
|
||||
<div class="related" role="navigation" aria-label="related navigation">
|
||||
<h3>Navigation</h3>
|
||||
<ul>
|
||||
<li class="right" style="margin-right: 10px">
|
||||
<a href="../../../../genindex.html" title="General Index"
|
||||
>index</a></li>
|
||||
<li class="right" >
|
||||
<a href="../../../../py-modindex.html" title="Python Module Index"
|
||||
>modules</a> |</li>
|
||||
<li class="nav-item nav-item-0"><a href="../../../../index.html">pyFTS 1.7 documentation</a> »</li>
|
||||
<li class="nav-item nav-item-1"><a href="../../../index.html" >Module code</a> »</li>
|
||||
<li class="nav-item nav-item-this"><a href="">pyFTS.common.transformations.normalization</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="footer" role="contentinfo">
|
||||
© Copyright 2022, Machine Intelligence and Data Science Laboratory - UFMG - Brazil.
|
||||
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 4.3.2.
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
111
docs/build/html/_modules/pyFTS/common/transformations/roi.html
vendored
Normal file
111
docs/build/html/_modules/pyFTS/common/transformations/roi.html
vendored
Normal file
@ -0,0 +1,111 @@
|
||||
|
||||
|
||||
<!doctype html>
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>pyFTS.common.transformations.roi — pyFTS 1.7 documentation</title>
|
||||
<link rel="stylesheet" type="text/css" href="../../../../_static/pygments.css" />
|
||||
<link rel="stylesheet" type="text/css" href="../../../../_static/bizstyle.css" />
|
||||
|
||||
<script data-url_root="../../../../" id="documentation_options" src="../../../../_static/documentation_options.js"></script>
|
||||
<script src="../../../../_static/jquery.js"></script>
|
||||
<script src="../../../../_static/underscore.js"></script>
|
||||
<script src="../../../../_static/doctools.js"></script>
|
||||
<script src="../../../../_static/bizstyle.js"></script>
|
||||
<link rel="index" title="Index" href="../../../../genindex.html" />
|
||||
<link rel="search" title="Search" href="../../../../search.html" />
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1.0" />
|
||||
<!--[if lt IE 9]>
|
||||
<script src="_static/css3-mediaqueries.js"></script>
|
||||
<![endif]-->
|
||||
</head><body>
|
||||
<div class="related" role="navigation" aria-label="related navigation">
|
||||
<h3>Navigation</h3>
|
||||
<ul>
|
||||
<li class="right" style="margin-right: 10px">
|
||||
<a href="../../../../genindex.html" title="General Index"
|
||||
accesskey="I">index</a></li>
|
||||
<li class="right" >
|
||||
<a href="../../../../py-modindex.html" title="Python Module Index"
|
||||
>modules</a> |</li>
|
||||
<li class="nav-item nav-item-0"><a href="../../../../index.html">pyFTS 1.7 documentation</a> »</li>
|
||||
<li class="nav-item nav-item-1"><a href="../../../index.html" accesskey="U">Module code</a> »</li>
|
||||
<li class="nav-item nav-item-this"><a href="">pyFTS.common.transformations.roi</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="document">
|
||||
<div class="documentwrapper">
|
||||
<div class="bodywrapper">
|
||||
<div class="body" role="main">
|
||||
|
||||
<h1>Source code for pyFTS.common.transformations.roi</h1><div class="highlight"><pre>
|
||||
<span></span><span class="kn">from</span> <span class="nn">pyFTS.common.transformations.transformation</span> <span class="kn">import</span> <span class="n">Transformation</span>
|
||||
<span class="kn">import</span> <span class="nn">numpy</span> <span class="k">as</span> <span class="nn">np</span>
|
||||
|
||||
|
||||
<div class="viewcode-block" id="ROI"><a class="viewcode-back" href="../../../../pyFTS.common.transformations.html#pyFTS.common.transformations.roi.ROI">[docs]</a><span class="k">class</span> <span class="nc">ROI</span><span class="p">(</span><span class="n">Transformation</span><span class="p">):</span>
|
||||
<span class="w"> </span><span class="sd">"""</span>
|
||||
<span class="sd"> Return of Investment (ROI) transformation. Retrieved from Sadaei and Lee (2014) - Multilayer Stock</span>
|
||||
<span class="sd"> Forecasting Model Using Fuzzy Time Series</span>
|
||||
|
||||
<span class="sd"> y'(t) = ( y(t) - y(t-1) ) / y(t-1)</span>
|
||||
<span class="sd"> y(t) = ( y(t-1) * y'(t) ) + y(t-1)</span>
|
||||
<span class="sd"> """</span>
|
||||
<span class="k">def</span> <span class="fm">__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">ROI</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="bp">self</span><span class="o">.</span><span class="n">name</span> <span class="o">=</span> <span class="s1">'ROI'</span>
|
||||
|
||||
<div class="viewcode-block" id="ROI.apply"><a class="viewcode-back" href="../../../../pyFTS.common.transformations.html#pyFTS.common.transformations.roi.ROI.apply">[docs]</a> <span class="k">def</span> <span class="nf">apply</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">param</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
|
||||
<span class="n">modified</span> <span class="o">=</span> <span class="p">[(</span><span class="n">data</span><span class="p">[</span><span class="n">i</span><span class="p">]</span> <span class="o">-</span> <span class="n">data</span><span class="p">[</span><span class="n">i</span> <span class="o">-</span> <span class="mi">1</span><span class="p">])</span> <span class="o">/</span> <span class="n">data</span><span class="p">[</span><span class="n">i</span> <span class="o">-</span> <span class="mi">1</span><span class="p">]</span> <span class="k">for</span> <span class="n">i</span> <span class="ow">in</span> <span class="n">np</span><span class="o">.</span><span class="n">arange</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="nb">len</span><span class="p">(</span><span class="n">data</span><span class="p">))]</span>
|
||||
<span class="n">modified</span><span class="o">.</span><span class="n">insert</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="mf">.0</span><span class="p">)</span>
|
||||
<span class="k">return</span> <span class="n">modified</span></div>
|
||||
|
||||
<div class="viewcode-block" id="ROI.inverse"><a class="viewcode-back" href="../../../../pyFTS.common.transformations.html#pyFTS.common.transformations.roi.ROI.inverse">[docs]</a> <span class="k">def</span> <span class="nf">inverse</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">param</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
|
||||
<span class="n">modified</span> <span class="o">=</span> <span class="p">[(</span><span class="n">param</span><span class="p">[</span><span class="n">i</span> <span class="o">-</span> <span class="mi">1</span><span class="p">]</span> <span class="o">*</span> <span class="n">data</span><span class="p">[</span><span class="n">i</span><span class="p">])</span> <span class="o">+</span> <span class="n">param</span><span class="p">[</span><span class="n">i</span> <span class="o">-</span> <span class="mi">1</span><span class="p">]</span> <span class="k">for</span> <span class="n">i</span> <span class="ow">in</span> <span class="n">np</span><span class="o">.</span><span class="n">arange</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="nb">len</span><span class="p">(</span><span class="n">data</span><span class="p">))]</span>
|
||||
<span class="k">return</span> <span class="n">modified</span></div></div>
|
||||
</pre></div>
|
||||
|
||||
<div class="clearer"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
|
||||
<div class="sphinxsidebarwrapper">
|
||||
<div id="searchbox" style="display: none" role="search">
|
||||
<h3 id="searchlabel">Quick search</h3>
|
||||
<div class="searchformwrapper">
|
||||
<form class="search" action="../../../../search.html" method="get">
|
||||
<input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
|
||||
<input type="submit" value="Go" />
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<script>$('#searchbox').show(0);</script>
|
||||
</div>
|
||||
</div>
|
||||
<div class="clearer"></div>
|
||||
</div>
|
||||
<div class="related" role="navigation" aria-label="related navigation">
|
||||
<h3>Navigation</h3>
|
||||
<ul>
|
||||
<li class="right" style="margin-right: 10px">
|
||||
<a href="../../../../genindex.html" title="General Index"
|
||||
>index</a></li>
|
||||
<li class="right" >
|
||||
<a href="../../../../py-modindex.html" title="Python Module Index"
|
||||
>modules</a> |</li>
|
||||
<li class="nav-item nav-item-0"><a href="../../../../index.html">pyFTS 1.7 documentation</a> »</li>
|
||||
<li class="nav-item nav-item-1"><a href="../../../index.html" >Module code</a> »</li>
|
||||
<li class="nav-item nav-item-this"><a href="">pyFTS.common.transformations.roi</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="footer" role="contentinfo">
|
||||
© Copyright 2022, Machine Intelligence and Data Science Laboratory - UFMG - Brazil.
|
||||
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 4.3.2.
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
133
docs/build/html/_modules/pyFTS/common/transformations/scale.html
vendored
Normal file
133
docs/build/html/_modules/pyFTS/common/transformations/scale.html
vendored
Normal file
@ -0,0 +1,133 @@
|
||||
|
||||
|
||||
<!doctype html>
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>pyFTS.common.transformations.scale — pyFTS 1.7 documentation</title>
|
||||
<link rel="stylesheet" type="text/css" href="../../../../_static/pygments.css" />
|
||||
<link rel="stylesheet" type="text/css" href="../../../../_static/bizstyle.css" />
|
||||
|
||||
<script data-url_root="../../../../" id="documentation_options" src="../../../../_static/documentation_options.js"></script>
|
||||
<script src="../../../../_static/jquery.js"></script>
|
||||
<script src="../../../../_static/underscore.js"></script>
|
||||
<script src="../../../../_static/doctools.js"></script>
|
||||
<script src="../../../../_static/bizstyle.js"></script>
|
||||
<link rel="index" title="Index" href="../../../../genindex.html" />
|
||||
<link rel="search" title="Search" href="../../../../search.html" />
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1.0" />
|
||||
<!--[if lt IE 9]>
|
||||
<script src="_static/css3-mediaqueries.js"></script>
|
||||
<![endif]-->
|
||||
</head><body>
|
||||
<div class="related" role="navigation" aria-label="related navigation">
|
||||
<h3>Navigation</h3>
|
||||
<ul>
|
||||
<li class="right" style="margin-right: 10px">
|
||||
<a href="../../../../genindex.html" title="General Index"
|
||||
accesskey="I">index</a></li>
|
||||
<li class="right" >
|
||||
<a href="../../../../py-modindex.html" title="Python Module Index"
|
||||
>modules</a> |</li>
|
||||
<li class="nav-item nav-item-0"><a href="../../../../index.html">pyFTS 1.7 documentation</a> »</li>
|
||||
<li class="nav-item nav-item-1"><a href="../../../index.html" accesskey="U">Module code</a> »</li>
|
||||
<li class="nav-item nav-item-this"><a href="">pyFTS.common.transformations.scale</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="document">
|
||||
<div class="documentwrapper">
|
||||
<div class="bodywrapper">
|
||||
<div class="body" role="main">
|
||||
|
||||
<h1>Source code for pyFTS.common.transformations.scale</h1><div class="highlight"><pre>
|
||||
<span></span><span class="kn">from</span> <span class="nn">pyFTS.common.transformations.transformation</span> <span class="kn">import</span> <span class="n">Transformation</span>
|
||||
|
||||
|
||||
<div class="viewcode-block" id="Scale"><a class="viewcode-back" href="../../../../pyFTS.common.transformations.html#pyFTS.common.transformations.scale.Scale">[docs]</a><span class="k">class</span> <span class="nc">Scale</span><span class="p">(</span><span class="n">Transformation</span><span class="p">):</span>
|
||||
<span class="w"> </span><span class="sd">"""</span>
|
||||
<span class="sd"> Scale data inside a interval [min, max]</span>
|
||||
|
||||
<span class="sd"> </span>
|
||||
<span class="sd"> """</span>
|
||||
<span class="k">def</span> <span class="fm">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="nb">min</span><span class="o">=</span><span class="mi">0</span><span class="p">,</span> <span class="nb">max</span><span class="o">=</span><span class="mi">1</span><span class="p">):</span>
|
||||
<span class="nb">super</span><span class="p">(</span><span class="n">Scale</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="bp">self</span><span class="o">.</span><span class="n">data_max</span> <span class="o">=</span> <span class="kc">None</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">data_min</span> <span class="o">=</span> <span class="kc">None</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">transf_max</span> <span class="o">=</span> <span class="nb">max</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">transf_min</span> <span class="o">=</span> <span class="nb">min</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">name</span> <span class="o">=</span> <span class="s1">'Scale'</span>
|
||||
|
||||
<span class="nd">@property</span>
|
||||
<span class="k">def</span> <span class="nf">parameters</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
|
||||
<span class="k">return</span> <span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">transf_max</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">transf_min</span><span class="p">]</span>
|
||||
|
||||
<div class="viewcode-block" id="Scale.apply"><a class="viewcode-back" href="../../../../pyFTS.common.transformations.html#pyFTS.common.transformations.scale.Scale.apply">[docs]</a> <span class="k">def</span> <span class="nf">apply</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">param</span><span class="o">=</span><span class="kc">None</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">data_max</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">data_max</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">nanmax</span><span class="p">(</span><span class="n">data</span><span class="p">)</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">data_min</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">nanmin</span><span class="p">(</span><span class="n">data</span><span class="p">)</span>
|
||||
<span class="n">data_range</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">data_max</span> <span class="o">-</span> <span class="bp">self</span><span class="o">.</span><span class="n">data_min</span>
|
||||
<span class="n">transf_range</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">transf_max</span> <span class="o">-</span> <span class="bp">self</span><span class="o">.</span><span class="n">transf_min</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="nb">list</span><span class="p">):</span>
|
||||
<span class="n">tmp</span> <span class="o">=</span> <span class="p">[(</span><span class="n">k</span> <span class="o">+</span> <span class="p">(</span><span class="o">-</span><span class="mi">1</span> <span class="o">*</span> <span class="bp">self</span><span class="o">.</span><span class="n">data_min</span><span class="p">))</span> <span class="o">/</span> <span class="n">data_range</span> <span class="k">for</span> <span class="n">k</span> <span class="ow">in</span> <span class="n">data</span><span class="p">]</span>
|
||||
<span class="n">tmp2</span> <span class="o">=</span> <span class="p">[</span> <span class="p">(</span><span class="n">k</span> <span class="o">*</span> <span class="n">transf_range</span><span class="p">)</span> <span class="o">+</span> <span class="bp">self</span><span class="o">.</span><span class="n">transf_min</span> <span class="k">for</span> <span class="n">k</span> <span class="ow">in</span> <span class="n">tmp</span><span class="p">]</span>
|
||||
<span class="k">else</span><span class="p">:</span>
|
||||
<span class="n">tmp</span> <span class="o">=</span> <span class="p">(</span><span class="n">data</span> <span class="o">+</span> <span class="p">(</span><span class="o">-</span><span class="mi">1</span> <span class="o">*</span> <span class="bp">self</span><span class="o">.</span><span class="n">data_min</span><span class="p">))</span> <span class="o">/</span> <span class="n">data_range</span>
|
||||
<span class="n">tmp2</span> <span class="o">=</span> <span class="p">(</span><span class="n">tmp</span> <span class="o">*</span> <span class="n">transf_range</span><span class="p">)</span> <span class="o">+</span> <span class="bp">self</span><span class="o">.</span><span class="n">transf_min</span>
|
||||
|
||||
<span class="k">return</span> <span class="n">tmp2</span></div>
|
||||
|
||||
<div class="viewcode-block" id="Scale.inverse"><a class="viewcode-back" href="../../../../pyFTS.common.transformations.html#pyFTS.common.transformations.scale.Scale.inverse">[docs]</a> <span class="k">def</span> <span class="nf">inverse</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">param</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
|
||||
<span class="n">data_range</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">data_max</span> <span class="o">-</span> <span class="bp">self</span><span class="o">.</span><span class="n">data_min</span>
|
||||
<span class="n">transf_range</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">transf_max</span> <span class="o">-</span> <span class="bp">self</span><span class="o">.</span><span class="n">transf_min</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="nb">list</span><span class="p">):</span>
|
||||
<span class="n">tmp2</span> <span class="o">=</span> <span class="p">[(</span><span class="n">k</span> <span class="o">-</span> <span class="bp">self</span><span class="o">.</span><span class="n">transf_min</span><span class="p">)</span> <span class="o">/</span> <span class="n">transf_range</span> <span class="k">for</span> <span class="n">k</span> <span class="ow">in</span> <span class="n">data</span><span class="p">]</span>
|
||||
<span class="n">tmp</span> <span class="o">=</span> <span class="p">[(</span><span class="n">k</span> <span class="o">*</span> <span class="n">data_range</span><span class="p">)</span> <span class="o">+</span> <span class="bp">self</span><span class="o">.</span><span class="n">data_min</span> <span class="k">for</span> <span class="n">k</span> <span class="ow">in</span> <span class="n">tmp2</span><span class="p">]</span>
|
||||
<span class="k">else</span><span class="p">:</span>
|
||||
<span class="n">tmp2</span> <span class="o">=</span> <span class="p">(</span><span class="n">data</span> <span class="o">-</span> <span class="bp">self</span><span class="o">.</span><span class="n">transf_min</span><span class="p">)</span> <span class="o">/</span> <span class="n">transf_range</span>
|
||||
<span class="n">tmp</span> <span class="o">=</span> <span class="p">(</span><span class="n">tmp2</span> <span class="o">*</span> <span class="n">data_range</span><span class="p">)</span> <span class="o">+</span> <span class="bp">self</span><span class="o">.</span><span class="n">data_min</span>
|
||||
<span class="k">return</span> <span class="n">tmp</span></div></div>
|
||||
</pre></div>
|
||||
|
||||
<div class="clearer"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
|
||||
<div class="sphinxsidebarwrapper">
|
||||
<div id="searchbox" style="display: none" role="search">
|
||||
<h3 id="searchlabel">Quick search</h3>
|
||||
<div class="searchformwrapper">
|
||||
<form class="search" action="../../../../search.html" method="get">
|
||||
<input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
|
||||
<input type="submit" value="Go" />
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<script>$('#searchbox').show(0);</script>
|
||||
</div>
|
||||
</div>
|
||||
<div class="clearer"></div>
|
||||
</div>
|
||||
<div class="related" role="navigation" aria-label="related navigation">
|
||||
<h3>Navigation</h3>
|
||||
<ul>
|
||||
<li class="right" style="margin-right: 10px">
|
||||
<a href="../../../../genindex.html" title="General Index"
|
||||
>index</a></li>
|
||||
<li class="right" >
|
||||
<a href="../../../../py-modindex.html" title="Python Module Index"
|
||||
>modules</a> |</li>
|
||||
<li class="nav-item nav-item-0"><a href="../../../../index.html">pyFTS 1.7 documentation</a> »</li>
|
||||
<li class="nav-item nav-item-1"><a href="../../../index.html" >Module code</a> »</li>
|
||||
<li class="nav-item nav-item-this"><a href="">pyFTS.common.transformations.scale</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="footer" role="contentinfo">
|
||||
© Copyright 2022, Machine Intelligence and Data Science Laboratory - UFMG - Brazil.
|
||||
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 4.3.2.
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
177
docs/build/html/_modules/pyFTS/common/transformations/smoothing.html
vendored
Normal file
177
docs/build/html/_modules/pyFTS/common/transformations/smoothing.html
vendored
Normal file
@ -0,0 +1,177 @@
|
||||
|
||||
|
||||
<!doctype html>
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>pyFTS.common.transformations.smoothing — pyFTS 1.7 documentation</title>
|
||||
<link rel="stylesheet" type="text/css" href="../../../../_static/pygments.css" />
|
||||
<link rel="stylesheet" type="text/css" href="../../../../_static/bizstyle.css" />
|
||||
|
||||
<script data-url_root="../../../../" id="documentation_options" src="../../../../_static/documentation_options.js"></script>
|
||||
<script src="../../../../_static/jquery.js"></script>
|
||||
<script src="../../../../_static/underscore.js"></script>
|
||||
<script src="../../../../_static/doctools.js"></script>
|
||||
<script src="../../../../_static/bizstyle.js"></script>
|
||||
<link rel="index" title="Index" href="../../../../genindex.html" />
|
||||
<link rel="search" title="Search" href="../../../../search.html" />
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1.0" />
|
||||
<!--[if lt IE 9]>
|
||||
<script src="_static/css3-mediaqueries.js"></script>
|
||||
<![endif]-->
|
||||
</head><body>
|
||||
<div class="related" role="navigation" aria-label="related navigation">
|
||||
<h3>Navigation</h3>
|
||||
<ul>
|
||||
<li class="right" style="margin-right: 10px">
|
||||
<a href="../../../../genindex.html" title="General Index"
|
||||
accesskey="I">index</a></li>
|
||||
<li class="right" >
|
||||
<a href="../../../../py-modindex.html" title="Python Module Index"
|
||||
>modules</a> |</li>
|
||||
<li class="nav-item nav-item-0"><a href="../../../../index.html">pyFTS 1.7 documentation</a> »</li>
|
||||
<li class="nav-item nav-item-1"><a href="../../../index.html" accesskey="U">Module code</a> »</li>
|
||||
<li class="nav-item nav-item-this"><a href="">pyFTS.common.transformations.smoothing</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="document">
|
||||
<div class="documentwrapper">
|
||||
<div class="bodywrapper">
|
||||
<div class="body" role="main">
|
||||
|
||||
<h1>Source code for pyFTS.common.transformations.smoothing</h1><div class="highlight"><pre>
|
||||
<span></span><span class="kn">from</span> <span class="nn">pyFTS.common.transformations.transformation</span> <span class="kn">import</span> <span class="n">Transformation</span>
|
||||
<span class="kn">import</span> <span class="nn">numpy</span> <span class="k">as</span> <span class="nn">np</span>
|
||||
|
||||
<div class="viewcode-block" id="MovingAverage"><a class="viewcode-back" href="../../../../pyFTS.common.transformations.html#pyFTS.common.transformations.smoothing.MovingAverage">[docs]</a><span class="k">class</span> <span class="nc">MovingAverage</span><span class="p">(</span><span class="n">Transformation</span><span class="p">):</span>
|
||||
<span class="k">def</span> <span class="fm">__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">MovingAverage</span><span class="p">,</span> <span class="bp">self</span><span class="p">)</span><span class="o">.</span><span class="fm">__init__</span><span class="p">(</span><span class="o">**</span><span class="n">kwargs</span><span class="p">)</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">name</span> <span class="o">=</span> <span class="s1">'Moving Average Smoothing'</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">steps</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">'steps'</span><span class="p">,</span><span class="mi">2</span><span class="p">)</span>
|
||||
|
||||
<div class="viewcode-block" id="MovingAverage.apply"><a class="viewcode-back" href="../../../../pyFTS.common.transformations.html#pyFTS.common.transformations.smoothing.MovingAverage.apply">[docs]</a> <span class="k">def</span> <span class="nf">apply</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">param</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
|
||||
<span class="n">steps</span> <span class="o">=</span> <span class="n">param</span> <span class="k">if</span> <span class="n">param</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span> <span class="k">else</span> <span class="bp">self</span><span class="o">.</span><span class="n">steps</span>
|
||||
<span class="n">ma</span> <span class="o">=</span> <span class="p">[</span><span class="n">k</span> <span class="k">for</span> <span class="n">k</span> <span class="ow">in</span> <span class="n">data</span><span class="p">[:</span><span class="n">steps</span><span class="p">]]</span>
|
||||
<span class="n">ma</span><span class="o">.</span><span class="n">extend</span><span class="p">([</span><span class="n">np</span><span class="o">.</span><span class="n">mean</span><span class="p">(</span><span class="n">data</span><span class="p">[</span><span class="n">k</span><span class="o">-</span><span class="n">steps</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="nb">range</span><span class="p">(</span><span class="n">steps</span><span class="p">,</span> <span class="nb">len</span><span class="p">(</span><span class="n">data</span><span class="p">))])</span>
|
||||
<span class="k">return</span> <span class="n">ma</span></div>
|
||||
|
||||
<div class="viewcode-block" id="MovingAverage.inverse"><a class="viewcode-back" href="../../../../pyFTS.common.transformations.html#pyFTS.common.transformations.smoothing.MovingAverage.inverse">[docs]</a> <span class="k">def</span> <span class="nf">inverse</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">param</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
|
||||
<span class="k">return</span> <span class="n">data</span></div></div>
|
||||
|
||||
|
||||
<div class="viewcode-block" id="ExponentialSmoothing"><a class="viewcode-back" href="../../../../pyFTS.common.transformations.html#pyFTS.common.transformations.smoothing.ExponentialSmoothing">[docs]</a><span class="k">class</span> <span class="nc">ExponentialSmoothing</span><span class="p">(</span><span class="n">Transformation</span><span class="p">):</span>
|
||||
<span class="k">def</span> <span class="fm">__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">ExponentialSmoothing</span><span class="p">,</span><span class="bp">self</span><span class="p">)</span><span class="o">.</span><span class="fm">__init__</span><span class="p">(</span><span class="o">**</span><span class="n">kwargs</span><span class="p">)</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">name</span> <span class="o">=</span> <span class="s1">'Exponential Moving Average Smoothing'</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">steps</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">'steps'</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">beta</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">'beta'</span><span class="p">,</span><span class="mf">.5</span><span class="p">)</span>
|
||||
|
||||
<div class="viewcode-block" id="ExponentialSmoothing.apply"><a class="viewcode-back" href="../../../../pyFTS.common.transformations.html#pyFTS.common.transformations.smoothing.ExponentialSmoothing.apply">[docs]</a> <span class="k">def</span> <span class="nf">apply</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">param</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
|
||||
<span class="n">steps</span> <span class="o">=</span> <span class="n">param</span> <span class="k">if</span> <span class="n">param</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span> <span class="k">else</span> <span class="bp">self</span><span class="o">.</span><span class="n">steps</span>
|
||||
<span class="n">beta</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">'beta'</span><span class="p">,</span><span class="kc">None</span><span class="p">)</span>
|
||||
<span class="n">beta</span> <span class="o">=</span> <span class="n">beta</span> <span class="k">if</span> <span class="n">beta</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span> <span class="k">else</span> <span class="bp">self</span><span class="o">.</span><span class="n">beta</span>
|
||||
<span class="n">mm</span> <span class="o">=</span> <span class="p">[</span><span class="n">k</span> <span class="k">for</span> <span class="n">k</span> <span class="ow">in</span> <span class="n">data</span><span class="p">[:</span><span class="n">steps</span><span class="p">]]</span>
|
||||
<span class="k">for</span> <span class="n">i</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="n">steps</span><span class="p">,</span> <span class="nb">len</span><span class="p">(</span><span class="n">data</span><span class="p">)):</span>
|
||||
<span class="n">ret</span> <span class="o">=</span> <span class="mi">0</span>
|
||||
<span class="k">for</span> <span class="n">k</span> <span class="ow">in</span> <span class="n">np</span><span class="o">.</span><span class="n">arange</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span><span class="n">steps</span><span class="p">):</span>
|
||||
<span class="n">ret</span> <span class="o">+=</span> <span class="p">(</span> <span class="n">beta</span> <span class="o">*</span> <span class="p">(</span><span class="mi">1</span> <span class="o">-</span> <span class="n">beta</span><span class="p">)</span> <span class="o">**</span> <span class="n">k</span> <span class="p">)</span> <span class="o">*</span> <span class="n">data</span><span class="p">[</span><span class="n">i</span> <span class="o">-</span> <span class="n">k</span><span class="p">]</span>
|
||||
<span class="n">mm</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">ret</span><span class="p">)</span>
|
||||
<span class="k">return</span> <span class="n">mm</span></div>
|
||||
|
||||
<div class="viewcode-block" id="ExponentialSmoothing.inverse"><a class="viewcode-back" href="../../../../pyFTS.common.transformations.html#pyFTS.common.transformations.smoothing.ExponentialSmoothing.inverse">[docs]</a> <span class="k">def</span> <span class="nf">inverse</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">param</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
|
||||
<span class="k">return</span> <span class="n">data</span></div></div>
|
||||
|
||||
|
||||
<div class="viewcode-block" id="AveragePooling"><a class="viewcode-back" href="../../../../pyFTS.common.transformations.html#pyFTS.common.transformations.smoothing.AveragePooling">[docs]</a><span class="k">class</span> <span class="nc">AveragePooling</span><span class="p">(</span><span class="n">Transformation</span><span class="p">):</span>
|
||||
<span class="k">def</span> <span class="fm">__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">AveragePooling</span><span class="p">,</span><span class="bp">self</span><span class="p">)</span><span class="o">.</span><span class="fm">__init__</span><span class="p">(</span><span class="o">**</span><span class="n">kwargs</span><span class="p">)</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">name</span> <span class="o">=</span> <span class="s1">'Exponential Average Smoothing'</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">kernel</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">'kernel'</span><span class="p">,</span><span class="mi">5</span><span class="p">)</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">stride</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">'stride'</span><span class="p">,</span><span class="mi">1</span><span class="p">)</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">padding</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">'padding'</span><span class="p">,</span><span class="s1">'same'</span><span class="p">)</span>
|
||||
|
||||
<div class="viewcode-block" id="AveragePooling.apply"><a class="viewcode-back" href="../../../../pyFTS.common.transformations.html#pyFTS.common.transformations.smoothing.AveragePooling.apply">[docs]</a> <span class="k">def</span> <span class="nf">apply</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">result</span> <span class="o">=</span> <span class="p">[]</span>
|
||||
<span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">padding</span> <span class="o">==</span> <span class="s1">'same'</span><span class="p">:</span>
|
||||
<span class="k">for</span> <span class="n">i</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="nb">int</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">kernel</span><span class="o">/</span><span class="mi">2</span><span class="p">),</span> <span class="nb">len</span><span class="p">(</span><span class="n">data</span><span class="p">)</span><span class="o">+</span><span class="nb">int</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">kernel</span><span class="o">/</span><span class="mi">2</span><span class="p">),</span> <span class="bp">self</span><span class="o">.</span><span class="n">stride</span><span class="p">):</span>
|
||||
<span class="n">result</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">np</span><span class="o">.</span><span class="n">mean</span><span class="p">(</span><span class="n">data</span><span class="p">[</span><span class="n">np</span><span class="o">.</span><span class="n">max</span><span class="p">([</span><span class="mi">0</span><span class="p">,</span><span class="n">i</span><span class="o">-</span><span class="bp">self</span><span class="o">.</span><span class="n">kernel</span><span class="p">]):</span><span class="n">np</span><span class="o">.</span><span class="n">min</span><span class="p">([</span><span class="n">i</span><span class="p">,</span> <span class="nb">len</span><span class="p">(</span><span class="n">data</span><span class="p">)])]))</span>
|
||||
|
||||
<span class="k">elif</span> <span class="bp">self</span><span class="o">.</span><span class="n">padding</span> <span class="o">==</span> <span class="s1">'valid'</span><span class="p">:</span>
|
||||
<span class="k">for</span> <span class="n">i</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">kernel</span><span class="p">,</span> <span class="nb">len</span><span class="p">(</span><span class="n">data</span><span class="p">),</span> <span class="bp">self</span><span class="o">.</span><span class="n">stride</span><span class="p">):</span>
|
||||
<span class="n">result</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">np</span><span class="o">.</span><span class="n">mean</span><span class="p">(</span><span class="n">data</span><span class="p">[</span><span class="n">i</span><span class="o">-</span><span class="bp">self</span><span class="o">.</span><span class="n">kernel</span><span class="p">:</span><span class="n">i</span><span class="p">]))</span>
|
||||
<span class="k">else</span><span class="p">:</span>
|
||||
<span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span><span class="s1">'Invalid padding schema'</span><span class="p">)</span>
|
||||
<span class="k">return</span> <span class="n">result</span></div>
|
||||
|
||||
<div class="viewcode-block" id="AveragePooling.inverse"><a class="viewcode-back" href="../../../../pyFTS.common.transformations.html#pyFTS.common.transformations.smoothing.AveragePooling.inverse">[docs]</a> <span class="k">def</span> <span class="nf">inverse</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">param</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
|
||||
<span class="k">return</span> <span class="n">data</span></div></div>
|
||||
|
||||
|
||||
<div class="viewcode-block" id="MaxPooling"><a class="viewcode-back" href="../../../../pyFTS.common.transformations.html#pyFTS.common.transformations.smoothing.MaxPooling">[docs]</a><span class="k">class</span> <span class="nc">MaxPooling</span><span class="p">(</span><span class="n">Transformation</span><span class="p">):</span>
|
||||
<span class="k">def</span> <span class="fm">__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">MaxPooling</span><span class="p">,</span><span class="bp">self</span><span class="p">)</span><span class="o">.</span><span class="fm">__init__</span><span class="p">(</span><span class="o">**</span><span class="n">kwargs</span><span class="p">)</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">name</span> <span class="o">=</span> <span class="s1">'Exponential Average Smoothing'</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">kernel</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">'kernel'</span><span class="p">,</span><span class="mi">5</span><span class="p">)</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">stride</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">'stride'</span><span class="p">,</span><span class="mi">1</span><span class="p">)</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">padding</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">'padding'</span><span class="p">,</span><span class="s1">'same'</span><span class="p">)</span>
|
||||
|
||||
<div class="viewcode-block" id="MaxPooling.apply"><a class="viewcode-back" href="../../../../pyFTS.common.transformations.html#pyFTS.common.transformations.smoothing.MaxPooling.apply">[docs]</a> <span class="k">def</span> <span class="nf">apply</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">result</span> <span class="o">=</span> <span class="p">[]</span>
|
||||
<span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">padding</span> <span class="o">==</span> <span class="s1">'same'</span><span class="p">:</span>
|
||||
<span class="k">for</span> <span class="n">i</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="nb">int</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">kernel</span><span class="o">/</span><span class="mi">2</span><span class="p">),</span> <span class="nb">len</span><span class="p">(</span><span class="n">data</span><span class="p">)</span><span class="o">+</span><span class="nb">int</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">kernel</span><span class="o">/</span><span class="mi">2</span><span class="p">),</span> <span class="bp">self</span><span class="o">.</span><span class="n">stride</span><span class="p">):</span>
|
||||
<span class="n">result</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">np</span><span class="o">.</span><span class="n">max</span><span class="p">(</span><span class="n">data</span><span class="p">[</span><span class="n">np</span><span class="o">.</span><span class="n">max</span><span class="p">([</span><span class="mi">0</span><span class="p">,</span><span class="n">i</span><span class="o">-</span><span class="bp">self</span><span class="o">.</span><span class="n">kernel</span><span class="p">]):</span><span class="n">np</span><span class="o">.</span><span class="n">min</span><span class="p">([</span><span class="n">i</span><span class="p">,</span> <span class="nb">len</span><span class="p">(</span><span class="n">data</span><span class="p">)])]))</span>
|
||||
|
||||
<span class="k">elif</span> <span class="bp">self</span><span class="o">.</span><span class="n">padding</span> <span class="o">==</span> <span class="s1">'valid'</span><span class="p">:</span>
|
||||
<span class="k">for</span> <span class="n">i</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">kernel</span> <span class="o">-</span> <span class="mi">1</span><span class="p">,</span> <span class="nb">len</span><span class="p">(</span><span class="n">data</span><span class="p">),</span> <span class="bp">self</span><span class="o">.</span><span class="n">stride</span><span class="p">):</span>
|
||||
<span class="n">result</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">np</span><span class="o">.</span><span class="n">max</span><span class="p">(</span><span class="n">data</span><span class="p">[</span><span class="n">i</span><span class="o">-</span><span class="bp">self</span><span class="o">.</span><span class="n">kernel</span><span class="p">:</span><span class="n">i</span><span class="p">]))</span>
|
||||
<span class="k">else</span><span class="p">:</span>
|
||||
<span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span><span class="s1">'Invalid padding schema'</span><span class="p">)</span>
|
||||
<span class="k">return</span> <span class="n">result</span></div>
|
||||
|
||||
<div class="viewcode-block" id="MaxPooling.inverse"><a class="viewcode-back" href="../../../../pyFTS.common.transformations.html#pyFTS.common.transformations.smoothing.MaxPooling.inverse">[docs]</a> <span class="k">def</span> <span class="nf">inverse</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">param</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
|
||||
<span class="k">return</span> <span class="n">data</span></div></div>
|
||||
</pre></div>
|
||||
|
||||
<div class="clearer"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
|
||||
<div class="sphinxsidebarwrapper">
|
||||
<div id="searchbox" style="display: none" role="search">
|
||||
<h3 id="searchlabel">Quick search</h3>
|
||||
<div class="searchformwrapper">
|
||||
<form class="search" action="../../../../search.html" method="get">
|
||||
<input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
|
||||
<input type="submit" value="Go" />
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<script>$('#searchbox').show(0);</script>
|
||||
</div>
|
||||
</div>
|
||||
<div class="clearer"></div>
|
||||
</div>
|
||||
<div class="related" role="navigation" aria-label="related navigation">
|
||||
<h3>Navigation</h3>
|
||||
<ul>
|
||||
<li class="right" style="margin-right: 10px">
|
||||
<a href="../../../../genindex.html" title="General Index"
|
||||
>index</a></li>
|
||||
<li class="right" >
|
||||
<a href="../../../../py-modindex.html" title="Python Module Index"
|
||||
>modules</a> |</li>
|
||||
<li class="nav-item nav-item-0"><a href="../../../../index.html">pyFTS 1.7 documentation</a> »</li>
|
||||
<li class="nav-item nav-item-1"><a href="../../../index.html" >Module code</a> »</li>
|
||||
<li class="nav-item nav-item-this"><a href="">pyFTS.common.transformations.smoothing</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="footer" role="contentinfo">
|
||||
© Copyright 2022, Machine Intelligence and Data Science Laboratory - UFMG - Brazil.
|
||||
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 4.3.2.
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
193
docs/build/html/_modules/pyFTS/common/transformations/som.html
vendored
Normal file
193
docs/build/html/_modules/pyFTS/common/transformations/som.html
vendored
Normal file
@ -0,0 +1,193 @@
|
||||
|
||||
|
||||
<!doctype html>
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>pyFTS.common.transformations.som — pyFTS 1.7 documentation</title>
|
||||
<link rel="stylesheet" type="text/css" href="../../../../_static/pygments.css" />
|
||||
<link rel="stylesheet" type="text/css" href="../../../../_static/bizstyle.css" />
|
||||
|
||||
<script data-url_root="../../../../" id="documentation_options" src="../../../../_static/documentation_options.js"></script>
|
||||
<script src="../../../../_static/jquery.js"></script>
|
||||
<script src="../../../../_static/underscore.js"></script>
|
||||
<script src="../../../../_static/doctools.js"></script>
|
||||
<script src="../../../../_static/bizstyle.js"></script>
|
||||
<link rel="index" title="Index" href="../../../../genindex.html" />
|
||||
<link rel="search" title="Search" href="../../../../search.html" />
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1.0" />
|
||||
<!--[if lt IE 9]>
|
||||
<script src="_static/css3-mediaqueries.js"></script>
|
||||
<![endif]-->
|
||||
</head><body>
|
||||
<div class="related" role="navigation" aria-label="related navigation">
|
||||
<h3>Navigation</h3>
|
||||
<ul>
|
||||
<li class="right" style="margin-right: 10px">
|
||||
<a href="../../../../genindex.html" title="General Index"
|
||||
accesskey="I">index</a></li>
|
||||
<li class="right" >
|
||||
<a href="../../../../py-modindex.html" title="Python Module Index"
|
||||
>modules</a> |</li>
|
||||
<li class="nav-item nav-item-0"><a href="../../../../index.html">pyFTS 1.7 documentation</a> »</li>
|
||||
<li class="nav-item nav-item-1"><a href="../../../index.html" accesskey="U">Module code</a> »</li>
|
||||
<li class="nav-item nav-item-this"><a href="">pyFTS.common.transformations.som</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="document">
|
||||
<div class="documentwrapper">
|
||||
<div class="bodywrapper">
|
||||
<div class="body" role="main">
|
||||
|
||||
<h1>Source code for pyFTS.common.transformations.som</h1><div class="highlight"><pre>
|
||||
<span></span><span class="sd">"""</span>
|
||||
<span class="sd">Kohonen Self Organizing Maps for Fuzzy Time Series</span>
|
||||
<span class="sd">"""</span>
|
||||
<span class="kn">import</span> <span class="nn">pandas</span> <span class="k">as</span> <span class="nn">pd</span>
|
||||
<span class="c1">#from pyFTS.models.multivariate import wmvfts</span>
|
||||
<span class="kn">from</span> <span class="nn">typing</span> <span class="kn">import</span> <span class="n">Tuple</span>
|
||||
<span class="kn">from</span> <span class="nn">typing</span> <span class="kn">import</span> <span class="n">List</span>
|
||||
<span class="kn">from</span> <span class="nn">pyFTS.common.transformations.transformation</span> <span class="kn">import</span> <span class="n">Transformation</span>
|
||||
|
||||
|
||||
<div class="viewcode-block" id="SOMTransformation"><a class="viewcode-back" href="../../../../pyFTS.common.transformations.html#pyFTS.common.transformations.som.SOMTransformation">[docs]</a><span class="k">class</span> <span class="nc">SOMTransformation</span><span class="p">(</span><span class="n">Transformation</span><span class="p">):</span>
|
||||
|
||||
<span class="k">def</span> <span class="fm">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span>
|
||||
<span class="n">grid_dimension</span><span class="p">:</span> <span class="n">Tuple</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">SimpSOM</span> <span class="k">as</span> <span class="nn">sps</span>
|
||||
|
||||
<span class="c1"># SOM attributes</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">load_file</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">'loadFile'</span><span class="p">)</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">net</span><span class="p">:</span> <span class="n">sps</span><span class="o">.</span><span class="n">somNet</span> <span class="o">=</span> <span class="kc">None</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">data</span><span class="p">:</span> <span class="n">pd</span><span class="o">.</span><span class="n">DataFrame</span> <span class="o">=</span> <span class="kc">None</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">grid_dimension</span><span class="p">:</span> <span class="n">Tuple</span> <span class="o">=</span> <span class="n">grid_dimension</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">pbc</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">'PBC'</span><span class="p">,</span> <span class="kc">True</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="c1"># debug attributes</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">name</span> <span class="o">=</span> <span class="s1">'Kohonen Self Organizing Maps FTS'</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">shortname</span> <span class="o">=</span> <span class="s1">'SOM-FTS'</span>
|
||||
|
||||
<div class="viewcode-block" id="SOMTransformation.apply"><a class="viewcode-back" href="../../../../pyFTS.common.transformations.html#pyFTS.common.transformations.som.SOMTransformation.apply">[docs]</a> <span class="k">def</span> <span class="nf">apply</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">pd</span><span class="o">.</span><span class="n">DataFrame</span><span class="p">,</span>
|
||||
<span class="n">param</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span>
|
||||
<span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
|
||||
<span class="w"> </span><span class="sd">"""</span>
|
||||
<span class="sd"> Transform a M-dimensional dataset into a 3-dimensional dataset, where one dimension is the endogen variable</span>
|
||||
<span class="sd"> If endogen_variable = None, the last column will be the endogen_variable.</span>
|
||||
|
||||
<span class="sd"> Args:</span>
|
||||
<span class="sd"> data (pd.DataFrame): M-Dimensional dataset</span>
|
||||
<span class="sd"> endogen_variable (str): column of dataset</span>
|
||||
<span class="sd"> names (Tuple): names for new columns created by SOM Transformation.</span>
|
||||
<span class="sd"> param:</span>
|
||||
<span class="sd"> **kwargs: params of SOM's train process</span>
|
||||
<span class="sd"> percentage_train (float). Percentage of dataset that will be used for train SOM network. default: 0.7</span>
|
||||
<span class="sd"> leaning_rate (float): leaning rate of SOM network. default: 0.01</span>
|
||||
<span class="sd"> epochs: epochs of SOM network. default: 10000</span>
|
||||
<span class="sd"> </span>
|
||||
<span class="sd"> Returns:</span>
|
||||
|
||||
<span class="sd"> """</span>
|
||||
|
||||
<span class="n">endogen_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">'endogen_variable'</span><span class="p">,</span> <span class="kc">None</span><span class="p">)</span>
|
||||
<span class="n">names</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">'names'</span><span class="p">,</span> <span class="p">(</span><span class="s1">'x'</span><span class="p">,</span> <span class="s1">'y'</span><span class="p">))</span>
|
||||
|
||||
<span class="k">if</span> <span class="n">endogen_variable</span> <span class="ow">not</span> <span class="ow">in</span> <span class="n">data</span><span class="o">.</span><span class="n">columns</span><span class="p">:</span>
|
||||
<span class="n">endogen_variable</span> <span class="o">=</span> <span class="kc">None</span>
|
||||
<span class="n">cols</span> <span class="o">=</span> <span class="n">data</span><span class="o">.</span><span class="n">columns</span><span class="p">[:</span><span class="o">-</span><span class="mi">1</span><span class="p">]</span> <span class="k">if</span> <span class="n">endogen_variable</span> <span class="ow">is</span> <span class="kc">None</span> <span class="k">else</span> <span class="p">[</span><span class="n">col</span> <span class="k">for</span> <span class="n">col</span> <span class="ow">in</span> <span class="n">data</span><span class="o">.</span><span class="n">columns</span> <span class="k">if</span>
|
||||
<span class="n">col</span> <span class="o">!=</span> <span class="n">endogen_variable</span><span class="p">]</span>
|
||||
<span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">net</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span>
|
||||
<span class="n">train</span> <span class="o">=</span> <span class="n">data</span><span class="p">[</span><span class="n">cols</span><span class="p">]</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">train</span><span class="p">(</span><span class="n">data</span><span class="o">=</span><span class="n">train</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">)</span>
|
||||
<span class="n">new_data</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">net</span><span class="o">.</span><span class="n">project</span><span class="p">(</span><span class="n">data</span><span class="p">[</span><span class="n">cols</span><span class="p">]</span><span class="o">.</span><span class="n">values</span><span class="p">)</span>
|
||||
<span class="n">new_data</span> <span class="o">=</span> <span class="n">pd</span><span class="o">.</span><span class="n">DataFrame</span><span class="p">(</span><span class="n">new_data</span><span class="p">,</span> <span class="n">columns</span><span class="o">=</span><span class="n">names</span><span class="p">)</span>
|
||||
<span class="n">endogen</span> <span class="o">=</span> <span class="n">endogen_variable</span> <span class="k">if</span> <span class="n">endogen_variable</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span> <span class="k">else</span> <span class="n">data</span><span class="o">.</span><span class="n">columns</span><span class="p">[</span><span class="o">-</span><span class="mi">1</span><span class="p">]</span>
|
||||
<span class="n">new_data</span><span class="p">[</span><span class="n">endogen</span><span class="p">]</span> <span class="o">=</span> <span class="n">data</span><span class="p">[</span><span class="n">endogen</span><span class="p">]</span><span class="o">.</span><span class="n">values</span>
|
||||
<span class="k">return</span> <span class="n">new_data</span></div>
|
||||
|
||||
<span class="k">def</span> <span class="fm">__repr__</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
|
||||
<span class="n">status</span> <span class="o">=</span> <span class="s2">"is trained"</span> <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">net</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span> <span class="k">else</span> <span class="s2">"not trained"</span>
|
||||
<span class="k">return</span> <span class="sa">f</span><span class="s1">'</span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="n">name</span><span class="si">}</span><span class="s1">-</span><span class="si">{</span><span class="n">status</span><span class="si">}</span><span class="s1">'</span>
|
||||
|
||||
<span class="k">def</span> <span class="fm">__str__</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
|
||||
<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">name</span>
|
||||
|
||||
<span class="k">def</span> <span class="fm">__del__</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
|
||||
<span class="k">del</span> <span class="bp">self</span><span class="o">.</span><span class="n">net</span>
|
||||
|
||||
<div class="viewcode-block" id="SOMTransformation.train"><a class="viewcode-back" href="../../../../pyFTS.common.transformations.html#pyFTS.common.transformations.som.SOMTransformation.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="n">pd</span><span class="o">.</span><span class="n">DataFrame</span><span class="p">,</span>
|
||||
<span class="n">percentage_train</span><span class="p">:</span> <span class="nb">float</span> <span class="o">=</span> <span class="mf">.7</span><span class="p">,</span>
|
||||
<span class="n">leaning_rate</span><span class="p">:</span> <span class="nb">float</span> <span class="o">=</span> <span class="mf">0.01</span><span class="p">,</span>
|
||||
<span class="n">epochs</span><span class="p">:</span> <span class="nb">int</span> <span class="o">=</span> <span class="mi">10000</span><span class="p">):</span>
|
||||
<span class="n">data</span> <span class="o">=</span> <span class="n">data</span><span class="o">.</span><span class="n">dropna</span><span class="p">()</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">data</span> <span class="o">=</span> <span class="n">data</span><span class="o">.</span><span class="n">values</span>
|
||||
<span class="n">limit</span> <span class="o">=</span> <span class="nb">round</span><span class="p">(</span><span class="nb">len</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">data</span><span class="p">)</span> <span class="o">*</span> <span class="n">percentage_train</span><span class="p">)</span>
|
||||
<span class="n">train</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">data</span><span class="p">[:</span><span class="n">limit</span><span class="p">]</span>
|
||||
<span class="n">x</span><span class="p">,</span> <span class="n">y</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">grid_dimension</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">net</span> <span class="o">=</span> <span class="n">sps</span><span class="o">.</span><span class="n">somNet</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="n">y</span><span class="p">,</span> <span class="n">train</span><span class="p">,</span> <span class="n">PBC</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">pbc</span><span class="p">,</span>
|
||||
<span class="n">loadFile</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">load_file</span><span class="p">)</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">net</span><span class="o">.</span><span class="n">train</span><span class="p">(</span><span class="n">startLearnRate</span><span class="o">=</span><span class="n">leaning_rate</span><span class="p">,</span>
|
||||
<span class="n">epochs</span><span class="o">=</span><span class="n">epochs</span><span class="p">)</span></div>
|
||||
|
||||
<div class="viewcode-block" id="SOMTransformation.save_net"><a class="viewcode-back" href="../../../../pyFTS.common.transformations.html#pyFTS.common.transformations.som.SOMTransformation.save_net">[docs]</a> <span class="k">def</span> <span class="nf">save_net</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span>
|
||||
<span class="n">filename</span><span class="p">:</span> <span class="nb">str</span> <span class="o">=</span> <span class="s2">"SomNet trained"</span><span class="p">):</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">net</span><span class="o">.</span><span class="n">save</span><span class="p">(</span><span class="n">filename</span><span class="p">)</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">load_file</span> <span class="o">=</span> <span class="n">filename</span></div>
|
||||
|
||||
<div class="viewcode-block" id="SOMTransformation.show_grid"><a class="viewcode-back" href="../../../../pyFTS.common.transformations.html#pyFTS.common.transformations.som.SOMTransformation.show_grid">[docs]</a> <span class="k">def</span> <span class="nf">show_grid</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span>
|
||||
<span class="n">graph_type</span><span class="p">:</span> <span class="nb">str</span> <span class="o">=</span> <span class="s1">'nodes_graph'</span><span class="p">,</span>
|
||||
<span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
|
||||
<span class="k">if</span> <span class="n">graph_type</span> <span class="o">==</span> <span class="s1">'nodes_graph'</span><span class="p">:</span>
|
||||
<span class="n">colnum</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">'colnum'</span><span class="p">,</span> <span class="mi">0</span><span class="p">)</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">net</span><span class="o">.</span><span class="n">nodes_graph</span><span class="p">(</span><span class="n">colnum</span><span class="o">=</span><span class="n">colnum</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">net</span><span class="o">.</span><span class="n">diff_graph</span><span class="p">()</span></div></div>
|
||||
</pre></div>
|
||||
|
||||
<div class="clearer"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
|
||||
<div class="sphinxsidebarwrapper">
|
||||
<div id="searchbox" style="display: none" role="search">
|
||||
<h3 id="searchlabel">Quick search</h3>
|
||||
<div class="searchformwrapper">
|
||||
<form class="search" action="../../../../search.html" method="get">
|
||||
<input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
|
||||
<input type="submit" value="Go" />
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<script>$('#searchbox').show(0);</script>
|
||||
</div>
|
||||
</div>
|
||||
<div class="clearer"></div>
|
||||
</div>
|
||||
<div class="related" role="navigation" aria-label="related navigation">
|
||||
<h3>Navigation</h3>
|
||||
<ul>
|
||||
<li class="right" style="margin-right: 10px">
|
||||
<a href="../../../../genindex.html" title="General Index"
|
||||
>index</a></li>
|
||||
<li class="right" >
|
||||
<a href="../../../../py-modindex.html" title="Python Module Index"
|
||||
>modules</a> |</li>
|
||||
<li class="nav-item nav-item-0"><a href="../../../../index.html">pyFTS 1.7 documentation</a> »</li>
|
||||
<li class="nav-item nav-item-1"><a href="../../../index.html" >Module code</a> »</li>
|
||||
<li class="nav-item nav-item-this"><a href="">pyFTS.common.transformations.som</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="footer" role="contentinfo">
|
||||
© Copyright 2022, Machine Intelligence and Data Science Laboratory - UFMG - Brazil.
|
||||
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 4.3.2.
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
123
docs/build/html/_modules/pyFTS/common/transformations/transformation.html
vendored
Normal file
123
docs/build/html/_modules/pyFTS/common/transformations/transformation.html
vendored
Normal file
@ -0,0 +1,123 @@
|
||||
|
||||
|
||||
<!doctype html>
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>pyFTS.common.transformations.transformation — pyFTS 1.7 documentation</title>
|
||||
<link rel="stylesheet" type="text/css" href="../../../../_static/pygments.css" />
|
||||
<link rel="stylesheet" type="text/css" href="../../../../_static/bizstyle.css" />
|
||||
|
||||
<script data-url_root="../../../../" id="documentation_options" src="../../../../_static/documentation_options.js"></script>
|
||||
<script src="../../../../_static/jquery.js"></script>
|
||||
<script src="../../../../_static/underscore.js"></script>
|
||||
<script src="../../../../_static/doctools.js"></script>
|
||||
<script src="../../../../_static/bizstyle.js"></script>
|
||||
<link rel="index" title="Index" href="../../../../genindex.html" />
|
||||
<link rel="search" title="Search" href="../../../../search.html" />
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1.0" />
|
||||
<!--[if lt IE 9]>
|
||||
<script src="_static/css3-mediaqueries.js"></script>
|
||||
<![endif]-->
|
||||
</head><body>
|
||||
<div class="related" role="navigation" aria-label="related navigation">
|
||||
<h3>Navigation</h3>
|
||||
<ul>
|
||||
<li class="right" style="margin-right: 10px">
|
||||
<a href="../../../../genindex.html" title="General Index"
|
||||
accesskey="I">index</a></li>
|
||||
<li class="right" >
|
||||
<a href="../../../../py-modindex.html" title="Python Module Index"
|
||||
>modules</a> |</li>
|
||||
<li class="nav-item nav-item-0"><a href="../../../../index.html">pyFTS 1.7 documentation</a> »</li>
|
||||
<li class="nav-item nav-item-1"><a href="../../../index.html" accesskey="U">Module code</a> »</li>
|
||||
<li class="nav-item nav-item-this"><a href="">pyFTS.common.transformations.transformation</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="document">
|
||||
<div class="documentwrapper">
|
||||
<div class="bodywrapper">
|
||||
<div class="body" role="main">
|
||||
|
||||
<h1>Source code for pyFTS.common.transformations.transformation</h1><div class="highlight"><pre>
|
||||
<span></span>
|
||||
<div class="viewcode-block" id="Transformation"><a class="viewcode-back" href="../../../../pyFTS.common.transformations.html#pyFTS.common.transformations.transformation.Transformation">[docs]</a><span class="k">class</span> <span class="nc">Transformation</span><span class="p">(</span><span class="nb">object</span><span class="p">):</span>
|
||||
<span class="w"> </span><span class="sd">"""</span>
|
||||
<span class="sd"> Data transformation used on pre and post processing of the FTS</span>
|
||||
<span class="sd"> """</span>
|
||||
|
||||
<span class="k">def</span> <span class="fm">__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="bp">self</span><span class="o">.</span><span class="n">is_invertible</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">False</span>
|
||||
<span class="w"> </span><span class="sd">"""detemine if this transformation can be applied to multivariate data"""</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">minimal_length</span> <span class="o">=</span> <span class="mi">1</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">name</span> <span class="o">=</span> <span class="s1">''</span>
|
||||
|
||||
<div class="viewcode-block" id="Transformation.apply"><a class="viewcode-back" href="../../../../pyFTS.common.transformations.html#pyFTS.common.transformations.transformation.Transformation.apply">[docs]</a> <span class="k">def</span> <span class="nf">apply</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">param</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
|
||||
<span class="w"> </span><span class="sd">"""</span>
|
||||
<span class="sd"> Apply the transformation on input data</span>
|
||||
|
||||
<span class="sd"> :param data: input data</span>
|
||||
<span class="sd"> :param param:</span>
|
||||
<span class="sd"> :param kwargs:</span>
|
||||
<span class="sd"> :return: numpy array with transformed data</span>
|
||||
<span class="sd"> """</span>
|
||||
<span class="k">pass</span></div>
|
||||
|
||||
<div class="viewcode-block" id="Transformation.inverse"><a class="viewcode-back" href="../../../../pyFTS.common.transformations.html#pyFTS.common.transformations.transformation.Transformation.inverse">[docs]</a> <span class="k">def</span> <span class="nf">inverse</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">param</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
|
||||
<span class="w"> </span><span class="sd">"""</span>
|
||||
|
||||
<span class="sd"> :param data: transformed data</span>
|
||||
<span class="sd"> :param param:</span>
|
||||
<span class="sd"> :param kwargs:</span>
|
||||
<span class="sd"> :return: numpy array with inverse transformed data</span>
|
||||
<span class="sd"> """</span>
|
||||
<span class="k">pass</span></div>
|
||||
|
||||
<span class="k">def</span> <span class="fm">__str__</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
|
||||
<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">name</span></div>
|
||||
</pre></div>
|
||||
|
||||
<div class="clearer"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
|
||||
<div class="sphinxsidebarwrapper">
|
||||
<div id="searchbox" style="display: none" role="search">
|
||||
<h3 id="searchlabel">Quick search</h3>
|
||||
<div class="searchformwrapper">
|
||||
<form class="search" action="../../../../search.html" method="get">
|
||||
<input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
|
||||
<input type="submit" value="Go" />
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<script>$('#searchbox').show(0);</script>
|
||||
</div>
|
||||
</div>
|
||||
<div class="clearer"></div>
|
||||
</div>
|
||||
<div class="related" role="navigation" aria-label="related navigation">
|
||||
<h3>Navigation</h3>
|
||||
<ul>
|
||||
<li class="right" style="margin-right: 10px">
|
||||
<a href="../../../../genindex.html" title="General Index"
|
||||
>index</a></li>
|
||||
<li class="right" >
|
||||
<a href="../../../../py-modindex.html" title="Python Module Index"
|
||||
>modules</a> |</li>
|
||||
<li class="nav-item nav-item-0"><a href="../../../../index.html">pyFTS 1.7 documentation</a> »</li>
|
||||
<li class="nav-item nav-item-1"><a href="../../../index.html" >Module code</a> »</li>
|
||||
<li class="nav-item nav-item-this"><a href="">pyFTS.common.transformations.transformation</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="footer" role="contentinfo">
|
||||
© Copyright 2022, Machine Intelligence and Data Science Laboratory - UFMG - Brazil.
|
||||
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 4.3.2.
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
174
docs/build/html/_modules/pyFTS/common/transformations/trend.html
vendored
Normal file
174
docs/build/html/_modules/pyFTS/common/transformations/trend.html
vendored
Normal file
@ -0,0 +1,174 @@
|
||||
|
||||
|
||||
<!doctype html>
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>pyFTS.common.transformations.trend — pyFTS 1.7 documentation</title>
|
||||
<link rel="stylesheet" type="text/css" href="../../../../_static/pygments.css" />
|
||||
<link rel="stylesheet" type="text/css" href="../../../../_static/bizstyle.css" />
|
||||
|
||||
<script data-url_root="../../../../" id="documentation_options" src="../../../../_static/documentation_options.js"></script>
|
||||
<script src="../../../../_static/jquery.js"></script>
|
||||
<script src="../../../../_static/underscore.js"></script>
|
||||
<script src="../../../../_static/doctools.js"></script>
|
||||
<script src="../../../../_static/bizstyle.js"></script>
|
||||
<link rel="index" title="Index" href="../../../../genindex.html" />
|
||||
<link rel="search" title="Search" href="../../../../search.html" />
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1.0" />
|
||||
<!--[if lt IE 9]>
|
||||
<script src="_static/css3-mediaqueries.js"></script>
|
||||
<![endif]-->
|
||||
</head><body>
|
||||
<div class="related" role="navigation" aria-label="related navigation">
|
||||
<h3>Navigation</h3>
|
||||
<ul>
|
||||
<li class="right" style="margin-right: 10px">
|
||||
<a href="../../../../genindex.html" title="General Index"
|
||||
accesskey="I">index</a></li>
|
||||
<li class="right" >
|
||||
<a href="../../../../py-modindex.html" title="Python Module Index"
|
||||
>modules</a> |</li>
|
||||
<li class="nav-item nav-item-0"><a href="../../../../index.html">pyFTS 1.7 documentation</a> »</li>
|
||||
<li class="nav-item nav-item-1"><a href="../../../index.html" accesskey="U">Module code</a> »</li>
|
||||
<li class="nav-item nav-item-this"><a href="">pyFTS.common.transformations.trend</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="document">
|
||||
<div class="documentwrapper">
|
||||
<div class="bodywrapper">
|
||||
<div class="body" role="main">
|
||||
|
||||
<h1>Source code for pyFTS.common.transformations.trend</h1><div class="highlight"><pre>
|
||||
<span></span><span class="kn">from</span> <span class="nn">pyFTS.common.transformations.transformation</span> <span class="k">import</span> <span class="n">Transformation</span>
|
||||
<span class="kn">from</span> <span class="nn">pandas</span> <span class="k">import</span> <span class="n">datetime</span>
|
||||
<span class="kn">from</span> <span class="nn">sklearn.linear_model</span> <span class="k">import</span> <span class="n">LinearRegression</span>
|
||||
<span class="kn">import</span> <span class="nn">numpy</span> <span class="k">as</span> <span class="nn">np</span>
|
||||
<span class="kn">import</span> <span class="nn">pandas</span> <span class="k">as</span> <span class="nn">pd</span>
|
||||
|
||||
|
||||
<div class="viewcode-block" id="LinearTrend"><a class="viewcode-back" href="../../../../pyFTS.common.transformations.html#pyFTS.common.transformations.trend.LinearTrend">[docs]</a><span class="k">class</span> <span class="nc">LinearTrend</span><span class="p">(</span><span class="n">Transformation</span><span class="p">):</span>
|
||||
<span class="sd">"""</span>
|
||||
<span class="sd"> Linear Trend. Estimate</span>
|
||||
|
||||
<span class="sd"> y'(t) = y(t) - (a*t+b)</span>
|
||||
<span class="sd"> y(t) = y'(t) + (a*t+b)</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="nb">super</span><span class="p">(</span><span class="n">LinearTrend</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="bp">self</span><span class="o">.</span><span class="n">name</span> <span class="o">=</span> <span class="s1">'LinearTrend'</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">index_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">'index_type'</span><span class="p">,</span><span class="s1">'linear'</span><span class="p">)</span>
|
||||
<span class="sd">'''The type of the time index used to train the regression coefficients. Available types are: field, datetime'''</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">index_field</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">'index_field'</span><span class="p">,</span> <span class="kc">None</span><span class="p">)</span>
|
||||
<span class="sd">'''The Pandas Dataframe column to use as index'''</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">data_field</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_field'</span><span class="p">,</span> <span class="kc">None</span><span class="p">)</span>
|
||||
<span class="sd">'''The Pandas Dataframe column to use as data'''</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">datetime_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">'datetime_mask'</span><span class="p">,</span> <span class="kc">None</span><span class="p">)</span>
|
||||
<span class="sd">'''The Pandas Dataframe mask for datetime indexes '''</span>
|
||||
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">model</span> <span class="o">=</span> <span class="kc">None</span>
|
||||
<span class="sd">'''Regression model'''</span>
|
||||
|
||||
<div class="viewcode-block" id="LinearTrend.train"><a class="viewcode-back" href="../../../../pyFTS.common.transformations.html#pyFTS.common.transformations.trend.LinearTrend.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="n">x</span> <span class="o">=</span> <span class="n">data</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">index_field</span><span class="p">]</span><span class="o">.</span><span class="n">values</span>
|
||||
|
||||
<span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">index_type</span> <span class="o">==</span> <span class="s1">'datetime'</span><span class="p">:</span>
|
||||
<span class="n">x</span> <span class="o">=</span> <span class="n">pd</span><span class="o">.</span><span class="n">to_numeric</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="n">downcast</span><span class="o">=</span><span class="s1">'integer'</span><span class="p">)</span>
|
||||
|
||||
<span class="n">indexes</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">reshape</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="p">(</span><span class="nb">len</span><span class="p">(</span><span class="n">x</span><span class="p">),</span> <span class="mi">1</span><span class="p">))</span>
|
||||
<span class="n">values</span> <span class="o">=</span> <span class="n">data</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">data_field</span><span class="p">]</span><span class="o">.</span><span class="n">values</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">model</span> <span class="o">=</span> <span class="n">LinearRegression</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">fit</span><span class="p">(</span><span class="n">indexes</span><span class="p">,</span> <span class="n">values</span><span class="p">)</span></div>
|
||||
|
||||
<div class="viewcode-block" id="LinearTrend.trend"><a class="viewcode-back" href="../../../../pyFTS.common.transformations.html#pyFTS.common.transformations.trend.LinearTrend.trend">[docs]</a> <span class="k">def</span> <span class="nf">trend</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">x</span> <span class="o">=</span> <span class="n">data</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">index_field</span><span class="p">]</span><span class="o">.</span><span class="n">values</span>
|
||||
<span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">index_type</span> <span class="o">==</span> <span class="s1">'datetime'</span><span class="p">:</span>
|
||||
<span class="n">x</span> <span class="o">=</span> <span class="n">pd</span><span class="o">.</span><span class="n">to_numeric</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="n">downcast</span><span class="o">=</span><span class="s1">'integer'</span><span class="p">)</span>
|
||||
<span class="n">indexes</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">reshape</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="p">(</span><span class="nb">len</span><span class="p">(</span><span class="n">x</span><span class="p">),</span> <span class="mi">1</span><span class="p">))</span>
|
||||
<span class="n">_trend</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">predict</span><span class="p">(</span><span class="n">indexes</span><span class="p">)</span>
|
||||
<span class="k">return</span> <span class="n">_trend</span></div>
|
||||
|
||||
<div class="viewcode-block" id="LinearTrend.apply"><a class="viewcode-back" href="../../../../pyFTS.common.transformations.html#pyFTS.common.transformations.trend.LinearTrend.apply">[docs]</a> <span class="k">def</span> <span class="nf">apply</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">param</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
|
||||
<span class="n">values</span> <span class="o">=</span> <span class="n">data</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">data_field</span><span class="p">]</span><span class="o">.</span><span class="n">values</span>
|
||||
<span class="n">_trend</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">trend</span><span class="p">(</span><span class="n">data</span><span class="p">)</span>
|
||||
<span class="n">modified</span> <span class="o">=</span> <span class="n">values</span> <span class="o">-</span> <span class="n">_trend</span>
|
||||
<span class="k">return</span> <span class="n">modified</span></div>
|
||||
|
||||
<div class="viewcode-block" id="LinearTrend.inverse"><a class="viewcode-back" href="../../../../pyFTS.common.transformations.html#pyFTS.common.transformations.trend.LinearTrend.inverse">[docs]</a> <span class="k">def</span> <span class="nf">inverse</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">param</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
|
||||
<span class="n">x</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">generate_indexes</span><span class="p">(</span><span class="n">data</span><span class="p">,</span> <span class="n">param</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">index_field</span><span class="p">]</span><span class="o">.</span><span class="n">values</span><span class="p">[</span><span class="mi">0</span><span class="p">],</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">)</span>
|
||||
<span class="n">indexes</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">reshape</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="p">(</span><span class="nb">len</span><span class="p">(</span><span class="n">x</span><span class="p">),</span> <span class="mi">1</span><span class="p">))</span>
|
||||
<span class="n">_trend</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">predict</span><span class="p">(</span><span class="n">indexes</span><span class="p">)</span>
|
||||
<span class="n">modified</span> <span class="o">=</span> <span class="n">data</span> <span class="o">+</span> <span class="n">_trend</span>
|
||||
<span class="k">return</span> <span class="n">modified</span></div>
|
||||
|
||||
<div class="viewcode-block" id="LinearTrend.increment"><a class="viewcode-back" href="../../../../pyFTS.common.transformations.html#pyFTS.common.transformations.trend.LinearTrend.increment">[docs]</a> <span class="k">def</span> <span class="nf">increment</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span><span class="n">value</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">index_type</span> <span class="o">==</span> <span class="s1">'linear'</span><span class="p">:</span>
|
||||
<span class="k">return</span> <span class="n">value</span> <span class="o">+</span> <span class="mi">1</span>
|
||||
<span class="k">elif</span> <span class="bp">self</span><span class="o">.</span><span class="n">index_type</span> <span class="o">==</span> <span class="s1">'datetime'</span><span class="p">:</span>
|
||||
<span class="k">if</span> <span class="s1">'date_offset'</span> <span class="ow">not</span> <span class="ow">in</span> <span class="n">kwargs</span><span class="p">:</span>
|
||||
<span class="k">raise</span> <span class="ne">Exception</span><span class="p">(</span><span class="s1">'A pandas.DateOffset must be passed in the parameter ''date_offset'''</span><span class="p">)</span>
|
||||
<span class="n">doff</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">'date_offset'</span><span class="p">)</span>
|
||||
<span class="k">return</span> <span class="n">value</span> <span class="o">+</span> <span class="n">doff</span></div>
|
||||
|
||||
<div class="viewcode-block" id="LinearTrend.generate_indexes"><a class="viewcode-back" href="../../../../pyFTS.common.transformations.html#pyFTS.common.transformations.trend.LinearTrend.generate_indexes">[docs]</a> <span class="k">def</span> <span class="nf">generate_indexes</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">value</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">index_type</span> <span class="o">==</span> <span class="s1">'datetime'</span><span class="p">:</span>
|
||||
<span class="n">ret</span> <span class="o">=</span> <span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">increment</span><span class="p">(</span><span class="n">pd</span><span class="o">.</span><span class="n">to_datetime</span><span class="p">(</span><span class="n">value</span><span class="p">,</span> <span class="nb">format</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">datetime_mask</span><span class="p">),</span> <span class="o">**</span><span class="n">kwargs</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="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">increment</span><span class="p">(</span><span class="n">value</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">)]</span>
|
||||
<span class="k">for</span> <span class="n">i</span> <span class="ow">in</span> <span class="n">np</span><span class="o">.</span><span class="n">arange</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span><span class="nb">len</span><span class="p">(</span><span class="n">data</span><span class="p">)):</span>
|
||||
<span class="n">ret</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">increment</span><span class="p">(</span><span class="n">ret</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">kwargs</span><span class="p">))</span>
|
||||
|
||||
<span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">index_type</span> <span class="o">==</span> <span class="s1">'datetime'</span><span class="p">:</span>
|
||||
<span class="n">ret</span> <span class="o">=</span> <span class="n">pd</span><span class="o">.</span><span class="n">Series</span><span class="p">(</span><span class="n">ret</span><span class="p">)</span>
|
||||
<span class="n">ret</span> <span class="o">=</span> <span class="n">pd</span><span class="o">.</span><span class="n">to_numeric</span><span class="p">(</span><span class="n">ret</span><span class="p">,</span> <span class="n">downcast</span><span class="o">=</span><span class="s1">'integer'</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">ret</span><span class="p">)</span></div></div>
|
||||
</pre></div>
|
||||
|
||||
<div class="clearer"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
|
||||
<div class="sphinxsidebarwrapper">
|
||||
<p class="logo"><a href="../../../../index.html">
|
||||
<img class="logo" src="../../../../_static/logo_heading2.png" alt="Logo"/>
|
||||
</a></p>
|
||||
<div id="searchbox" style="display: none" role="search">
|
||||
<h3 id="searchlabel">Quick search</h3>
|
||||
<div class="searchformwrapper">
|
||||
<form class="search" action="../../../../search.html" method="get">
|
||||
<input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
|
||||
<input type="submit" value="Go" />
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<script>$('#searchbox').show(0);</script>
|
||||
</div>
|
||||
</div>
|
||||
<div class="clearer"></div>
|
||||
</div>
|
||||
<div class="related" role="navigation" aria-label="related navigation">
|
||||
<h3>Navigation</h3>
|
||||
<ul>
|
||||
<li class="right" style="margin-right: 10px">
|
||||
<a href="../../../../genindex.html" title="General Index"
|
||||
>index</a></li>
|
||||
<li class="right" >
|
||||
<a href="../../../../py-modindex.html" title="Python Module Index"
|
||||
>modules</a> |</li>
|
||||
<li class="nav-item nav-item-0"><a href="../../../../index.html">pyFTS 1.7 documentation</a> »</li>
|
||||
<li class="nav-item nav-item-1"><a href="../../../index.html" >Module code</a> »</li>
|
||||
<li class="nav-item nav-item-this"><a href="">pyFTS.common.transformations.trend</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="footer" role="contentinfo">
|
||||
© Copyright 2022, Machine Intelligence and Data Science Laboratory - UFMG - Brazil.
|
||||
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 4.5.0.
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
16
docs/build/html/_modules/pyFTS/common/tree.html
vendored
16
docs/build/html/_modules/pyFTS/common/tree.html
vendored
@ -47,17 +47,17 @@
|
||||
<span class="sd">Tree data structure</span>
|
||||
<span class="sd">"""</span>
|
||||
|
||||
<span class="kn">from</span> <span class="nn">pyFTS</span> <span class="k">import</span> <span class="o">*</span>
|
||||
<span class="kn">from</span> <span class="nn">functools</span> <span class="k">import</span> <span class="n">reduce</span>
|
||||
<span class="kn">from</span> <span class="nn">pyFTS</span> <span class="kn">import</span> <span class="o">*</span>
|
||||
<span class="kn">from</span> <span class="nn">functools</span> <span class="kn">import</span> <span class="n">reduce</span>
|
||||
<span class="kn">import</span> <span class="nn">numpy</span> <span class="k">as</span> <span class="nn">np</span>
|
||||
|
||||
|
||||
<div class="viewcode-block" id="FLRGTreeNode"><a class="viewcode-back" href="../../../pyFTS.common.html#pyFTS.common.tree.FLRGTreeNode">[docs]</a><span class="k">class</span> <span class="nc">FLRGTreeNode</span><span class="p">:</span>
|
||||
<span class="sd">"""</span>
|
||||
<span class="w"> </span><span class="sd">"""</span>
|
||||
<span class="sd"> Tree node for</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">value</span><span class="p">):</span>
|
||||
<span class="k">def</span> <span class="fm">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">value</span><span class="p">):</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">isRoot</span> <span class="o">=</span> <span class="kc">False</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">children</span> <span class="o">=</span> <span class="p">[]</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">value</span> <span class="o">=</span> <span class="n">value</span>
|
||||
@ -86,13 +86,13 @@
|
||||
<span class="n">tmp</span> <span class="o">=</span> <span class="n">tmp</span> <span class="o">+</span> <span class="s2">"</span><span class="se">\n</span><span class="s2">"</span> <span class="o">+</span> <span class="n">child</span><span class="o">.</span><span class="n">getStr</span><span class="p">(</span><span class="n">k</span> <span class="o">+</span> <span class="mi">1</span><span class="p">)</span>
|
||||
<span class="k">return</span> <span class="n">tmp</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="fm">__str__</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
|
||||
<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">getStr</span><span class="p">(</span><span class="mi">0</span><span class="p">)</span></div>
|
||||
|
||||
|
||||
<div class="viewcode-block" id="FLRGTree"><a class="viewcode-back" href="../../../pyFTS.common.html#pyFTS.common.tree.FLRGTree">[docs]</a><span class="k">class</span> <span class="nc">FLRGTree</span><span class="p">:</span>
|
||||
<span class="sd">"""Represents a FLRG set with a tree structure"""</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="w"> </span><span class="sd">"""Represents a FLRG set with a tree structure"""</span>
|
||||
<span class="k">def</span> <span class="fm">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">root</span> <span class="o">=</span> <span class="n">FLRGTreeNode</span><span class="p">(</span><span class="kc">None</span><span class="p">)</span></div>
|
||||
|
||||
|
||||
@ -154,7 +154,7 @@
|
||||
</div>
|
||||
<div class="footer" role="contentinfo">
|
||||
© Copyright 2022, Machine Intelligence and Data Science Laboratory - UFMG - Brazil.
|
||||
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 4.5.0.
|
||||
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 4.3.2.
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
@ -49,13 +49,13 @@
|
||||
<span class="sd">Source: Hyndman, R.J., Time Series Data Library, http://www-personal.buseco.monash.edu.au/~hyndman/TSDL/.</span>
|
||||
<span class="sd">"""</span>
|
||||
|
||||
<span class="kn">from</span> <span class="nn">pyFTS.data</span> <span class="k">import</span> <span class="n">common</span>
|
||||
<span class="kn">from</span> <span class="nn">pyFTS.data</span> <span class="kn">import</span> <span class="n">common</span>
|
||||
<span class="kn">import</span> <span class="nn">pandas</span> <span class="k">as</span> <span class="nn">pd</span>
|
||||
<span class="kn">import</span> <span class="nn">numpy</span> <span class="k">as</span> <span class="nn">np</span>
|
||||
|
||||
|
||||
<div class="viewcode-block" id="get_data"><a class="viewcode-back" href="../../../pyFTS.data.html#pyFTS.data.AirPassengers.get_data">[docs]</a><span class="k">def</span> <span class="nf">get_data</span><span class="p">()</span> <span class="o">-></span> <span class="n">np</span><span class="o">.</span><span class="n">ndarray</span><span class="p">:</span>
|
||||
<span class="sd">"""</span>
|
||||
<span class="w"> </span><span class="sd">"""</span>
|
||||
<span class="sd"> Get a simple univariate time series data.</span>
|
||||
|
||||
<span class="sd"> :return: numpy array</span>
|
||||
@ -65,7 +65,7 @@
|
||||
<span class="k">return</span> <span class="n">dat</span></div>
|
||||
|
||||
<div class="viewcode-block" id="get_dataframe"><a class="viewcode-back" href="../../../pyFTS.data.html#pyFTS.data.AirPassengers.get_dataframe">[docs]</a><span class="k">def</span> <span class="nf">get_dataframe</span><span class="p">()</span> <span class="o">-></span> <span class="n">pd</span><span class="o">.</span><span class="n">DataFrame</span><span class="p">:</span>
|
||||
<span class="sd">"""</span>
|
||||
<span class="w"> </span><span class="sd">"""</span>
|
||||
<span class="sd"> Get the complete multivariate time series data.</span>
|
||||
|
||||
<span class="sd"> :return: Pandas DataFrame</span>
|
||||
@ -113,7 +113,7 @@
|
||||
</div>
|
||||
<div class="footer" role="contentinfo">
|
||||
© Copyright 2022, Machine Intelligence and Data Science Laboratory - UFMG - Brazil.
|
||||
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 4.5.0.
|
||||
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 4.3.2.
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
@ -52,13 +52,13 @@
|
||||
<span class="sd">"""</span>
|
||||
|
||||
|
||||
<span class="kn">from</span> <span class="nn">pyFTS.data</span> <span class="k">import</span> <span class="n">common</span>
|
||||
<span class="kn">from</span> <span class="nn">pyFTS.data</span> <span class="kn">import</span> <span class="n">common</span>
|
||||
<span class="kn">import</span> <span class="nn">pandas</span> <span class="k">as</span> <span class="nn">pd</span>
|
||||
<span class="kn">import</span> <span class="nn">numpy</span> <span class="k">as</span> <span class="nn">np</span>
|
||||
|
||||
|
||||
<div class="viewcode-block" id="get_data"><a class="viewcode-back" href="../../../pyFTS.data.html#pyFTS.data.Bitcoin.get_data">[docs]</a><span class="k">def</span> <span class="nf">get_data</span><span class="p">(</span><span class="n">field</span><span class="p">:</span><span class="nb">str</span><span class="o">=</span><span class="s1">'AVG'</span><span class="p">)</span> <span class="o">-></span> <span class="n">np</span><span class="o">.</span><span class="n">ndarray</span><span class="p">:</span>
|
||||
<span class="sd">"""</span>
|
||||
<span class="w"> </span><span class="sd">"""</span>
|
||||
<span class="sd"> Get the univariate time series data.</span>
|
||||
|
||||
<span class="sd"> :param field: dataset field to load</span>
|
||||
@ -69,7 +69,7 @@
|
||||
|
||||
|
||||
<div class="viewcode-block" id="get_dataframe"><a class="viewcode-back" href="../../../pyFTS.data.html#pyFTS.data.Bitcoin.get_dataframe">[docs]</a><span class="k">def</span> <span class="nf">get_dataframe</span><span class="p">()</span> <span class="o">-></span> <span class="n">pd</span><span class="o">.</span><span class="n">DataFrame</span><span class="p">:</span>
|
||||
<span class="sd">"""</span>
|
||||
<span class="w"> </span><span class="sd">"""</span>
|
||||
<span class="sd"> Get the complete multivariate time series data.</span>
|
||||
|
||||
<span class="sd"> :return: Pandas DataFrame</span>
|
||||
@ -117,7 +117,7 @@
|
||||
</div>
|
||||
<div class="footer" role="contentinfo">
|
||||
© Copyright 2022, Machine Intelligence and Data Science Laboratory - UFMG - Brazil.
|
||||
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 4.5.0.
|
||||
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 4.3.2.
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
@ -52,13 +52,13 @@
|
||||
<span class="sd">"""</span>
|
||||
|
||||
|
||||
<span class="kn">from</span> <span class="nn">pyFTS.data</span> <span class="k">import</span> <span class="n">common</span>
|
||||
<span class="kn">from</span> <span class="nn">pyFTS.data</span> <span class="kn">import</span> <span class="n">common</span>
|
||||
<span class="kn">import</span> <span class="nn">pandas</span> <span class="k">as</span> <span class="nn">pd</span>
|
||||
<span class="kn">import</span> <span class="nn">numpy</span> <span class="k">as</span> <span class="nn">np</span>
|
||||
|
||||
|
||||
<div class="viewcode-block" id="get_data"><a class="viewcode-back" href="../../../pyFTS.data.html#pyFTS.data.DowJones.get_data">[docs]</a><span class="k">def</span> <span class="nf">get_data</span><span class="p">(</span><span class="n">field</span><span class="p">:</span><span class="nb">str</span><span class="o">=</span><span class="s1">'AVG'</span><span class="p">)</span> <span class="o">-></span> <span class="n">np</span><span class="o">.</span><span class="n">ndarray</span><span class="p">:</span>
|
||||
<span class="sd">"""</span>
|
||||
<span class="w"> </span><span class="sd">"""</span>
|
||||
<span class="sd"> Get the univariate time series data.</span>
|
||||
|
||||
<span class="sd"> :param field: dataset field to load</span>
|
||||
@ -69,7 +69,7 @@
|
||||
|
||||
|
||||
<div class="viewcode-block" id="get_dataframe"><a class="viewcode-back" href="../../../pyFTS.data.html#pyFTS.data.DowJones.get_dataframe">[docs]</a><span class="k">def</span> <span class="nf">get_dataframe</span><span class="p">()</span> <span class="o">-></span> <span class="n">pd</span><span class="o">.</span><span class="n">DataFrame</span><span class="p">:</span>
|
||||
<span class="sd">"""</span>
|
||||
<span class="w"> </span><span class="sd">"""</span>
|
||||
<span class="sd"> Get the complete multivariate time series data.</span>
|
||||
|
||||
<span class="sd"> :return: Pandas DataFrame</span>
|
||||
@ -117,7 +117,7 @@
|
||||
</div>
|
||||
<div class="footer" role="contentinfo">
|
||||
© Copyright 2022, Machine Intelligence and Data Science Laboratory - UFMG - Brazil.
|
||||
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 4.5.0.
|
||||
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 4.3.2.
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
@ -50,13 +50,13 @@
|
||||
<span class="sd">"""</span>
|
||||
|
||||
|
||||
<span class="kn">from</span> <span class="nn">pyFTS.data</span> <span class="k">import</span> <span class="n">common</span>
|
||||
<span class="kn">from</span> <span class="nn">pyFTS.data</span> <span class="kn">import</span> <span class="n">common</span>
|
||||
<span class="kn">import</span> <span class="nn">pandas</span> <span class="k">as</span> <span class="nn">pd</span>
|
||||
<span class="kn">import</span> <span class="nn">numpy</span> <span class="k">as</span> <span class="nn">np</span>
|
||||
|
||||
|
||||
<div class="viewcode-block" id="get_data"><a class="viewcode-back" href="../../../pyFTS.data.html#pyFTS.data.EURGBP.get_data">[docs]</a><span class="k">def</span> <span class="nf">get_data</span><span class="p">(</span><span class="n">field</span><span class="p">:</span><span class="nb">str</span><span class="o">=</span><span class="s1">'avg'</span><span class="p">)</span> <span class="o">-></span> <span class="n">np</span><span class="o">.</span><span class="n">ndarray</span><span class="p">:</span>
|
||||
<span class="sd">"""</span>
|
||||
<span class="w"> </span><span class="sd">"""</span>
|
||||
<span class="sd"> Get the univariate time series data.</span>
|
||||
|
||||
<span class="sd"> :param field: dataset field to load</span>
|
||||
@ -67,7 +67,7 @@
|
||||
|
||||
|
||||
<div class="viewcode-block" id="get_dataframe"><a class="viewcode-back" href="../../../pyFTS.data.html#pyFTS.data.EURGBP.get_dataframe">[docs]</a><span class="k">def</span> <span class="nf">get_dataframe</span><span class="p">()</span> <span class="o">-></span> <span class="n">pd</span><span class="o">.</span><span class="n">DataFrame</span><span class="p">:</span>
|
||||
<span class="sd">"""</span>
|
||||
<span class="w"> </span><span class="sd">"""</span>
|
||||
<span class="sd"> Get the complete multivariate time series data.</span>
|
||||
|
||||
<span class="sd"> :return: Pandas DataFrame</span>
|
||||
@ -115,7 +115,7 @@
|
||||
</div>
|
||||
<div class="footer" role="contentinfo">
|
||||
© Copyright 2022, Machine Intelligence and Data Science Laboratory - UFMG - Brazil.
|
||||
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 4.5.0.
|
||||
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 4.3.2.
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
@ -50,13 +50,13 @@
|
||||
<span class="sd">"""</span>
|
||||
|
||||
|
||||
<span class="kn">from</span> <span class="nn">pyFTS.data</span> <span class="k">import</span> <span class="n">common</span>
|
||||
<span class="kn">from</span> <span class="nn">pyFTS.data</span> <span class="kn">import</span> <span class="n">common</span>
|
||||
<span class="kn">import</span> <span class="nn">pandas</span> <span class="k">as</span> <span class="nn">pd</span>
|
||||
<span class="kn">import</span> <span class="nn">numpy</span> <span class="k">as</span> <span class="nn">np</span>
|
||||
|
||||
|
||||
<div class="viewcode-block" id="get_data"><a class="viewcode-back" href="../../../pyFTS.data.html#pyFTS.data.EURUSD.get_data">[docs]</a><span class="k">def</span> <span class="nf">get_data</span><span class="p">(</span><span class="n">field</span><span class="p">:</span> <span class="nb">str</span><span class="o">=</span><span class="s1">'avg'</span><span class="p">)</span> <span class="o">-></span> <span class="n">np</span><span class="o">.</span><span class="n">ndarray</span><span class="p">:</span>
|
||||
<span class="sd">"""</span>
|
||||
<span class="w"> </span><span class="sd">"""</span>
|
||||
<span class="sd"> Get the univariate time series data.</span>
|
||||
|
||||
<span class="sd"> :param field: dataset field to load</span>
|
||||
@ -67,7 +67,7 @@
|
||||
|
||||
|
||||
<div class="viewcode-block" id="get_dataframe"><a class="viewcode-back" href="../../../pyFTS.data.html#pyFTS.data.EURUSD.get_dataframe">[docs]</a><span class="k">def</span> <span class="nf">get_dataframe</span><span class="p">()</span> <span class="o">-></span> <span class="n">pd</span><span class="o">.</span><span class="n">DataFrame</span><span class="p">:</span>
|
||||
<span class="sd">"""</span>
|
||||
<span class="w"> </span><span class="sd">"""</span>
|
||||
<span class="sd"> Get the complete multivariate time series data.</span>
|
||||
|
||||
<span class="sd"> :return: Pandas DataFrame</span>
|
||||
@ -115,7 +115,7 @@
|
||||
</div>
|
||||
<div class="footer" role="contentinfo">
|
||||
© Copyright 2022, Machine Intelligence and Data Science Laboratory - UFMG - Brazil.
|
||||
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 4.5.0.
|
||||
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 4.3.2.
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
@ -47,13 +47,13 @@
|
||||
<span class="sd">Yearly University of Alabama enrollments from 1971 to 1992.</span>
|
||||
<span class="sd">"""</span>
|
||||
|
||||
<span class="kn">from</span> <span class="nn">pyFTS.data</span> <span class="k">import</span> <span class="n">common</span>
|
||||
<span class="kn">from</span> <span class="nn">pyFTS.data</span> <span class="kn">import</span> <span class="n">common</span>
|
||||
<span class="kn">import</span> <span class="nn">pandas</span> <span class="k">as</span> <span class="nn">pd</span>
|
||||
<span class="kn">import</span> <span class="nn">numpy</span> <span class="k">as</span> <span class="nn">np</span>
|
||||
|
||||
|
||||
<div class="viewcode-block" id="get_data"><a class="viewcode-back" href="../../../pyFTS.data.html#pyFTS.data.Enrollments.get_data">[docs]</a><span class="k">def</span> <span class="nf">get_data</span><span class="p">()</span> <span class="o">-></span> <span class="n">np</span><span class="o">.</span><span class="n">ndarray</span><span class="p">:</span>
|
||||
<span class="sd">"""</span>
|
||||
<span class="w"> </span><span class="sd">"""</span>
|
||||
<span class="sd"> Get a simple univariate time series data.</span>
|
||||
|
||||
<span class="sd"> :return: numpy array</span>
|
||||
@ -106,7 +106,7 @@
|
||||
</div>
|
||||
<div class="footer" role="contentinfo">
|
||||
© Copyright 2022, Machine Intelligence and Data Science Laboratory - UFMG - Brazil.
|
||||
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 4.5.0.
|
||||
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 4.3.2.
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
@ -52,13 +52,13 @@
|
||||
<span class="sd">"""</span>
|
||||
|
||||
|
||||
<span class="kn">from</span> <span class="nn">pyFTS.data</span> <span class="k">import</span> <span class="n">common</span>
|
||||
<span class="kn">from</span> <span class="nn">pyFTS.data</span> <span class="kn">import</span> <span class="n">common</span>
|
||||
<span class="kn">import</span> <span class="nn">pandas</span> <span class="k">as</span> <span class="nn">pd</span>
|
||||
<span class="kn">import</span> <span class="nn">numpy</span> <span class="k">as</span> <span class="nn">np</span>
|
||||
|
||||
|
||||
<div class="viewcode-block" id="get_data"><a class="viewcode-back" href="../../../pyFTS.data.html#pyFTS.data.Ethereum.get_data">[docs]</a><span class="k">def</span> <span class="nf">get_data</span><span class="p">(</span><span class="n">field</span><span class="p">:</span> <span class="nb">str</span><span class="o">=</span><span class="s1">'AVG'</span><span class="p">)</span> <span class="o">-></span> <span class="n">np</span><span class="o">.</span><span class="n">ndarray</span><span class="p">:</span>
|
||||
<span class="sd">"""</span>
|
||||
<span class="w"> </span><span class="sd">"""</span>
|
||||
<span class="sd"> Get the univariate time series data.</span>
|
||||
|
||||
<span class="sd"> :param field: dataset field to load</span>
|
||||
@ -69,7 +69,7 @@
|
||||
|
||||
|
||||
<div class="viewcode-block" id="get_dataframe"><a class="viewcode-back" href="../../../pyFTS.data.html#pyFTS.data.Ethereum.get_dataframe">[docs]</a><span class="k">def</span> <span class="nf">get_dataframe</span><span class="p">()</span> <span class="o">-></span> <span class="n">pd</span><span class="o">.</span><span class="n">DataFrame</span><span class="p">:</span>
|
||||
<span class="sd">"""</span>
|
||||
<span class="w"> </span><span class="sd">"""</span>
|
||||
<span class="sd"> Get the complete multivariate time series data.</span>
|
||||
|
||||
<span class="sd"> :return: Pandas DataFrame</span>
|
||||
@ -117,7 +117,7 @@
|
||||
</div>
|
||||
<div class="footer" role="contentinfo">
|
||||
© Copyright 2022, Machine Intelligence and Data Science Laboratory - UFMG - Brazil.
|
||||
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 4.5.0.
|
||||
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 4.3.2.
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
@ -50,13 +50,13 @@
|
||||
<span class="sd">"""</span>
|
||||
|
||||
|
||||
<span class="kn">from</span> <span class="nn">pyFTS.data</span> <span class="k">import</span> <span class="n">common</span>
|
||||
<span class="kn">from</span> <span class="nn">pyFTS.data</span> <span class="kn">import</span> <span class="n">common</span>
|
||||
<span class="kn">import</span> <span class="nn">pandas</span> <span class="k">as</span> <span class="nn">pd</span>
|
||||
<span class="kn">import</span> <span class="nn">numpy</span> <span class="k">as</span> <span class="nn">np</span>
|
||||
|
||||
|
||||
<div class="viewcode-block" id="get_data"><a class="viewcode-back" href="../../../pyFTS.data.html#pyFTS.data.GBPUSD.get_data">[docs]</a><span class="k">def</span> <span class="nf">get_data</span><span class="p">(</span><span class="n">field</span><span class="p">:</span> <span class="nb">str</span><span class="o">=</span><span class="s1">'avg'</span><span class="p">)</span> <span class="o">-></span> <span class="n">np</span><span class="o">.</span><span class="n">ndarray</span><span class="p">:</span>
|
||||
<span class="sd">"""</span>
|
||||
<span class="w"> </span><span class="sd">"""</span>
|
||||
<span class="sd"> Get the univariate time series data.</span>
|
||||
|
||||
<span class="sd"> :param field: dataset field to load</span>
|
||||
@ -67,7 +67,7 @@
|
||||
|
||||
|
||||
<div class="viewcode-block" id="get_dataframe"><a class="viewcode-back" href="../../../pyFTS.data.html#pyFTS.data.GBPUSD.get_dataframe">[docs]</a><span class="k">def</span> <span class="nf">get_dataframe</span><span class="p">()</span> <span class="o">-></span> <span class="n">pd</span><span class="o">.</span><span class="n">DataFrame</span><span class="p">:</span>
|
||||
<span class="sd">"""</span>
|
||||
<span class="w"> </span><span class="sd">"""</span>
|
||||
<span class="sd"> Get the complete multivariate time series data.</span>
|
||||
|
||||
<span class="sd"> :return: Pandas DataFrame</span>
|
||||
@ -115,7 +115,7 @@
|
||||
</div>
|
||||
<div class="footer" role="contentinfo">
|
||||
© Copyright 2022, Machine Intelligence and Data Science Laboratory - UFMG - Brazil.
|
||||
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 4.5.0.
|
||||
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 4.3.2.
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
@ -51,12 +51,12 @@
|
||||
<span class="sd">Source: http://www.inmet.gov.br</span>
|
||||
<span class="sd">"""</span>
|
||||
|
||||
<span class="kn">from</span> <span class="nn">pyFTS.data</span> <span class="k">import</span> <span class="n">common</span>
|
||||
<span class="kn">from</span> <span class="nn">pyFTS.data</span> <span class="kn">import</span> <span class="n">common</span>
|
||||
<span class="kn">import</span> <span class="nn">pandas</span> <span class="k">as</span> <span class="nn">pd</span>
|
||||
|
||||
|
||||
<div class="viewcode-block" id="get_dataframe"><a class="viewcode-back" href="../../../pyFTS.data.html#pyFTS.data.INMET.get_dataframe">[docs]</a><span class="k">def</span> <span class="nf">get_dataframe</span><span class="p">()</span> <span class="o">-></span> <span class="n">pd</span><span class="o">.</span><span class="n">DataFrame</span><span class="p">:</span>
|
||||
<span class="sd">"""</span>
|
||||
<span class="w"> </span><span class="sd">"""</span>
|
||||
<span class="sd"> Get the complete multivariate time series data.</span>
|
||||
|
||||
<span class="sd"> :return: Pandas DataFrame</span>
|
||||
@ -104,7 +104,7 @@
|
||||
</div>
|
||||
<div class="footer" role="contentinfo">
|
||||
© Copyright 2022, Machine Intelligence and Data Science Laboratory - UFMG - Brazil.
|
||||
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 4.5.0.
|
||||
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 4.3.2.
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
@ -48,13 +48,13 @@
|
||||
<span class="sd">"""</span>
|
||||
|
||||
|
||||
<span class="kn">from</span> <span class="nn">pyFTS.data</span> <span class="k">import</span> <span class="n">common</span>
|
||||
<span class="kn">from</span> <span class="nn">pyFTS.data</span> <span class="kn">import</span> <span class="n">common</span>
|
||||
<span class="kn">import</span> <span class="nn">pandas</span> <span class="k">as</span> <span class="nn">pd</span>
|
||||
<span class="kn">import</span> <span class="nn">numpy</span> <span class="k">as</span> <span class="nn">np</span>
|
||||
|
||||
|
||||
<div class="viewcode-block" id="get_data"><a class="viewcode-back" href="../../../pyFTS.data.html#pyFTS.data.Malaysia.get_data">[docs]</a><span class="k">def</span> <span class="nf">get_data</span><span class="p">(</span><span class="n">field</span><span class="p">:</span> <span class="nb">str</span><span class="o">=</span><span class="s1">'load'</span><span class="p">)</span> <span class="o">-></span> <span class="n">np</span><span class="o">.</span><span class="n">ndarray</span><span class="p">:</span>
|
||||
<span class="sd">"""</span>
|
||||
<span class="w"> </span><span class="sd">"""</span>
|
||||
<span class="sd"> Get the univariate time series data.</span>
|
||||
|
||||
<span class="sd"> :param field: dataset field to load</span>
|
||||
@ -65,7 +65,7 @@
|
||||
|
||||
|
||||
<div class="viewcode-block" id="get_dataframe"><a class="viewcode-back" href="../../../pyFTS.data.html#pyFTS.data.Malaysia.get_dataframe">[docs]</a><span class="k">def</span> <span class="nf">get_dataframe</span><span class="p">()</span> <span class="o">-></span> <span class="n">pd</span><span class="o">.</span><span class="n">DataFrame</span><span class="p">:</span>
|
||||
<span class="sd">"""</span>
|
||||
<span class="w"> </span><span class="sd">"""</span>
|
||||
<span class="sd"> Get the complete multivariate time series data.</span>
|
||||
|
||||
<span class="sd"> :return: Pandas DataFrame</span>
|
||||
@ -114,7 +114,7 @@
|
||||
</div>
|
||||
<div class="footer" role="contentinfo">
|
||||
© Copyright 2022, Machine Intelligence and Data Science Laboratory - UFMG - Brazil.
|
||||
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 4.5.0.
|
||||
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 4.3.2.
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
@ -51,13 +51,13 @@
|
||||
<span class="sd">Source: http://www.nasdaq.com/aspx/flashquotes.aspx?symbol=IXIC&selected=IXIC</span>
|
||||
<span class="sd">"""</span>
|
||||
|
||||
<span class="kn">from</span> <span class="nn">pyFTS.data</span> <span class="k">import</span> <span class="n">common</span>
|
||||
<span class="kn">from</span> <span class="nn">pyFTS.data</span> <span class="kn">import</span> <span class="n">common</span>
|
||||
<span class="kn">import</span> <span class="nn">pandas</span> <span class="k">as</span> <span class="nn">pd</span>
|
||||
<span class="kn">import</span> <span class="nn">numpy</span> <span class="k">as</span> <span class="nn">np</span>
|
||||
|
||||
|
||||
<div class="viewcode-block" id="get_data"><a class="viewcode-back" href="../../../pyFTS.data.html#pyFTS.data.NASDAQ.get_data">[docs]</a><span class="k">def</span> <span class="nf">get_data</span><span class="p">(</span><span class="n">field</span><span class="p">:</span> <span class="nb">str</span><span class="o">=</span><span class="s2">"avg"</span><span class="p">)</span> <span class="o">-></span> <span class="n">np</span><span class="o">.</span><span class="n">ndarray</span><span class="p">:</span>
|
||||
<span class="sd">"""</span>
|
||||
<span class="w"> </span><span class="sd">"""</span>
|
||||
<span class="sd"> Get a simple univariate time series data.</span>
|
||||
|
||||
<span class="sd"> :param field: the dataset field name to extract</span>
|
||||
@ -69,7 +69,7 @@
|
||||
|
||||
|
||||
<div class="viewcode-block" id="get_dataframe"><a class="viewcode-back" href="../../../pyFTS.data.html#pyFTS.data.NASDAQ.get_dataframe">[docs]</a><span class="k">def</span> <span class="nf">get_dataframe</span><span class="p">()</span> <span class="o">-></span> <span class="n">pd</span><span class="o">.</span><span class="n">DataFrame</span><span class="p">:</span>
|
||||
<span class="sd">"""</span>
|
||||
<span class="w"> </span><span class="sd">"""</span>
|
||||
<span class="sd"> Get the complete multivariate time series data.</span>
|
||||
|
||||
<span class="sd"> :return: Pandas DataFrame</span>
|
||||
@ -117,7 +117,7 @@
|
||||
</div>
|
||||
<div class="footer" role="contentinfo">
|
||||
© Copyright 2022, Machine Intelligence and Data Science Laboratory - UFMG - Brazil.
|
||||
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 4.5.0.
|
||||
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 4.3.2.
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
@ -51,13 +51,13 @@
|
||||
<span class="sd">Source: http://sonda.ccst.inpe.br/</span>
|
||||
|
||||
<span class="sd">"""</span>
|
||||
<span class="kn">from</span> <span class="nn">pyFTS.data</span> <span class="k">import</span> <span class="n">common</span>
|
||||
<span class="kn">from</span> <span class="nn">pyFTS.data</span> <span class="kn">import</span> <span class="n">common</span>
|
||||
<span class="kn">import</span> <span class="nn">pandas</span> <span class="k">as</span> <span class="nn">pd</span>
|
||||
<span class="kn">import</span> <span class="nn">numpy</span> <span class="k">as</span> <span class="nn">np</span>
|
||||
|
||||
|
||||
<div class="viewcode-block" id="get_data"><a class="viewcode-back" href="../../../pyFTS.data.html#pyFTS.data.SONDA.get_data">[docs]</a><span class="k">def</span> <span class="nf">get_data</span><span class="p">(</span><span class="n">field</span><span class="p">:</span><span class="nb">str</span><span class="p">)</span> <span class="o">-></span> <span class="n">np</span><span class="o">.</span><span class="n">ndarray</span><span class="p">:</span>
|
||||
<span class="sd">"""</span>
|
||||
<span class="w"> </span><span class="sd">"""</span>
|
||||
<span class="sd"> Get a simple univariate time series data.</span>
|
||||
|
||||
<span class="sd"> :param field: the dataset field name to extract</span>
|
||||
@ -69,7 +69,7 @@
|
||||
|
||||
|
||||
<div class="viewcode-block" id="get_dataframe"><a class="viewcode-back" href="../../../pyFTS.data.html#pyFTS.data.SONDA.get_dataframe">[docs]</a><span class="k">def</span> <span class="nf">get_dataframe</span><span class="p">()</span> <span class="o">-></span> <span class="n">pd</span><span class="o">.</span><span class="n">DataFrame</span><span class="p">:</span>
|
||||
<span class="sd">"""</span>
|
||||
<span class="w"> </span><span class="sd">"""</span>
|
||||
<span class="sd"> Get the complete multivariate time series data.</span>
|
||||
|
||||
<span class="sd"> :return: Pandas DataFrame</span>
|
||||
@ -118,7 +118,7 @@
|
||||
</div>
|
||||
<div class="footer" role="contentinfo">
|
||||
© Copyright 2022, Machine Intelligence and Data Science Laboratory - UFMG - Brazil.
|
||||
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 4.5.0.
|
||||
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 4.3.2.
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
@ -51,13 +51,13 @@
|
||||
<span class="sd">Source: https://finance.yahoo.com/quote/%5EGSPC/history?p=%5EGSPC</span>
|
||||
<span class="sd">"""</span>
|
||||
|
||||
<span class="kn">from</span> <span class="nn">pyFTS.data</span> <span class="k">import</span> <span class="n">common</span>
|
||||
<span class="kn">from</span> <span class="nn">pyFTS.data</span> <span class="kn">import</span> <span class="n">common</span>
|
||||
<span class="kn">import</span> <span class="nn">pandas</span> <span class="k">as</span> <span class="nn">pd</span>
|
||||
<span class="kn">import</span> <span class="nn">numpy</span> <span class="k">as</span> <span class="nn">np</span>
|
||||
|
||||
|
||||
<div class="viewcode-block" id="get_data"><a class="viewcode-back" href="../../../pyFTS.data.html#pyFTS.data.SP500.get_data">[docs]</a><span class="k">def</span> <span class="nf">get_data</span><span class="p">()</span> <span class="o">-></span> <span class="n">np</span><span class="o">.</span><span class="n">ndarray</span><span class="p">:</span>
|
||||
<span class="sd">"""</span>
|
||||
<span class="w"> </span><span class="sd">"""</span>
|
||||
<span class="sd"> Get the univariate time series data.</span>
|
||||
|
||||
<span class="sd"> :return: numpy array</span>
|
||||
@ -67,7 +67,7 @@
|
||||
|
||||
|
||||
<div class="viewcode-block" id="get_dataframe"><a class="viewcode-back" href="../../../pyFTS.data.html#pyFTS.data.SP500.get_dataframe">[docs]</a><span class="k">def</span> <span class="nf">get_dataframe</span><span class="p">()</span> <span class="o">-></span> <span class="n">pd</span><span class="o">.</span><span class="n">DataFrame</span><span class="p">:</span>
|
||||
<span class="sd">"""</span>
|
||||
<span class="w"> </span><span class="sd">"""</span>
|
||||
<span class="sd"> Get the complete multivariate time series data.</span>
|
||||
|
||||
<span class="sd"> :return: Pandas DataFrame</span>
|
||||
@ -115,7 +115,7 @@
|
||||
</div>
|
||||
<div class="footer" role="contentinfo">
|
||||
© Copyright 2022, Machine Intelligence and Data Science Laboratory - UFMG - Brazil.
|
||||
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 4.5.0.
|
||||
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 4.3.2.
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
@ -50,13 +50,13 @@
|
||||
|
||||
<span class="sd">Source: http://www.twse.com.tw/en/products/indices/Index_Series.php</span>
|
||||
<span class="sd">"""</span>
|
||||
<span class="kn">from</span> <span class="nn">pyFTS.data</span> <span class="k">import</span> <span class="n">common</span>
|
||||
<span class="kn">from</span> <span class="nn">pyFTS.data</span> <span class="kn">import</span> <span class="n">common</span>
|
||||
<span class="kn">import</span> <span class="nn">pandas</span> <span class="k">as</span> <span class="nn">pd</span>
|
||||
<span class="kn">import</span> <span class="nn">numpy</span> <span class="k">as</span> <span class="nn">np</span>
|
||||
|
||||
|
||||
<div class="viewcode-block" id="get_data"><a class="viewcode-back" href="../../../pyFTS.data.html#pyFTS.data.TAIEX.get_data">[docs]</a><span class="k">def</span> <span class="nf">get_data</span><span class="p">()</span> <span class="o">-></span> <span class="n">np</span><span class="o">.</span><span class="n">ndarray</span><span class="p">:</span>
|
||||
<span class="sd">"""</span>
|
||||
<span class="w"> </span><span class="sd">"""</span>
|
||||
<span class="sd"> Get the univariate time series data.</span>
|
||||
|
||||
<span class="sd"> :return: numpy array</span>
|
||||
@ -67,7 +67,7 @@
|
||||
|
||||
|
||||
<div class="viewcode-block" id="get_dataframe"><a class="viewcode-back" href="../../../pyFTS.data.html#pyFTS.data.TAIEX.get_dataframe">[docs]</a><span class="k">def</span> <span class="nf">get_dataframe</span><span class="p">()</span> <span class="o">-></span> <span class="n">pd</span><span class="o">.</span><span class="n">DataFrame</span><span class="p">:</span>
|
||||
<span class="sd">"""</span>
|
||||
<span class="w"> </span><span class="sd">"""</span>
|
||||
<span class="sd"> Get the complete multivariate time series data.</span>
|
||||
|
||||
<span class="sd"> :return: Pandas DataFrame</span>
|
||||
@ -116,7 +116,7 @@
|
||||
</div>
|
||||
<div class="footer" role="contentinfo">
|
||||
© Copyright 2022, Machine Intelligence and Data Science Laboratory - UFMG - Brazil.
|
||||
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 4.5.0.
|
||||
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 4.3.2.
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
@ -51,18 +51,18 @@
|
||||
|
||||
|
||||
<div class="viewcode-block" id="SignalEmulator"><a class="viewcode-back" href="../../../pyFTS.data.html#pyFTS.data.artificial.SignalEmulator">[docs]</a><span class="k">class</span> <span class="nc">SignalEmulator</span><span class="p">(</span><span class="nb">object</span><span class="p">):</span>
|
||||
<span class="sd">"""</span>
|
||||
<span class="w"> </span><span class="sd">"""</span>
|
||||
<span class="sd"> Emulate a complex signal built from several additive and non-additive components</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="fm">__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">SignalEmulator</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="bp">self</span><span class="o">.</span><span class="n">components</span> <span class="o">=</span> <span class="p">[]</span>
|
||||
<span class="sd">"""Components of the signal"""</span>
|
||||
<span class="w"> </span><span class="sd">"""Components of the signal"""</span>
|
||||
|
||||
<div class="viewcode-block" id="SignalEmulator.stationary_gaussian"><a class="viewcode-back" href="../../../pyFTS.data.html#pyFTS.data.artificial.SignalEmulator.stationary_gaussian">[docs]</a> <span class="k">def</span> <span class="nf">stationary_gaussian</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">mu</span><span class="p">:</span><span class="nb">float</span><span class="p">,</span> <span class="n">sigma</span><span class="p">:</span><span class="nb">float</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
|
||||
<span class="sd">"""</span>
|
||||
<span class="w"> </span><span class="sd">"""</span>
|
||||
<span class="sd"> Creates a continuous Gaussian signal with mean mu and variance sigma.</span>
|
||||
|
||||
<span class="sd"> :param mu: mean</span>
|
||||
@ -82,7 +82,7 @@
|
||||
<span class="k">return</span> <span class="bp">self</span></div>
|
||||
|
||||
<div class="viewcode-block" id="SignalEmulator.incremental_gaussian"><a class="viewcode-back" href="../../../pyFTS.data.html#pyFTS.data.artificial.SignalEmulator.incremental_gaussian">[docs]</a> <span class="k">def</span> <span class="nf">incremental_gaussian</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">mu</span><span class="p">:</span><span class="nb">float</span><span class="p">,</span> <span class="n">sigma</span><span class="p">:</span><span class="nb">float</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
|
||||
<span class="sd">"""</span>
|
||||
<span class="w"> </span><span class="sd">"""</span>
|
||||
<span class="sd"> Creates an additive gaussian interference on a previous signal</span>
|
||||
|
||||
<span class="sd"> :param mu: increment on mean</span>
|
||||
@ -100,7 +100,7 @@
|
||||
<span class="k">return</span> <span class="bp">self</span></div>
|
||||
|
||||
<div class="viewcode-block" id="SignalEmulator.periodic_gaussian"><a class="viewcode-back" href="../../../pyFTS.data.html#pyFTS.data.artificial.SignalEmulator.periodic_gaussian">[docs]</a> <span class="k">def</span> <span class="nf">periodic_gaussian</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="nb">type</span><span class="p">:</span><span class="nb">str</span><span class="p">,</span> <span class="n">period</span><span class="p">:</span><span class="nb">int</span><span class="p">,</span> <span class="n">mu_min</span><span class="p">:</span><span class="nb">float</span><span class="p">,</span> <span class="n">sigma_min</span><span class="p">:</span><span class="nb">float</span><span class="p">,</span> <span class="n">mu_max</span><span class="p">:</span><span class="nb">float</span><span class="p">,</span> <span class="n">sigma_max</span><span class="p">:</span><span class="nb">float</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
|
||||
<span class="sd">"""</span>
|
||||
<span class="w"> </span><span class="sd">"""</span>
|
||||
<span class="sd"> Creates an additive periodic gaussian interference on a previous signal</span>
|
||||
|
||||
<span class="sd"> :param type: 'linear' or 'sinoidal'</span>
|
||||
@ -121,7 +121,7 @@
|
||||
<span class="k">return</span> <span class="bp">self</span></div>
|
||||
|
||||
<div class="viewcode-block" id="SignalEmulator.blip"><a class="viewcode-back" href="../../../pyFTS.data.html#pyFTS.data.artificial.SignalEmulator.blip">[docs]</a> <span class="k">def</span> <span class="nf">blip</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="w"> </span><span class="sd">"""</span>
|
||||
<span class="sd"> Creates an outlier greater than the maximum or lower then the minimum previous values of the signal,</span>
|
||||
<span class="sd"> and insert it on a random location of the signal.</span>
|
||||
|
||||
@ -133,7 +133,7 @@
|
||||
<span class="k">return</span> <span class="bp">self</span></div>
|
||||
|
||||
<div class="viewcode-block" id="SignalEmulator.run"><a class="viewcode-back" href="../../../pyFTS.data.html#pyFTS.data.artificial.SignalEmulator.run">[docs]</a> <span class="k">def</span> <span class="nf">run</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
|
||||
<span class="sd">"""</span>
|
||||
<span class="w"> </span><span class="sd">"""</span>
|
||||
<span class="sd"> Render the signal</span>
|
||||
|
||||
<span class="sd"> :return: a list of float values</span>
|
||||
@ -180,7 +180,7 @@
|
||||
<span class="n">_mn</span> <span class="o">=</span> <span class="nb">max</span><span class="p">(</span><span class="n">_mn</span><span class="p">,</span> <span class="n">vmin</span><span class="p">)</span> <span class="k">if</span> <span class="n">vmin</span> <span class="o">></span> <span class="mi">0</span> <span class="k">else</span> <span class="nb">min</span><span class="p">(</span><span class="n">_mn</span><span class="p">,</span> <span class="n">vmin</span><span class="p">)</span>
|
||||
|
||||
<span class="n">start</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">random</span><span class="o">.</span><span class="n">randint</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="nb">len</span><span class="p">(</span><span class="n">signal</span><span class="p">))</span>
|
||||
<span class="n">tmp</span> <span class="o">=</span> <span class="p">[</span><span class="n">_mx</span><span class="p">]</span> <span class="k">if</span> <span class="n">np</span><span class="o">.</span><span class="n">random</span><span class="o">.</span><span class="n">rand</span><span class="p">()</span> <span class="o">>=</span> <span class="o">.</span><span class="mi">5</span> <span class="k">else</span> <span class="p">[</span><span class="o">-</span><span class="n">_mn</span><span class="p">]</span>
|
||||
<span class="n">tmp</span> <span class="o">=</span> <span class="p">[</span><span class="n">_mx</span><span class="p">]</span> <span class="k">if</span> <span class="n">np</span><span class="o">.</span><span class="n">random</span><span class="o">.</span><span class="n">rand</span><span class="p">()</span> <span class="o">>=</span> <span class="mf">.5</span> <span class="k">else</span> <span class="p">[</span><span class="o">-</span><span class="n">_mn</span><span class="p">]</span>
|
||||
|
||||
<span class="n">last_num</span> <span class="o">=</span> <span class="n">num</span>
|
||||
<span class="n">last_it</span> <span class="o">=</span> <span class="n">it</span>
|
||||
@ -193,7 +193,7 @@
|
||||
|
||||
|
||||
<div class="viewcode-block" id="generate_gaussian_linear"><a class="viewcode-back" href="../../../pyFTS.data.html#pyFTS.data.artificial.generate_gaussian_linear">[docs]</a><span class="k">def</span> <span class="nf">generate_gaussian_linear</span><span class="p">(</span><span class="n">mu_ini</span><span class="p">,</span> <span class="n">sigma_ini</span><span class="p">,</span> <span class="n">mu_inc</span><span class="p">,</span> <span class="n">sigma_inc</span><span class="p">,</span> <span class="n">it</span><span class="o">=</span><span class="mi">100</span><span class="p">,</span> <span class="n">num</span><span class="o">=</span><span class="mi">10</span><span class="p">,</span> <span class="n">vmin</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">vmax</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span>
|
||||
<span class="sd">"""</span>
|
||||
<span class="w"> </span><span class="sd">"""</span>
|
||||
<span class="sd"> Generate data sampled from Gaussian distribution, with constant or linear changing parameters</span>
|
||||
|
||||
<span class="sd"> :param mu_ini: Initial mean</span>
|
||||
@ -222,7 +222,7 @@
|
||||
|
||||
|
||||
<div class="viewcode-block" id="generate_linear_periodic_gaussian"><a class="viewcode-back" href="../../../pyFTS.data.html#pyFTS.data.artificial.generate_linear_periodic_gaussian">[docs]</a><span class="k">def</span> <span class="nf">generate_linear_periodic_gaussian</span><span class="p">(</span><span class="n">period</span><span class="p">,</span> <span class="n">mu_min</span><span class="p">,</span> <span class="n">sigma_min</span><span class="p">,</span> <span class="n">mu_max</span><span class="p">,</span> <span class="n">sigma_max</span><span class="p">,</span> <span class="n">it</span><span class="o">=</span><span class="mi">100</span><span class="p">,</span> <span class="n">num</span><span class="o">=</span><span class="mi">10</span><span class="p">,</span> <span class="n">vmin</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">vmax</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span>
|
||||
<span class="sd">"""</span>
|
||||
<span class="w"> </span><span class="sd">"""</span>
|
||||
<span class="sd"> Generates a periodic linear variation on mean and variance</span>
|
||||
|
||||
<span class="sd"> :param period: the period of recurrence</span>
|
||||
@ -267,7 +267,7 @@
|
||||
|
||||
|
||||
<div class="viewcode-block" id="generate_sinoidal_periodic_gaussian"><a class="viewcode-back" href="../../../pyFTS.data.html#pyFTS.data.artificial.generate_sinoidal_periodic_gaussian">[docs]</a><span class="k">def</span> <span class="nf">generate_sinoidal_periodic_gaussian</span><span class="p">(</span><span class="n">period</span><span class="p">,</span> <span class="n">mu_min</span><span class="p">,</span> <span class="n">sigma_min</span><span class="p">,</span> <span class="n">mu_max</span><span class="p">,</span> <span class="n">sigma_max</span><span class="p">,</span> <span class="n">it</span><span class="o">=</span><span class="mi">100</span><span class="p">,</span> <span class="n">num</span><span class="o">=</span><span class="mi">10</span><span class="p">,</span> <span class="n">vmin</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">vmax</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span>
|
||||
<span class="sd">"""</span>
|
||||
<span class="w"> </span><span class="sd">"""</span>
|
||||
<span class="sd"> Generates a periodic sinoidal variation on mean and variance</span>
|
||||
|
||||
<span class="sd"> :param period: the period of recurrence</span>
|
||||
@ -304,7 +304,7 @@
|
||||
|
||||
|
||||
<div class="viewcode-block" id="generate_uniform_linear"><a class="viewcode-back" href="../../../pyFTS.data.html#pyFTS.data.artificial.generate_uniform_linear">[docs]</a><span class="k">def</span> <span class="nf">generate_uniform_linear</span><span class="p">(</span><span class="n">min_ini</span><span class="p">,</span> <span class="n">max_ini</span><span class="p">,</span> <span class="n">min_inc</span><span class="p">,</span> <span class="n">max_inc</span><span class="p">,</span> <span class="n">it</span><span class="o">=</span><span class="mi">100</span><span class="p">,</span> <span class="n">num</span><span class="o">=</span><span class="mi">10</span><span class="p">,</span> <span class="n">vmin</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">vmax</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span>
|
||||
<span class="sd">"""</span>
|
||||
<span class="w"> </span><span class="sd">"""</span>
|
||||
<span class="sd"> Generate data sampled from Uniform distribution, with constant or linear changing bounds</span>
|
||||
|
||||
<span class="sd"> :param mu_ini: Initial mean</span>
|
||||
@ -333,7 +333,7 @@
|
||||
|
||||
|
||||
<div class="viewcode-block" id="white_noise"><a class="viewcode-back" href="../../../pyFTS.data.html#pyFTS.data.artificial.white_noise">[docs]</a><span class="k">def</span> <span class="nf">white_noise</span><span class="p">(</span><span class="n">n</span><span class="o">=</span><span class="mi">500</span><span class="p">):</span>
|
||||
<span class="sd">"""</span>
|
||||
<span class="w"> </span><span class="sd">"""</span>
|
||||
<span class="sd"> Simple Gaussian noise signal</span>
|
||||
<span class="sd"> :param n: number of samples</span>
|
||||
<span class="sd"> :return:</span>
|
||||
@ -342,7 +342,7 @@
|
||||
|
||||
|
||||
<div class="viewcode-block" id="random_walk"><a class="viewcode-back" href="../../../pyFTS.data.html#pyFTS.data.artificial.random_walk">[docs]</a><span class="k">def</span> <span class="nf">random_walk</span><span class="p">(</span><span class="n">n</span><span class="o">=</span><span class="mi">500</span><span class="p">,</span> <span class="nb">type</span><span class="o">=</span><span class="s1">'gaussian'</span><span class="p">):</span>
|
||||
<span class="sd">"""</span>
|
||||
<span class="w"> </span><span class="sd">"""</span>
|
||||
<span class="sd"> Simple random walk</span>
|
||||
|
||||
<span class="sd"> :param n: number of samples</span>
|
||||
@ -421,7 +421,7 @@
|
||||
</div>
|
||||
<div class="footer" role="contentinfo">
|
||||
© Copyright 2022, Machine Intelligence and Data Science Laboratory - UFMG - Brazil.
|
||||
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 4.5.0.
|
||||
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 4.3.2.
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
@ -48,12 +48,12 @@
|
||||
<span class="kn">import</span> <span class="nn">numpy</span> <span class="k">as</span> <span class="nn">np</span>
|
||||
<span class="kn">import</span> <span class="nn">os</span>
|
||||
<span class="kn">import</span> <span class="nn">pkg_resources</span>
|
||||
<span class="kn">from</span> <span class="nn">pathlib</span> <span class="k">import</span> <span class="n">Path</span>
|
||||
<span class="kn">from</span> <span class="nn">urllib</span> <span class="k">import</span> <span class="n">request</span>
|
||||
<span class="kn">from</span> <span class="nn">pathlib</span> <span class="kn">import</span> <span class="n">Path</span>
|
||||
<span class="kn">from</span> <span class="nn">urllib</span> <span class="kn">import</span> <span class="n">request</span>
|
||||
|
||||
|
||||
<div class="viewcode-block" id="get_dataframe"><a class="viewcode-back" href="../../../pyFTS.data.html#pyFTS.data.common.get_dataframe">[docs]</a><span class="k">def</span> <span class="nf">get_dataframe</span><span class="p">(</span><span class="n">filename</span><span class="p">:</span> <span class="nb">str</span><span class="p">,</span> <span class="n">url</span><span class="p">:</span> <span class="nb">str</span><span class="p">,</span> <span class="n">sep</span><span class="p">:</span><span class="nb">str</span><span class="o">=</span><span class="s2">";"</span><span class="p">,</span> <span class="n">compression</span><span class="p">:</span><span class="nb">str</span><span class="o">=</span><span class="s1">'infer'</span><span class="p">)</span> <span class="o">-></span> <span class="n">pd</span><span class="o">.</span><span class="n">DataFrame</span><span class="p">:</span>
|
||||
<span class="sd">"""</span>
|
||||
<span class="w"> </span><span class="sd">"""</span>
|
||||
<span class="sd"> This method check if filename already exists, read the file and return its data.</span>
|
||||
<span class="sd"> If the file don't already exists, it will be downloaded and decompressed.</span>
|
||||
|
||||
@ -111,7 +111,7 @@
|
||||
</div>
|
||||
<div class="footer" role="contentinfo">
|
||||
© Copyright 2022, Machine Intelligence and Data Science Laboratory - UFMG - Brazil.
|
||||
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 4.5.0.
|
||||
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 4.3.2.
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
@ -55,7 +55,7 @@
|
||||
|
||||
|
||||
<div class="viewcode-block" id="get_data"><a class="viewcode-back" href="../../../pyFTS.data.html#pyFTS.data.henon.get_data">[docs]</a><span class="k">def</span> <span class="nf">get_data</span><span class="p">(</span><span class="n">var</span><span class="p">:</span> <span class="nb">str</span><span class="p">,</span> <span class="n">a</span><span class="p">:</span><span class="nb">float</span><span class="o">=</span><span class="mf">1.4</span><span class="p">,</span> <span class="n">b</span><span class="p">:</span><span class="nb">float</span><span class="o">=</span><span class="mf">0.3</span><span class="p">,</span> <span class="n">initial_values</span><span class="p">:</span> <span class="nb">list</span> <span class="o">=</span> <span class="p">[</span><span class="mi">1</span><span class="p">,</span> <span class="mi">1</span><span class="p">],</span> <span class="n">iterations</span><span class="p">:</span><span class="nb">int</span><span class="o">=</span><span class="mi">1000</span><span class="p">)</span> <span class="o">-></span> <span class="n">pd</span><span class="o">.</span><span class="n">DataFrame</span><span class="p">:</span>
|
||||
<span class="sd">"""</span>
|
||||
<span class="w"> </span><span class="sd">"""</span>
|
||||
<span class="sd"> Get a simple univariate time series data.</span>
|
||||
|
||||
<span class="sd"> :param var: the dataset field name to extract</span>
|
||||
@ -65,7 +65,7 @@
|
||||
|
||||
|
||||
<div class="viewcode-block" id="get_dataframe"><a class="viewcode-back" href="../../../pyFTS.data.html#pyFTS.data.henon.get_dataframe">[docs]</a><span class="k">def</span> <span class="nf">get_dataframe</span><span class="p">(</span><span class="n">a</span><span class="p">:</span><span class="nb">float</span><span class="o">=</span><span class="mf">1.4</span><span class="p">,</span> <span class="n">b</span><span class="p">:</span><span class="nb">float</span><span class="o">=</span><span class="mf">0.3</span><span class="p">,</span> <span class="n">initial_values</span><span class="p">:</span> <span class="nb">list</span> <span class="o">=</span> <span class="p">[</span><span class="mi">1</span><span class="p">,</span> <span class="mi">1</span><span class="p">],</span> <span class="n">iterations</span><span class="p">:</span><span class="nb">int</span><span class="o">=</span><span class="mi">1000</span><span class="p">)</span> <span class="o">-></span> <span class="n">pd</span><span class="o">.</span><span class="n">DataFrame</span><span class="p">:</span>
|
||||
<span class="sd">'''</span>
|
||||
<span class="w"> </span><span class="sd">'''</span>
|
||||
<span class="sd"> Return a dataframe with the bivariate Henon Map time series (x, y).</span>
|
||||
|
||||
<span class="sd"> :param a: Equation coefficient</span>
|
||||
@ -121,7 +121,7 @@
|
||||
</div>
|
||||
<div class="footer" role="contentinfo">
|
||||
© Copyright 2022, Machine Intelligence and Data Science Laboratory - UFMG - Brazil.
|
||||
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 4.5.0.
|
||||
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 4.3.2.
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
@ -54,7 +54,7 @@
|
||||
|
||||
|
||||
<div class="viewcode-block" id="get_data"><a class="viewcode-back" href="../../../pyFTS.data.html#pyFTS.data.logistic_map.get_data">[docs]</a><span class="k">def</span> <span class="nf">get_data</span><span class="p">(</span><span class="n">r</span><span class="p">:</span> <span class="nb">float</span> <span class="o">=</span> <span class="mi">4</span><span class="p">,</span> <span class="n">initial_value</span><span class="p">:</span> <span class="nb">float</span> <span class="o">=</span> <span class="mf">0.3</span><span class="p">,</span> <span class="n">iterations</span><span class="p">:</span> <span class="nb">int</span><span class="o">=</span><span class="mi">100</span><span class="p">)</span> <span class="o">-></span> <span class="nb">list</span><span class="p">:</span>
|
||||
<span class="sd">'''</span>
|
||||
<span class="w"> </span><span class="sd">'''</span>
|
||||
<span class="sd"> Return a list with the logistic map chaotic time series.</span>
|
||||
|
||||
<span class="sd"> :param r: Equation coefficient</span>
|
||||
@ -105,7 +105,7 @@
|
||||
</div>
|
||||
<div class="footer" role="contentinfo">
|
||||
© Copyright 2022, Machine Intelligence and Data Science Laboratory - UFMG - Brazil.
|
||||
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 4.5.0.
|
||||
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 4.3.2.
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
@ -58,7 +58,7 @@
|
||||
|
||||
<div class="viewcode-block" id="get_data"><a class="viewcode-back" href="../../../pyFTS.data.html#pyFTS.data.lorentz.get_data">[docs]</a><span class="k">def</span> <span class="nf">get_data</span><span class="p">(</span><span class="n">var</span><span class="p">:</span> <span class="nb">str</span><span class="p">,</span> <span class="n">a</span><span class="p">:</span> <span class="nb">float</span> <span class="o">=</span> <span class="mf">10.0</span><span class="p">,</span> <span class="n">b</span><span class="p">:</span> <span class="nb">float</span> <span class="o">=</span> <span class="mf">28.0</span><span class="p">,</span> <span class="n">c</span><span class="p">:</span> <span class="nb">float</span> <span class="o">=</span> <span class="mf">8.0</span> <span class="o">/</span> <span class="mf">3.0</span><span class="p">,</span> <span class="n">dt</span><span class="p">:</span> <span class="nb">float</span> <span class="o">=</span> <span class="mf">0.01</span><span class="p">,</span>
|
||||
<span class="n">initial_values</span><span class="p">:</span> <span class="nb">list</span> <span class="o">=</span> <span class="p">[</span><span class="mf">0.1</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">],</span> <span class="n">iterations</span><span class="p">:</span> <span class="nb">int</span><span class="o">=</span><span class="mi">1000</span><span class="p">)</span> <span class="o">-></span> <span class="n">pd</span><span class="o">.</span><span class="n">DataFrame</span><span class="p">:</span>
|
||||
<span class="sd">"""</span>
|
||||
<span class="w"> </span><span class="sd">"""</span>
|
||||
<span class="sd"> Get a simple univariate time series data.</span>
|
||||
|
||||
<span class="sd"> :param var: the dataset field name to extract</span>
|
||||
@ -69,7 +69,7 @@
|
||||
|
||||
<div class="viewcode-block" id="get_dataframe"><a class="viewcode-back" href="../../../pyFTS.data.html#pyFTS.data.lorentz.get_dataframe">[docs]</a><span class="k">def</span> <span class="nf">get_dataframe</span><span class="p">(</span><span class="n">a</span><span class="p">:</span> <span class="nb">float</span> <span class="o">=</span> <span class="mf">10.0</span><span class="p">,</span> <span class="n">b</span><span class="p">:</span> <span class="nb">float</span> <span class="o">=</span> <span class="mf">28.0</span><span class="p">,</span> <span class="n">c</span><span class="p">:</span> <span class="nb">float</span> <span class="o">=</span> <span class="mf">8.0</span> <span class="o">/</span> <span class="mf">3.0</span><span class="p">,</span> <span class="n">dt</span><span class="p">:</span> <span class="nb">float</span> <span class="o">=</span> <span class="mf">0.01</span><span class="p">,</span>
|
||||
<span class="n">initial_values</span><span class="p">:</span> <span class="nb">list</span> <span class="o">=</span> <span class="p">[</span><span class="mf">0.1</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">],</span> <span class="n">iterations</span><span class="p">:</span> <span class="nb">int</span><span class="o">=</span><span class="mi">1000</span><span class="p">)</span><span class="o">-></span> <span class="n">pd</span><span class="o">.</span><span class="n">DataFrame</span><span class="p">:</span>
|
||||
<span class="sd">'''</span>
|
||||
<span class="w"> </span><span class="sd">'''</span>
|
||||
<span class="sd"> Return a dataframe with the multivariate Lorenz Map time series (x, y, z).</span>
|
||||
|
||||
<span class="sd"> :param a: Equation coefficient. Default value: 10</span>
|
||||
@ -132,7 +132,7 @@
|
||||
</div>
|
||||
<div class="footer" role="contentinfo">
|
||||
© Copyright 2022, Machine Intelligence and Data Science Laboratory - UFMG - Brazil.
|
||||
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 4.5.0.
|
||||
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 4.3.2.
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
@ -54,7 +54,7 @@
|
||||
|
||||
|
||||
<div class="viewcode-block" id="get_data"><a class="viewcode-back" href="../../../pyFTS.data.html#pyFTS.data.mackey_glass.get_data">[docs]</a><span class="k">def</span> <span class="nf">get_data</span><span class="p">(</span><span class="n">b</span><span class="p">:</span> <span class="nb">float</span><span class="o">=</span><span class="mf">0.1</span><span class="p">,</span> <span class="n">c</span><span class="p">:</span> <span class="nb">float</span><span class="o">=</span><span class="mf">0.2</span><span class="p">,</span> <span class="n">tau</span><span class="p">:</span> <span class="nb">float</span> <span class="o">=</span><span class="mi">17</span><span class="p">,</span> <span class="n">initial_values</span><span class="p">:</span> <span class="n">np</span><span class="o">.</span><span class="n">ndarray</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">linspace</span><span class="p">(</span><span class="mf">0.5</span><span class="p">,</span><span class="mf">1.5</span><span class="p">,</span> <span class="mi">18</span><span class="p">),</span> <span class="n">iterations</span><span class="p">:</span> <span class="nb">int</span><span class="o">=</span><span class="mi">1000</span><span class="p">)</span> <span class="o">-></span> <span class="nb">list</span><span class="p">:</span>
|
||||
<span class="sd">'''</span>
|
||||
<span class="w"> </span><span class="sd">'''</span>
|
||||
<span class="sd"> Return a list with the Mackey-Glass chaotic time series.</span>
|
||||
|
||||
<span class="sd"> :param b: Equation coefficient</span>
|
||||
@ -108,7 +108,7 @@
|
||||
</div>
|
||||
<div class="footer" role="contentinfo">
|
||||
© Copyright 2022, Machine Intelligence and Data Science Laboratory - UFMG - Brazil.
|
||||
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 4.5.0.
|
||||
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 4.3.2.
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
@ -58,7 +58,7 @@
|
||||
|
||||
<div class="viewcode-block" id="get_data"><a class="viewcode-back" href="../../../pyFTS.data.html#pyFTS.data.rossler.get_data">[docs]</a><span class="k">def</span> <span class="nf">get_data</span><span class="p">(</span><span class="n">var</span><span class="p">:</span> <span class="nb">str</span><span class="p">,</span> <span class="n">a</span><span class="p">:</span> <span class="nb">float</span> <span class="o">=</span> <span class="mf">0.2</span><span class="p">,</span> <span class="n">b</span><span class="p">:</span> <span class="nb">float</span> <span class="o">=</span> <span class="mf">0.2</span><span class="p">,</span> <span class="n">c</span><span class="p">:</span> <span class="nb">float</span> <span class="o">=</span> <span class="mf">5.7</span><span class="p">,</span> <span class="n">dt</span><span class="p">:</span> <span class="nb">float</span> <span class="o">=</span> <span class="mf">0.01</span><span class="p">,</span>
|
||||
<span class="n">initial_values</span><span class="p">:</span> <span class="n">np</span><span class="o">.</span><span class="n">ndarray</span> <span class="o">=</span> <span class="p">[</span><span class="mf">0.001</span><span class="p">,</span> <span class="mf">0.001</span><span class="p">,</span> <span class="mf">0.001</span><span class="p">],</span> <span class="n">iterations</span><span class="p">:</span> <span class="nb">int</span><span class="o">=</span><span class="mi">5000</span><span class="p">)</span> <span class="o">-></span> <span class="n">np</span><span class="o">.</span><span class="n">ndarray</span><span class="p">:</span>
|
||||
<span class="sd">"""</span>
|
||||
<span class="w"> </span><span class="sd">"""</span>
|
||||
<span class="sd"> Get a simple univariate time series data.</span>
|
||||
|
||||
<span class="sd"> :param var: the dataset field name to extract</span>
|
||||
@ -69,7 +69,7 @@
|
||||
|
||||
<div class="viewcode-block" id="get_dataframe"><a class="viewcode-back" href="../../../pyFTS.data.html#pyFTS.data.rossler.get_dataframe">[docs]</a><span class="k">def</span> <span class="nf">get_dataframe</span><span class="p">(</span><span class="n">a</span><span class="p">:</span> <span class="nb">float</span> <span class="o">=</span> <span class="mf">0.2</span><span class="p">,</span> <span class="n">b</span><span class="p">:</span> <span class="nb">float</span> <span class="o">=</span> <span class="mf">0.2</span><span class="p">,</span> <span class="n">c</span><span class="p">:</span> <span class="nb">float</span> <span class="o">=</span> <span class="mf">5.7</span><span class="p">,</span> <span class="n">dt</span><span class="p">:</span> <span class="nb">float</span> <span class="o">=</span> <span class="mf">0.01</span><span class="p">,</span>
|
||||
<span class="n">initial_values</span><span class="p">:</span> <span class="n">np</span><span class="o">.</span><span class="n">ndarray</span> <span class="o">=</span> <span class="p">[</span><span class="mf">0.001</span><span class="p">,</span> <span class="mf">0.001</span><span class="p">,</span> <span class="mf">0.001</span><span class="p">],</span> <span class="n">iterations</span><span class="p">:</span> <span class="nb">int</span><span class="o">=</span><span class="mi">5000</span><span class="p">)</span> <span class="o">-></span> <span class="n">pd</span><span class="o">.</span><span class="n">DataFrame</span><span class="p">:</span>
|
||||
<span class="sd">'''</span>
|
||||
<span class="w"> </span><span class="sd">'''</span>
|
||||
<span class="sd"> Return a dataframe with the multivariate Rössler Map time series (x, y, z).</span>
|
||||
|
||||
<span class="sd"> :param a: Equation coefficient. Default value: 0.2</span>
|
||||
@ -132,7 +132,7 @@
|
||||
</div>
|
||||
<div class="footer" role="contentinfo">
|
||||
© Copyright 2022, Machine Intelligence and Data Science Laboratory - UFMG - Brazil.
|
||||
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 4.5.0.
|
||||
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 4.3.2.
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
@ -49,12 +49,12 @@
|
||||
<span class="sd">Source: https://www.esrl.noaa.gov/psd/gcos_wgsp/Timeseries/SUNSPOT/</span>
|
||||
<span class="sd">"""</span>
|
||||
|
||||
<span class="kn">from</span> <span class="nn">pyFTS.data</span> <span class="k">import</span> <span class="n">common</span>
|
||||
<span class="kn">from</span> <span class="nn">pyFTS.data</span> <span class="kn">import</span> <span class="n">common</span>
|
||||
<span class="kn">import</span> <span class="nn">pandas</span> <span class="k">as</span> <span class="nn">pd</span>
|
||||
<span class="kn">import</span> <span class="nn">numpy</span> <span class="k">as</span> <span class="nn">np</span>
|
||||
|
||||
<div class="viewcode-block" id="get_data"><a class="viewcode-back" href="../../../pyFTS.data.html#pyFTS.data.sunspots.get_data">[docs]</a><span class="k">def</span> <span class="nf">get_data</span><span class="p">()</span> <span class="o">-></span> <span class="n">np</span><span class="o">.</span><span class="n">ndarray</span><span class="p">:</span>
|
||||
<span class="sd">"""</span>
|
||||
<span class="w"> </span><span class="sd">"""</span>
|
||||
<span class="sd"> Get a simple univariate time series data.</span>
|
||||
|
||||
<span class="sd"> :return: numpy array</span>
|
||||
@ -64,7 +64,7 @@
|
||||
<span class="k">return</span> <span class="n">dat</span></div>
|
||||
|
||||
<div class="viewcode-block" id="get_dataframe"><a class="viewcode-back" href="../../../pyFTS.data.html#pyFTS.data.sunspots.get_dataframe">[docs]</a><span class="k">def</span> <span class="nf">get_dataframe</span><span class="p">()</span> <span class="o">-></span> <span class="n">pd</span><span class="o">.</span><span class="n">DataFrame</span><span class="p">:</span>
|
||||
<span class="sd">"""</span>
|
||||
<span class="w"> </span><span class="sd">"""</span>
|
||||
<span class="sd"> Get the complete multivariate time series data.</span>
|
||||
|
||||
<span class="sd"> :return: Pandas DataFrame</span>
|
||||
@ -112,7 +112,7 @@
|
||||
</div>
|
||||
<div class="footer" role="contentinfo">
|
||||
© Copyright 2022, Machine Intelligence and Data Science Laboratory - UFMG - Brazil.
|
||||
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 4.5.0.
|
||||
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 4.3.2.
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
@ -51,7 +51,7 @@
|
||||
|
||||
|
||||
<div class="viewcode-block" id="open_hyperparam_db"><a class="viewcode-back" href="../../../pyFTS.hyperparam.html#pyFTS.hyperparam.Util.open_hyperparam_db">[docs]</a><span class="k">def</span> <span class="nf">open_hyperparam_db</span><span class="p">(</span><span class="n">name</span><span class="p">):</span>
|
||||
<span class="sd">"""</span>
|
||||
<span class="w"> </span><span class="sd">"""</span>
|
||||
<span class="sd"> Open a connection with a Sqlite database designed to store benchmark results.</span>
|
||||
|
||||
<span class="sd"> :param name: database filenem</span>
|
||||
@ -68,7 +68,7 @@
|
||||
|
||||
|
||||
<div class="viewcode-block" id="create_hyperparam_tables"><a class="viewcode-back" href="../../../pyFTS.hyperparam.html#pyFTS.hyperparam.Util.create_hyperparam_tables">[docs]</a><span class="k">def</span> <span class="nf">create_hyperparam_tables</span><span class="p">(</span><span class="n">conn</span><span class="p">):</span>
|
||||
<span class="sd">"""</span>
|
||||
<span class="w"> </span><span class="sd">"""</span>
|
||||
<span class="sd"> Create a sqlite3 table designed to store benchmark results.</span>
|
||||
|
||||
<span class="sd"> :param conn: a sqlite3 database connection</span>
|
||||
@ -85,7 +85,7 @@
|
||||
|
||||
|
||||
<div class="viewcode-block" id="insert_hyperparam"><a class="viewcode-back" href="../../../pyFTS.hyperparam.html#pyFTS.hyperparam.Util.insert_hyperparam">[docs]</a><span class="k">def</span> <span class="nf">insert_hyperparam</span><span class="p">(</span><span class="n">data</span><span class="p">,</span> <span class="n">conn</span><span class="p">):</span>
|
||||
<span class="sd">"""</span>
|
||||
<span class="w"> </span><span class="sd">"""</span>
|
||||
<span class="sd"> Insert benchmark data on database</span>
|
||||
|
||||
<span class="sd"> :param data: a tuple with the benchmark data with format:</span>
|
||||
@ -151,7 +151,7 @@
|
||||
</div>
|
||||
<div class="footer" role="contentinfo">
|
||||
© Copyright 2022, Machine Intelligence and Data Science Laboratory - UFMG - Brazil.
|
||||
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 4.5.0.
|
||||
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 4.3.2.
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
@ -46,10 +46,10 @@
|
||||
<span></span>
|
||||
|
||||
<div class="viewcode-block" id="FLR"><a class="viewcode-back" href="../../../../pyFTS.models.multivariate.html#pyFTS.models.multivariate.FLR.FLR">[docs]</a><span class="k">class</span> <span class="nc">FLR</span><span class="p">(</span><span class="nb">object</span><span class="p">):</span>
|
||||
<span class="sd">"""Multivariate Fuzzy Logical Relationship"""</span>
|
||||
<span class="w"> </span><span class="sd">"""Multivariate Fuzzy Logical Relationship"""</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="sd">"""</span>
|
||||
<span class="k">def</span> <span class="fm">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
|
||||
<span class="w"> </span><span class="sd">"""</span>
|
||||
<span class="sd"> Creates a Fuzzy Logical Relationship</span>
|
||||
<span class="sd"> :param LHS: Left Hand Side fuzzy set</span>
|
||||
<span class="sd"> :param RHS: Right Hand Side fuzzy set</span>
|
||||
@ -63,7 +63,7 @@
|
||||
<div class="viewcode-block" id="FLR.set_rhs"><a class="viewcode-back" href="../../../../pyFTS.models.multivariate.html#pyFTS.models.multivariate.FLR.FLR.set_rhs">[docs]</a> <span class="k">def</span> <span class="nf">set_rhs</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="nb">set</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="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="fm">__str__</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
|
||||
<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="n">k</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">values</span><span class="p">()],</span> <span class="bp">self</span><span class="o">.</span><span class="n">RHS</span><span class="p">)</span></div>
|
||||
|
||||
|
||||
@ -106,7 +106,7 @@
|
||||
</div>
|
||||
<div class="footer" role="contentinfo">
|
||||
© Copyright 2022, Machine Intelligence and Data Science Laboratory - UFMG - Brazil.
|
||||
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 4.5.0.
|
||||
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 4.3.2.
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
@ -45,15 +45,15 @@
|
||||
<h1>Source code for pyFTS.models.multivariate.common</h1><div class="highlight"><pre>
|
||||
<span></span><span class="kn">import</span> <span class="nn">numpy</span> <span class="k">as</span> <span class="nn">np</span>
|
||||
<span class="kn">import</span> <span class="nn">pandas</span> <span class="k">as</span> <span class="nn">pd</span>
|
||||
<span class="kn">from</span> <span class="nn">pyFTS.common</span> <span class="k">import</span> <span class="n">FuzzySet</span><span class="p">,</span> <span class="n">Composite</span>
|
||||
<span class="kn">from</span> <span class="nn">pyFTS.common</span> <span class="kn">import</span> <span class="n">FuzzySet</span><span class="p">,</span> <span class="n">Composite</span>
|
||||
|
||||
|
||||
<div class="viewcode-block" id="MultivariateFuzzySet"><a class="viewcode-back" href="../../../../pyFTS.models.multivariate.html#pyFTS.models.multivariate.common.MultivariateFuzzySet">[docs]</a><span class="k">class</span> <span class="nc">MultivariateFuzzySet</span><span class="p">(</span><span class="n">Composite</span><span class="o">.</span><span class="n">FuzzySet</span><span class="p">):</span>
|
||||
<span class="sd">"""</span>
|
||||
<span class="w"> </span><span class="sd">"""</span>
|
||||
<span class="sd"> Multivariate Composite Fuzzy Set</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="sd">"""</span>
|
||||
<span class="k">def</span> <span class="fm">__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="w"> </span><span class="sd">"""</span>
|
||||
<span class="sd"> Create an empty composite fuzzy set</span>
|
||||
<span class="sd"> :param name: fuzzy set name</span>
|
||||
<span class="sd"> """</span>
|
||||
@ -62,7 +62,7 @@
|
||||
<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>
|
||||
|
||||
<div class="viewcode-block" id="MultivariateFuzzySet.append_set"><a class="viewcode-back" href="../../../../pyFTS.models.multivariate.html#pyFTS.models.multivariate.common.MultivariateFuzzySet.append_set">[docs]</a> <span class="k">def</span> <span class="nf">append_set</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">variable</span><span class="p">,</span> <span class="nb">set</span><span class="p">):</span>
|
||||
<span class="sd">"""</span>
|
||||
<span class="w"> </span><span class="sd">"""</span>
|
||||
<span class="sd"> Appends a new fuzzy set from a new variable</span>
|
||||
|
||||
<span class="sd"> :param variable: an multivariate.variable instance</span>
|
||||
@ -158,7 +158,7 @@
|
||||
</div>
|
||||
<div class="footer" role="contentinfo">
|
||||
© Copyright 2022, Machine Intelligence and Data Science Laboratory - UFMG - Brazil.
|
||||
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 4.5.0.
|
||||
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 4.3.2.
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
@ -45,15 +45,15 @@
|
||||
<h1>Source code for pyFTS.models.multivariate.flrg</h1><div class="highlight"><pre>
|
||||
<span></span>
|
||||
<span class="kn">import</span> <span class="nn">numpy</span> <span class="k">as</span> <span class="nn">np</span>
|
||||
<span class="kn">from</span> <span class="nn">pyFTS.common</span> <span class="k">import</span> <span class="n">flrg</span> <span class="k">as</span> <span class="n">flg</span>
|
||||
<span class="kn">from</span> <span class="nn">pyFTS.common</span> <span class="kn">import</span> <span class="n">flrg</span> <span class="k">as</span> <span class="n">flg</span>
|
||||
|
||||
|
||||
<div class="viewcode-block" id="FLRG"><a class="viewcode-back" href="../../../../pyFTS.models.multivariate.html#pyFTS.models.multivariate.flrg.FLRG">[docs]</a><span class="k">class</span> <span class="nc">FLRG</span><span class="p">(</span><span class="n">flg</span><span class="o">.</span><span class="n">FLRG</span><span class="p">):</span>
|
||||
<span class="sd">"""</span>
|
||||
<span class="w"> </span><span class="sd">"""</span>
|
||||
<span class="sd"> Multivariate Fuzzy Logical Rule Group</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="fm">__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">FLRG</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="mi">0</span><span class="p">,</span><span class="o">**</span><span class="n">kwargs</span><span class="p">)</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">order</span> <span class="o">=</span> <span class="n">kwargs</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">'order'</span><span class="p">,</span> <span class="mi">1</span><span class="p">)</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">LHS</span> <span class="o">=</span> <span class="n">kwargs</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">'lhs'</span><span class="p">,</span> <span class="p">{})</span>
|
||||
@ -90,7 +90,7 @@
|
||||
|
||||
<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">upper</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="fm">__str__</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
|
||||
<span class="n">_str</span> <span class="o">=</span> <span class="s2">""</span>
|
||||
<span class="k">for</span> <span class="n">k</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">RHS</span><span class="p">:</span>
|
||||
<span class="n">_str</span> <span class="o">+=</span> <span class="s2">","</span> <span class="k">if</span> <span class="nb">len</span><span class="p">(</span><span class="n">_str</span><span class="p">)</span> <span class="o">></span> <span class="mi">0</span> <span class="k">else</span> <span class="s2">""</span>
|
||||
@ -135,7 +135,7 @@
|
||||
</div>
|
||||
<div class="footer" role="contentinfo">
|
||||
© Copyright 2022, Machine Intelligence and Data Science Laboratory - UFMG - Brazil.
|
||||
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 4.5.0.
|
||||
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 4.3.2.
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
@ -43,20 +43,20 @@
|
||||
<div class="body" role="main">
|
||||
|
||||
<h1>Source code for pyFTS.models.multivariate.grid</h1><div class="highlight"><pre>
|
||||
<span></span><span class="kn">from</span> <span class="nn">pyFTS.models.multivariate</span> <span class="k">import</span> <span class="n">partitioner</span>
|
||||
<span class="kn">from</span> <span class="nn">pyFTS.models.multivariate.common</span> <span class="k">import</span> <span class="n">MultivariateFuzzySet</span><span class="p">,</span> <span class="n">fuzzyfy_instance_clustered</span>
|
||||
<span class="kn">from</span> <span class="nn">itertools</span> <span class="k">import</span> <span class="n">product</span>
|
||||
<span class="kn">from</span> <span class="nn">scipy.spatial</span> <span class="k">import</span> <span class="n">KDTree</span>
|
||||
<span></span><span class="kn">from</span> <span class="nn">pyFTS.models.multivariate</span> <span class="kn">import</span> <span class="n">partitioner</span>
|
||||
<span class="kn">from</span> <span class="nn">pyFTS.models.multivariate.common</span> <span class="kn">import</span> <span class="n">MultivariateFuzzySet</span><span class="p">,</span> <span class="n">fuzzyfy_instance_clustered</span>
|
||||
<span class="kn">from</span> <span class="nn">itertools</span> <span class="kn">import</span> <span class="n">product</span>
|
||||
<span class="kn">from</span> <span class="nn">scipy.spatial</span> <span class="kn">import</span> <span class="n">KDTree</span>
|
||||
<span class="kn">import</span> <span class="nn">numpy</span> <span class="k">as</span> <span class="nn">np</span>
|
||||
<span class="kn">import</span> <span class="nn">pandas</span> <span class="k">as</span> <span class="nn">pd</span>
|
||||
|
||||
|
||||
<div class="viewcode-block" id="GridCluster"><a class="viewcode-back" href="../../../../pyFTS.models.multivariate.html#pyFTS.models.multivariate.grid.GridCluster">[docs]</a><span class="k">class</span> <span class="nc">GridCluster</span><span class="p">(</span><span class="n">partitioner</span><span class="o">.</span><span class="n">MultivariatePartitioner</span><span class="p">):</span>
|
||||
<span class="sd">"""</span>
|
||||
<span class="w"> </span><span class="sd">"""</span>
|
||||
<span class="sd"> A cartesian product of all fuzzy sets of all variables</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="fm">__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">GridCluster</span><span class="p">,</span> <span class="bp">self</span><span class="p">)</span><span class="o">.</span><span class="fm">__init__</span><span class="p">(</span><span class="o">**</span><span class="n">kwargs</span><span class="p">)</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">name</span><span class="o">=</span><span class="s2">"GridCluster"</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">build</span><span class="p">(</span><span class="kc">None</span><span class="p">)</span>
|
||||
@ -106,12 +106,12 @@
|
||||
|
||||
|
||||
<div class="viewcode-block" id="IncrementalGridCluster"><a class="viewcode-back" href="../../../../pyFTS.models.multivariate.html#pyFTS.models.multivariate.grid.IncrementalGridCluster">[docs]</a><span class="k">class</span> <span class="nc">IncrementalGridCluster</span><span class="p">(</span><span class="n">partitioner</span><span class="o">.</span><span class="n">MultivariatePartitioner</span><span class="p">):</span>
|
||||
<span class="sd">"""</span>
|
||||
<span class="w"> </span><span class="sd">"""</span>
|
||||
<span class="sd"> Create combinations of fuzzy sets of the variables on demand, incrementally increasing the</span>
|
||||
<span class="sd"> multivariate fuzzy set base.</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="fm">__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">IncrementalGridCluster</span><span class="p">,</span> <span class="bp">self</span><span class="p">)</span><span class="o">.</span><span class="fm">__init__</span><span class="p">(</span><span class="o">**</span><span class="n">kwargs</span><span class="p">)</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">name</span><span class="o">=</span><span class="s2">"IncrementalGridCluster"</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">build</span><span class="p">(</span><span class="kc">None</span><span class="p">)</span>
|
||||
@ -219,7 +219,7 @@
|
||||
</div>
|
||||
<div class="footer" role="contentinfo">
|
||||
© Copyright 2022, Machine Intelligence and Data Science Laboratory - UFMG - Brazil.
|
||||
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 4.5.0.
|
||||
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 4.3.2.
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
@ -43,20 +43,20 @@
|
||||
<div class="body" role="main">
|
||||
|
||||
<h1>Source code for pyFTS.models.multivariate.partitioner</h1><div class="highlight"><pre>
|
||||
<span></span><span class="kn">from</span> <span class="nn">pyFTS.partitioners</span> <span class="k">import</span> <span class="n">partitioner</span>
|
||||
<span class="kn">from</span> <span class="nn">pyFTS.models.multivariate.common</span> <span class="k">import</span> <span class="n">MultivariateFuzzySet</span><span class="p">,</span> <span class="n">fuzzyfy_instance_clustered</span>
|
||||
<span class="kn">from</span> <span class="nn">itertools</span> <span class="k">import</span> <span class="n">product</span>
|
||||
<span class="kn">from</span> <span class="nn">scipy.spatial</span> <span class="k">import</span> <span class="n">KDTree</span>
|
||||
<span></span><span class="kn">from</span> <span class="nn">pyFTS.partitioners</span> <span class="kn">import</span> <span class="n">partitioner</span>
|
||||
<span class="kn">from</span> <span class="nn">pyFTS.models.multivariate.common</span> <span class="kn">import</span> <span class="n">MultivariateFuzzySet</span><span class="p">,</span> <span class="n">fuzzyfy_instance_clustered</span>
|
||||
<span class="kn">from</span> <span class="nn">itertools</span> <span class="kn">import</span> <span class="n">product</span>
|
||||
<span class="kn">from</span> <span class="nn">scipy.spatial</span> <span class="kn">import</span> <span class="n">KDTree</span>
|
||||
<span class="kn">import</span> <span class="nn">numpy</span> <span class="k">as</span> <span class="nn">np</span>
|
||||
<span class="kn">import</span> <span class="nn">pandas</span> <span class="k">as</span> <span class="nn">pd</span>
|
||||
|
||||
|
||||
<div class="viewcode-block" id="MultivariatePartitioner"><a class="viewcode-back" href="../../../../pyFTS.models.multivariate.html#pyFTS.models.multivariate.partitioner.MultivariatePartitioner">[docs]</a><span class="k">class</span> <span class="nc">MultivariatePartitioner</span><span class="p">(</span><span class="n">partitioner</span><span class="o">.</span><span class="n">Partitioner</span><span class="p">):</span>
|
||||
<span class="sd">"""</span>
|
||||
<span class="w"> </span><span class="sd">"""</span>
|
||||
<span class="sd"> Base class for partitioners which use the MultivariateFuzzySet</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="fm">__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">MultivariatePartitioner</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="o">=</span><span class="s2">"MultivariatePartitioner"</span><span class="p">,</span> <span class="n">preprocess</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">)</span>
|
||||
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">type</span> <span class="o">=</span> <span class="s1">'multivariate'</span>
|
||||
@ -103,7 +103,7 @@
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">build_index</span><span class="p">()</span></div>
|
||||
|
||||
<div class="viewcode-block" id="MultivariatePartitioner.search"><a class="viewcode-back" href="../../../../pyFTS.models.multivariate.html#pyFTS.models.multivariate.partitioner.MultivariatePartitioner.search">[docs]</a> <span class="k">def</span> <span class="nf">search</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="sd">"""</span>
|
||||
<span class="w"> </span><span class="sd">"""</span>
|
||||
<span class="sd"> Perform a search for the nearest fuzzy sets of the point 'data'. This function were designed to work with several</span>
|
||||
<span class="sd"> overlapped fuzzy sets.</span>
|
||||
|
||||
@ -201,7 +201,7 @@
|
||||
</div>
|
||||
<div class="footer" role="contentinfo">
|
||||
© Copyright 2022, Machine Intelligence and Data Science Laboratory - UFMG - Brazil.
|
||||
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 4.5.0.
|
||||
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 4.3.2.
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
@ -51,37 +51,37 @@
|
||||
<span class="sd">"""</span>
|
||||
|
||||
<span class="kn">import</span> <span class="nn">numpy</span> <span class="k">as</span> <span class="nn">np</span>
|
||||
<span class="kn">from</span> <span class="nn">pyFTS</span> <span class="k">import</span> <span class="o">*</span>
|
||||
<span class="kn">from</span> <span class="nn">pyFTS.common</span> <span class="k">import</span> <span class="n">FuzzySet</span> <span class="k">as</span> <span class="n">FS</span><span class="p">,</span> <span class="n">Membership</span><span class="p">,</span> <span class="n">FLR</span>
|
||||
<span class="kn">from</span> <span class="nn">pyFTS.partitioners</span> <span class="k">import</span> <span class="n">partitioner</span>
|
||||
<span class="kn">from</span> <span class="nn">pyFTS.models.nonstationary</span> <span class="k">import</span> <span class="n">perturbation</span>
|
||||
<span class="kn">from</span> <span class="nn">pyFTS</span> <span class="kn">import</span> <span class="o">*</span>
|
||||
<span class="kn">from</span> <span class="nn">pyFTS.common</span> <span class="kn">import</span> <span class="n">FuzzySet</span> <span class="k">as</span> <span class="n">FS</span><span class="p">,</span> <span class="n">Membership</span><span class="p">,</span> <span class="n">FLR</span>
|
||||
<span class="kn">from</span> <span class="nn">pyFTS.partitioners</span> <span class="kn">import</span> <span class="n">partitioner</span>
|
||||
<span class="kn">from</span> <span class="nn">pyFTS.models.nonstationary</span> <span class="kn">import</span> <span class="n">perturbation</span>
|
||||
|
||||
|
||||
<div class="viewcode-block" id="FuzzySet"><a class="viewcode-back" href="../../../../pyFTS.models.nonstationary.html#pyFTS.models.nonstationary.common.FuzzySet">[docs]</a><span class="k">class</span> <span class="nc">FuzzySet</span><span class="p">(</span><span class="n">FS</span><span class="o">.</span><span class="n">FuzzySet</span><span class="p">):</span>
|
||||
<span class="sd">"""</span>
|
||||
<span class="w"> </span><span class="sd">"""</span>
|
||||
<span class="sd"> Non Stationary Fuzzy Sets</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="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="k">def</span> <span class="fm">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">name</span><span class="p">,</span> <span class="n">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="w"> </span><span class="sd">"""</span>
|
||||
<span class="sd"> Constructor</span>
|
||||
<span class="sd"> """</span>
|
||||
<span class="nb">super</span><span class="p">(</span><span class="n">FuzzySet</span><span class="p">,</span> <span class="bp">self</span><span class="p">)</span><span class="o">.</span><span class="fm">__init__</span><span class="p">(</span><span class="n">name</span><span class="o">=</span><span class="n">name</span><span class="p">,</span> <span class="n">mf</span><span class="o">=</span><span class="n">mf</span><span class="p">,</span> <span class="n">parameters</span><span class="o">=</span><span class="n">parameters</span><span class="p">,</span> <span class="n">centroid</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">alpha</span><span class="o">=</span><span class="mf">1.0</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">)</span>
|
||||
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">location</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">"location"</span><span class="p">,</span> <span class="kc">None</span><span class="p">)</span>
|
||||
<span class="sd">"""Pertubation function that affects the location of the membership function"""</span>
|
||||
<span class="w"> </span><span class="sd">"""Pertubation function that affects the location of the membership function"""</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">location_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="s2">"location_params"</span><span class="p">,</span> <span class="kc">None</span><span class="p">)</span>
|
||||
<span class="sd">"""Parameters for location pertubation function"""</span>
|
||||
<span class="w"> </span><span class="sd">"""Parameters for location pertubation function"""</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">location_roots</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">"location_roots"</span><span class="p">,</span> <span class="mi">0</span><span class="p">)</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">width</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">"width"</span><span class="p">,</span> <span class="kc">None</span><span class="p">)</span>
|
||||
<span class="sd">"""Pertubation function that affects the width of the membership function"""</span>
|
||||
<span class="w"> </span><span class="sd">"""Pertubation function that affects the width of the membership function"""</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">width_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="s2">"width_params"</span><span class="p">,</span> <span class="kc">None</span><span class="p">)</span>
|
||||
<span class="sd">"""Parameters for width pertubation function"""</span>
|
||||
<span class="w"> </span><span class="sd">"""Parameters for width pertubation function"""</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">width_roots</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">"width_roots"</span><span class="p">,</span> <span class="mi">0</span><span class="p">)</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">noise</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">"noise"</span><span class="p">,</span> <span class="kc">None</span><span class="p">)</span>
|
||||
<span class="sd">"""Pertubation function that adds noise on the membership function"""</span>
|
||||
<span class="w"> </span><span class="sd">"""Pertubation function that adds noise on the membership function"""</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">noise_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="s2">"noise_params"</span><span class="p">,</span> <span class="kc">None</span><span class="p">)</span>
|
||||
<span class="sd">"""Parameters for noise pertubation function"""</span>
|
||||
<span class="w"> </span><span class="sd">"""Parameters for noise pertubation function"""</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">perturbated_parameters</span> <span class="o">=</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="s1">'nonstationary'</span>
|
||||
|
||||
@ -141,7 +141,7 @@
|
||||
<span class="k">return</span> <span class="n">param</span></div>
|
||||
|
||||
<div class="viewcode-block" id="FuzzySet.membership"><a class="viewcode-back" href="../../../../pyFTS.models.nonstationary.html#pyFTS.models.nonstationary.common.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="n">t</span><span class="p">):</span>
|
||||
<span class="sd">"""</span>
|
||||
<span class="w"> </span><span class="sd">"""</span>
|
||||
<span class="sd"> Calculate the membership value of a given input</span>
|
||||
|
||||
<span class="sd"> :param x: input value</span>
|
||||
@ -217,7 +217,7 @@
|
||||
<span class="k">else</span><span class="p">:</span>
|
||||
<span class="k">return</span> <span class="n">param</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="fm">__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="s2">""</span>
|
||||
<span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">location</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span>
|
||||
<span class="n">tmp</span> <span class="o">+=</span> <span class="s2">"Location: "</span>
|
||||
@ -232,7 +232,7 @@
|
||||
|
||||
|
||||
<div class="viewcode-block" id="fuzzify"><a class="viewcode-back" href="../../../../pyFTS.models.nonstationary.html#pyFTS.models.nonstationary.common.fuzzify">[docs]</a><span class="k">def</span> <span class="nf">fuzzify</span><span class="p">(</span><span class="n">inst</span><span class="p">,</span> <span class="n">t</span><span class="p">,</span> <span class="n">fuzzySets</span><span class="p">):</span>
|
||||
<span class="sd">"""</span>
|
||||
<span class="w"> </span><span class="sd">"""</span>
|
||||
<span class="sd"> Calculate the membership values for a data point given nonstationary fuzzy sets</span>
|
||||
|
||||
<span class="sd"> :param inst: data points</span>
|
||||
@ -323,7 +323,7 @@
|
||||
</div>
|
||||
<div class="footer" role="contentinfo">
|
||||
© Copyright 2022, Machine Intelligence and Data Science Laboratory - UFMG - Brazil.
|
||||
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 4.5.0.
|
||||
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 4.3.2.
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
@ -44,8 +44,8 @@
|
||||
|
||||
<h1>Source code for pyFTS.models.nonstationary.flrg</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">flrg</span>
|
||||
<span class="kn">from</span> <span class="nn">pyFTS.models.nonstationary</span> <span class="k">import</span> <span class="n">common</span>
|
||||
<span class="kn">from</span> <span class="nn">pyFTS.common</span> <span class="kn">import</span> <span class="n">flrg</span>
|
||||
<span class="kn">from</span> <span class="nn">pyFTS.models.nonstationary</span> <span class="kn">import</span> <span class="n">common</span>
|
||||
<span class="kn">import</span> <span class="nn">numpy</span> <span class="k">as</span> <span class="nn">np</span>
|
||||
|
||||
|
||||
@ -63,7 +63,7 @@
|
||||
|
||||
<span class="k">return</span> <span class="p">(</span><span class="n">sets</span><span class="p">,</span> <span class="n">t</span><span class="p">,</span> <span class="n">w</span><span class="p">)</span></div>
|
||||
|
||||
<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">LHS</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="fm">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">LHS</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">NonStationaryFLRG</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="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">LHS</span> <span class="o">=</span> <span class="n">LHS</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">RHS</span> <span class="o">=</span> <span class="nb">set</span><span class="p">()</span>
|
||||
@ -154,7 +154,7 @@
|
||||
</div>
|
||||
<div class="footer" role="contentinfo">
|
||||
© Copyright 2022, Machine Intelligence and Data Science Laboratory - UFMG - Brazil.
|
||||
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 4.5.0.
|
||||
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 4.3.2.
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
@ -44,18 +44,18 @@
|
||||
|
||||
<h1>Source code for pyFTS.models.nonstationary.partitioners</h1><div class="highlight"><pre>
|
||||
<span></span><span class="kn">import</span> <span class="nn">numpy</span> <span class="k">as</span> <span class="nn">np</span>
|
||||
<span class="kn">from</span> <span class="nn">pyFTS.partitioners</span> <span class="k">import</span> <span class="n">partitioner</span>
|
||||
<span class="kn">from</span> <span class="nn">pyFTS.models.nonstationary</span> <span class="k">import</span> <span class="n">common</span><span class="p">,</span> <span class="n">perturbation</span>
|
||||
<span class="kn">from</span> <span class="nn">pyFTS.common</span> <span class="k">import</span> <span class="n">FuzzySet</span> <span class="k">as</span> <span class="n">stationary_fs</span>
|
||||
<span class="kn">from</span> <span class="nn">pyFTS.partitioners</span> <span class="kn">import</span> <span class="n">partitioner</span>
|
||||
<span class="kn">from</span> <span class="nn">pyFTS.models.nonstationary</span> <span class="kn">import</span> <span class="n">common</span><span class="p">,</span> <span class="n">perturbation</span>
|
||||
<span class="kn">from</span> <span class="nn">pyFTS.common</span> <span class="kn">import</span> <span class="n">FuzzySet</span> <span class="k">as</span> <span class="n">stationary_fs</span>
|
||||
|
||||
|
||||
<div class="viewcode-block" id="PolynomialNonStationaryPartitioner"><a class="viewcode-back" href="../../../../pyFTS.models.nonstationary.html#pyFTS.models.nonstationary.partitioners.PolynomialNonStationaryPartitioner">[docs]</a><span class="k">class</span> <span class="nc">PolynomialNonStationaryPartitioner</span><span class="p">(</span><span class="n">partitioner</span><span class="o">.</span><span class="n">Partitioner</span><span class="p">):</span>
|
||||
<span class="sd">"""</span>
|
||||
<span class="w"> </span><span class="sd">"""</span>
|
||||
<span class="sd"> Non Stationary Universe of Discourse Partitioner</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">data</span><span class="p">,</span> <span class="n">part</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
|
||||
<span class="sd">""""""</span>
|
||||
<span class="k">def</span> <span class="fm">__init__</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">part</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
|
||||
<span class="w"> </span><span class="sd">""""""</span>
|
||||
<span class="nb">super</span><span class="p">(</span><span class="n">PolynomialNonStationaryPartitioner</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="o">=</span><span class="n">part</span><span class="o">.</span><span class="n">name</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">npart</span><span class="o">=</span><span class="n">part</span><span class="o">.</span><span class="n">partitions</span><span class="p">,</span>
|
||||
<span class="n">func</span><span class="o">=</span><span class="n">part</span><span class="o">.</span><span class="n">membership_function</span><span class="p">,</span> <span class="n">names</span><span class="o">=</span><span class="n">part</span><span class="o">.</span><span class="n">setnames</span><span class="p">,</span>
|
||||
<span class="n">prefix</span><span class="o">=</span><span class="n">part</span><span class="o">.</span><span class="n">prefix</span><span class="p">,</span> <span class="n">transformation</span><span class="o">=</span><span class="n">part</span><span class="o">.</span><span class="n">transformation</span><span class="p">,</span>
|
||||
@ -155,12 +155,12 @@
|
||||
|
||||
|
||||
<div class="viewcode-block" id="SimpleNonStationaryPartitioner"><a class="viewcode-back" href="../../../../pyFTS.models.nonstationary.html#pyFTS.models.nonstationary.partitioners.SimpleNonStationaryPartitioner">[docs]</a><span class="k">class</span> <span class="nc">SimpleNonStationaryPartitioner</span><span class="p">(</span><span class="n">partitioner</span><span class="o">.</span><span class="n">Partitioner</span><span class="p">):</span>
|
||||
<span class="sd">"""</span>
|
||||
<span class="w"> </span><span class="sd">"""</span>
|
||||
<span class="sd"> Non Stationary Universe of Discourse Partitioner</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">data</span><span class="p">,</span> <span class="n">part</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
|
||||
<span class="sd">""""""</span>
|
||||
<span class="k">def</span> <span class="fm">__init__</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">part</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
|
||||
<span class="w"> </span><span class="sd">""""""</span>
|
||||
<span class="nb">super</span><span class="p">(</span><span class="n">SimpleNonStationaryPartitioner</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="o">=</span><span class="n">part</span><span class="o">.</span><span class="n">name</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">npart</span><span class="o">=</span><span class="n">part</span><span class="o">.</span><span class="n">partitions</span><span class="p">,</span>
|
||||
<span class="n">func</span><span class="o">=</span><span class="n">part</span><span class="o">.</span><span class="n">membership_function</span><span class="p">,</span> <span class="n">names</span><span class="o">=</span><span class="n">part</span><span class="o">.</span><span class="n">setnames</span><span class="p">,</span>
|
||||
<span class="n">prefix</span><span class="o">=</span><span class="n">part</span><span class="o">.</span><span class="n">prefix</span><span class="p">,</span> <span class="n">transformation</span><span class="o">=</span><span class="n">part</span><span class="o">.</span><span class="n">transformation</span><span class="p">,</span>
|
||||
@ -181,8 +181,8 @@
|
||||
|
||||
|
||||
<div class="viewcode-block" id="simplenonstationary_gridpartitioner_builder"><a class="viewcode-back" href="../../../../pyFTS.models.nonstationary.html#pyFTS.models.nonstationary.partitioners.simplenonstationary_gridpartitioner_builder">[docs]</a><span class="k">def</span> <span class="nf">simplenonstationary_gridpartitioner_builder</span><span class="p">(</span><span class="n">data</span><span class="p">,</span> <span class="n">npart</span><span class="p">,</span> <span class="n">transformation</span><span class="p">):</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.nonstationary</span> <span class="k">import</span> <span class="n">perturbation</span><span class="p">,</span> <span class="n">partitioners</span>
|
||||
<span class="kn">from</span> <span class="nn">pyFTS.partitioners</span> <span class="kn">import</span> <span class="n">Grid</span>
|
||||
<span class="kn">from</span> <span class="nn">pyFTS.models.nonstationary</span> <span class="kn">import</span> <span class="n">perturbation</span><span class="p">,</span> <span class="n">partitioners</span>
|
||||
|
||||
<span class="n">tmp_fs</span> <span class="o">=</span> <span class="n">Grid</span><span class="o">.</span><span class="n">GridPartitioner</span><span class="p">(</span><span class="n">data</span><span class="o">=</span><span class="n">data</span><span class="p">,</span> <span class="n">npart</span><span class="o">=</span><span class="n">npart</span><span class="p">,</span> <span class="n">transformation</span><span class="o">=</span><span class="n">transformation</span><span class="p">)</span>
|
||||
<span class="n">fs</span> <span class="o">=</span> <span class="n">partitioners</span><span class="o">.</span><span class="n">SimpleNonStationaryPartitioner</span><span class="p">(</span><span class="n">data</span><span class="p">,</span> <span class="n">tmp_fs</span><span class="p">,</span>
|
||||
@ -231,7 +231,7 @@
|
||||
</div>
|
||||
<div class="footer" role="contentinfo">
|
||||
© Copyright 2022, Machine Intelligence and Data Science Laboratory - UFMG - Brazil.
|
||||
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 4.5.0.
|
||||
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 4.3.2.
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
@ -48,8 +48,8 @@
|
||||
<span class="sd">"""</span>
|
||||
|
||||
<span class="kn">import</span> <span class="nn">numpy</span> <span class="k">as</span> <span class="nn">np</span>
|
||||
<span class="kn">from</span> <span class="nn">pyFTS</span> <span class="k">import</span> <span class="o">*</span>
|
||||
<span class="kn">from</span> <span class="nn">pyFTS.common</span> <span class="k">import</span> <span class="n">FuzzySet</span><span class="p">,</span> <span class="n">Membership</span>
|
||||
<span class="kn">from</span> <span class="nn">pyFTS</span> <span class="kn">import</span> <span class="o">*</span>
|
||||
<span class="kn">from</span> <span class="nn">pyFTS.common</span> <span class="kn">import</span> <span class="n">FuzzySet</span><span class="p">,</span> <span class="n">Membership</span>
|
||||
|
||||
|
||||
<div class="viewcode-block" id="linear"><a class="viewcode-back" href="../../../../pyFTS.models.nonstationary.html#pyFTS.models.nonstationary.perturbation.linear">[docs]</a><span class="k">def</span> <span class="nf">linear</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="n">parameters</span><span class="p">):</span>
|
||||
@ -104,7 +104,7 @@
|
||||
</div>
|
||||
<div class="footer" role="contentinfo">
|
||||
© Copyright 2022, Machine Intelligence and Data Science Laboratory - UFMG - Brazil.
|
||||
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 4.5.0.
|
||||
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 4.3.2.
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
@ -45,14 +45,14 @@
|
||||
<h1>Source code for pyFTS.models.seasonal.SeasonalIndexer</h1><div class="highlight"><pre>
|
||||
<span></span><span class="kn">import</span> <span class="nn">numpy</span> <span class="k">as</span> <span class="nn">np</span>
|
||||
<span class="kn">import</span> <span class="nn">pandas</span> <span class="k">as</span> <span class="nn">pd</span>
|
||||
<span class="kn">from</span> <span class="nn">pyFTS.models.seasonal</span> <span class="k">import</span> <span class="n">common</span>
|
||||
<span class="kn">from</span> <span class="nn">pyFTS.models.seasonal</span> <span class="kn">import</span> <span class="n">common</span>
|
||||
|
||||
|
||||
<div class="viewcode-block" id="SeasonalIndexer"><a class="viewcode-back" href="../../../../pyFTS.models.seasonal.html#pyFTS.models.seasonal.SeasonalIndexer.SeasonalIndexer">[docs]</a><span class="k">class</span> <span class="nc">SeasonalIndexer</span><span class="p">(</span><span class="nb">object</span><span class="p">):</span>
|
||||
<span class="sd">"""</span>
|
||||
<span class="w"> </span><span class="sd">"""</span>
|
||||
<span class="sd"> Seasonal Indexer. Responsible to find the seasonal index of a data point inside its data set</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">num_seasons</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="fm">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span><span class="n">num_seasons</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">num_seasons</span> <span class="o">=</span> <span class="n">num_seasons</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">name</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">"name"</span><span class="p">,</span><span class="s2">""</span><span class="p">)</span>
|
||||
|
||||
@ -76,9 +76,9 @@
|
||||
|
||||
|
||||
<div class="viewcode-block" id="LinearSeasonalIndexer"><a class="viewcode-back" href="../../../../pyFTS.models.seasonal.html#pyFTS.models.seasonal.SeasonalIndexer.LinearSeasonalIndexer">[docs]</a><span class="k">class</span> <span class="nc">LinearSeasonalIndexer</span><span class="p">(</span><span class="n">SeasonalIndexer</span><span class="p">):</span>
|
||||
<span class="sd">"""Use the data array/list position to index the seasonality """</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">seasons</span><span class="p">,</span> <span class="n">units</span><span class="p">,</span> <span class="n">ignore</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
|
||||
<span class="sd">"""</span>
|
||||
<span class="w"> </span><span class="sd">"""Use the data array/list position to index the seasonality """</span>
|
||||
<span class="k">def</span> <span class="fm">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">seasons</span><span class="p">,</span> <span class="n">units</span><span class="p">,</span> <span class="n">ignore</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
|
||||
<span class="w"> </span><span class="sd">"""</span>
|
||||
<span class="sd"> Indexer for array/list position</span>
|
||||
<span class="sd"> :param seasons: A list with the season group (i.e: 7 for week, 30 for month, etc)</span>
|
||||
<span class="sd"> :param units: A list with the units used for each season group, the default is 1 for each</span>
|
||||
@ -134,9 +134,9 @@
|
||||
|
||||
|
||||
<div class="viewcode-block" id="DataFrameSeasonalIndexer"><a class="viewcode-back" href="../../../../pyFTS.models.seasonal.html#pyFTS.models.seasonal.SeasonalIndexer.DataFrameSeasonalIndexer">[docs]</a><span class="k">class</span> <span class="nc">DataFrameSeasonalIndexer</span><span class="p">(</span><span class="n">SeasonalIndexer</span><span class="p">):</span>
|
||||
<span class="sd">"""Use the Pandas.DataFrame index position to index the seasonality """</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">index_fields</span><span class="p">,</span><span class="n">index_seasons</span><span class="p">,</span> <span class="n">data_field</span><span class="p">,</span><span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
|
||||
<span class="sd">"""</span>
|
||||
<span class="w"> </span><span class="sd">"""Use the Pandas.DataFrame index position to index the seasonality """</span>
|
||||
<span class="k">def</span> <span class="fm">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span><span class="n">index_fields</span><span class="p">,</span><span class="n">index_seasons</span><span class="p">,</span> <span class="n">data_field</span><span class="p">,</span><span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
|
||||
<span class="w"> </span><span class="sd">"""</span>
|
||||
|
||||
<span class="sd"> :param index_fields: DataFrame field to use as index</span>
|
||||
<span class="sd"> :param index_seasons: A list with the season group, i. e., multiples of positions that are considered a season (i.e: 7 for week, 30 for month, etc)</span>
|
||||
@ -186,9 +186,9 @@
|
||||
|
||||
|
||||
<div class="viewcode-block" id="DateTimeSeasonalIndexer"><a class="viewcode-back" href="../../../../pyFTS.models.seasonal.html#pyFTS.models.seasonal.SeasonalIndexer.DateTimeSeasonalIndexer">[docs]</a><span class="k">class</span> <span class="nc">DateTimeSeasonalIndexer</span><span class="p">(</span><span class="n">SeasonalIndexer</span><span class="p">):</span>
|
||||
<span class="sd">"""Use a Pandas.DataFrame date field to index the seasonality """</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">date_field</span><span class="p">,</span> <span class="n">index_fields</span><span class="p">,</span> <span class="n">index_seasons</span><span class="p">,</span> <span class="n">data_field</span><span class="p">,</span><span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
|
||||
<span class="sd">"""</span>
|
||||
<span class="w"> </span><span class="sd">"""Use a Pandas.DataFrame date field to index the seasonality """</span>
|
||||
<span class="k">def</span> <span class="fm">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span><span class="n">date_field</span><span class="p">,</span> <span class="n">index_fields</span><span class="p">,</span> <span class="n">index_seasons</span><span class="p">,</span> <span class="n">data_field</span><span class="p">,</span><span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
|
||||
<span class="w"> </span><span class="sd">"""</span>
|
||||
|
||||
<span class="sd"> :param date_field: DataFrame field that contains the datetime field used on index</span>
|
||||
<span class="sd"> :param index_fields: List with commom.DataTime fields</span>
|
||||
@ -283,7 +283,7 @@
|
||||
</div>
|
||||
<div class="footer" role="contentinfo">
|
||||
© Copyright 2022, Machine Intelligence and Data Science Laboratory - UFMG - Brazil.
|
||||
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 4.5.0.
|
||||
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 4.3.2.
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
@ -45,14 +45,14 @@
|
||||
<h1>Source code for pyFTS.models.seasonal.common</h1><div class="highlight"><pre>
|
||||
<span></span><span class="kn">import</span> <span class="nn">numpy</span> <span class="k">as</span> <span class="nn">np</span>
|
||||
<span class="kn">import</span> <span class="nn">pandas</span> <span class="k">as</span> <span class="nn">pd</span>
|
||||
<span class="kn">from</span> <span class="nn">enum</span> <span class="k">import</span> <span class="n">Enum</span>
|
||||
<span class="kn">from</span> <span class="nn">pyFTS.common</span> <span class="k">import</span> <span class="n">FuzzySet</span><span class="p">,</span> <span class="n">Membership</span>
|
||||
<span class="kn">from</span> <span class="nn">pyFTS.partitioners</span> <span class="k">import</span> <span class="n">partitioner</span><span class="p">,</span> <span class="n">Grid</span>
|
||||
<span class="kn">from</span> <span class="nn">datetime</span> <span class="k">import</span> <span class="n">date</span> <span class="k">as</span> <span class="n">dt</span><span class="p">,</span> <span class="n">datetime</span> <span class="k">as</span> <span class="n">dtm</span>
|
||||
<span class="kn">from</span> <span class="nn">enum</span> <span class="kn">import</span> <span class="n">Enum</span>
|
||||
<span class="kn">from</span> <span class="nn">pyFTS.common</span> <span class="kn">import</span> <span class="n">FuzzySet</span><span class="p">,</span> <span class="n">Membership</span>
|
||||
<span class="kn">from</span> <span class="nn">pyFTS.partitioners</span> <span class="kn">import</span> <span class="n">partitioner</span><span class="p">,</span> <span class="n">Grid</span>
|
||||
<span class="kn">from</span> <span class="nn">datetime</span> <span class="kn">import</span> <span class="n">date</span> <span class="k">as</span> <span class="n">dt</span><span class="p">,</span> <span class="n">datetime</span> <span class="k">as</span> <span class="n">dtm</span>
|
||||
|
||||
|
||||
<div class="viewcode-block" id="DateTime"><a class="viewcode-back" href="../../../../pyFTS.models.seasonal.html#pyFTS.models.seasonal.common.DateTime">[docs]</a><span class="k">class</span> <span class="nc">DateTime</span><span class="p">(</span><span class="n">Enum</span><span class="p">):</span>
|
||||
<span class="sd">"""</span>
|
||||
<span class="w"> </span><span class="sd">"""</span>
|
||||
<span class="sd"> Data and Time granularity for time granularity and seasonality identification</span>
|
||||
<span class="sd"> """</span>
|
||||
<span class="n">year</span> <span class="o">=</span> <span class="mi">1</span>
|
||||
@ -140,11 +140,11 @@
|
||||
|
||||
|
||||
<div class="viewcode-block" id="FuzzySet"><a class="viewcode-back" href="../../../../pyFTS.models.seasonal.html#pyFTS.models.seasonal.common.FuzzySet">[docs]</a><span class="k">class</span> <span class="nc">FuzzySet</span><span class="p">(</span><span class="n">FuzzySet</span><span class="o">.</span><span class="n">FuzzySet</span><span class="p">):</span>
|
||||
<span class="sd">"""</span>
|
||||
<span class="w"> </span><span class="sd">"""</span>
|
||||
<span class="sd"> Temporal/Seasonal Fuzzy Set</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">datepart</span><span class="p">,</span> <span class="n">name</span><span class="p">,</span> <span class="n">mf</span><span class="p">,</span> <span class="n">parameters</span><span class="p">,</span> <span class="n">centroid</span><span class="p">,</span> <span class="n">alpha</span><span class="o">=</span><span class="mf">1.0</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
|
||||
<span class="k">def</span> <span class="fm">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">datepart</span><span class="p">,</span> <span class="n">name</span><span class="p">,</span> <span class="n">mf</span><span class="p">,</span> <span class="n">parameters</span><span class="p">,</span> <span class="n">centroid</span><span class="p">,</span> <span class="n">alpha</span><span class="o">=</span><span class="mf">1.0</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
|
||||
<span class="nb">super</span><span class="p">(</span><span class="n">FuzzySet</span><span class="p">,</span> <span class="bp">self</span><span class="p">)</span><span class="o">.</span><span class="fm">__init__</span><span class="p">(</span><span class="n">name</span><span class="p">,</span> <span class="n">mf</span><span class="p">,</span> <span class="n">parameters</span><span class="p">,</span> <span class="n">centroid</span><span class="p">,</span> <span class="n">alpha</span><span class="p">,</span>
|
||||
<span class="o">**</span><span class="n">kwargs</span><span class="p">)</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">datepart</span> <span class="o">=</span> <span class="n">datepart</span>
|
||||
@ -195,7 +195,7 @@
|
||||
</div>
|
||||
<div class="footer" role="contentinfo">
|
||||
© Copyright 2022, Machine Intelligence and Data Science Laboratory - UFMG - Brazil.
|
||||
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 4.5.0.
|
||||
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 4.3.2.
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
@ -43,20 +43,20 @@
|
||||
<div class="body" role="main">
|
||||
|
||||
<h1>Source code for pyFTS.models.seasonal.partitioner</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">Membership</span><span class="p">,</span> <span class="n">FuzzySet</span> <span class="k">as</span> <span class="n">FS</span>
|
||||
<span class="kn">from</span> <span class="nn">pyFTS.common.Composite</span> <span class="k">import</span> <span class="n">FuzzySet</span> <span class="k">as</span> <span class="n">Composite</span>
|
||||
<span class="kn">from</span> <span class="nn">pyFTS.partitioners</span> <span class="k">import</span> <span class="n">partitioner</span><span class="p">,</span> <span class="n">Grid</span>
|
||||
<span class="kn">from</span> <span class="nn">pyFTS.models.seasonal.common</span> <span class="k">import</span> <span class="n">DateTime</span><span class="p">,</span> <span class="n">FuzzySet</span><span class="p">,</span> <span class="n">strip_datepart</span>
|
||||
<span></span><span class="kn">from</span> <span class="nn">pyFTS.common</span> <span class="kn">import</span> <span class="n">Membership</span><span class="p">,</span> <span class="n">FuzzySet</span> <span class="k">as</span> <span class="n">FS</span>
|
||||
<span class="kn">from</span> <span class="nn">pyFTS.common.Composite</span> <span class="kn">import</span> <span class="n">FuzzySet</span> <span class="k">as</span> <span class="n">Composite</span>
|
||||
<span class="kn">from</span> <span class="nn">pyFTS.partitioners</span> <span class="kn">import</span> <span class="n">partitioner</span><span class="p">,</span> <span class="n">Grid</span>
|
||||
<span class="kn">from</span> <span class="nn">pyFTS.models.seasonal.common</span> <span class="kn">import</span> <span class="n">DateTime</span><span class="p">,</span> <span class="n">FuzzySet</span><span class="p">,</span> <span class="n">strip_datepart</span>
|
||||
<span class="kn">import</span> <span class="nn">numpy</span> <span class="k">as</span> <span class="nn">np</span>
|
||||
<span class="kn">import</span> <span class="nn">matplotlib.pylab</span> <span class="k">as</span> <span class="nn">plt</span>
|
||||
<span class="kn">from</span> <span class="nn">scipy.spatial</span> <span class="k">import</span> <span class="n">KDTree</span>
|
||||
<span class="kn">from</span> <span class="nn">scipy.spatial</span> <span class="kn">import</span> <span class="n">KDTree</span>
|
||||
|
||||
|
||||
<div class="viewcode-block" id="TimeGridPartitioner"><a class="viewcode-back" href="../../../../pyFTS.models.seasonal.html#pyFTS.models.seasonal.partitioner.TimeGridPartitioner">[docs]</a><span class="k">class</span> <span class="nc">TimeGridPartitioner</span><span class="p">(</span><span class="n">partitioner</span><span class="o">.</span><span class="n">Partitioner</span><span class="p">):</span>
|
||||
<span class="sd">"""Even Length DateTime Grid Partitioner"""</span>
|
||||
<span class="w"> </span><span class="sd">"""Even Length DateTime Grid Partitioner"""</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="k">def</span> <span class="fm">__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="w"> </span><span class="sd">"""</span>
|
||||
<span class="sd"> Even Length Grid Partitioner</span>
|
||||
<span class="sd"> :param seasonality: Time granularity, from pyFTS.models.seasonal.common.DateTime</span>
|
||||
<span class="sd"> :param data: Training data of which the universe of discourse will be extracted. The universe of discourse is the open interval between the minimum and maximum values of the training data.</span>
|
||||
@ -66,9 +66,9 @@
|
||||
<span class="nb">super</span><span class="p">(</span><span class="n">TimeGridPartitioner</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="o">=</span><span class="s2">"TimeGrid"</span><span class="p">,</span> <span class="n">preprocess</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">)</span>
|
||||
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">season</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">'seasonality'</span><span class="p">,</span> <span class="n">DateTime</span><span class="o">.</span><span class="n">day_of_year</span><span class="p">)</span>
|
||||
<span class="sd">'''Seasonality, a pyFTS.models.seasonal.common.DateTime object'''</span>
|
||||
<span class="w"> </span><span class="sd">'''Seasonality, a pyFTS.models.seasonal.common.DateTime object'''</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="s1">'%Y-%m-</span><span class="si">%d</span><span class="s1"> %H:%M:%S'</span><span class="p">)</span>
|
||||
<span class="sd">'''A string with datetime formating mask'''</span>
|
||||
<span class="w"> </span><span class="sd">'''A string with datetime formating mask'''</span>
|
||||
|
||||
<span class="n">data</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'</span><span class="p">,</span> <span class="kc">None</span><span class="p">)</span>
|
||||
<span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">season</span> <span class="o">==</span> <span class="n">DateTime</span><span class="o">.</span><span class="n">year</span><span class="p">:</span>
|
||||
@ -193,7 +193,7 @@
|
||||
<span class="n">sys</span><span class="o">.</span><span class="n">setrecursionlimit</span><span class="p">(</span><span class="mi">1000</span><span class="p">)</span></div>
|
||||
|
||||
<div class="viewcode-block" id="TimeGridPartitioner.search"><a class="viewcode-back" href="../../../../pyFTS.models.seasonal.html#pyFTS.models.seasonal.partitioner.TimeGridPartitioner.search">[docs]</a> <span class="k">def</span> <span class="nf">search</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="sd">'''</span>
|
||||
<span class="w"> </span><span class="sd">'''</span>
|
||||
<span class="sd"> Perform a search for the nearest fuzzy sets of the point 'data'. This function were designed to work with several</span>
|
||||
<span class="sd"> overlapped fuzzy sets.</span>
|
||||
|
||||
@ -225,7 +225,7 @@
|
||||
|
||||
|
||||
<div class="viewcode-block" id="TimeGridPartitioner.plot"><a class="viewcode-back" href="../../../../pyFTS.models.seasonal.html#pyFTS.models.seasonal.partitioner.TimeGridPartitioner.plot">[docs]</a> <span class="k">def</span> <span class="nf">plot</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">ax</span><span class="p">):</span>
|
||||
<span class="sd">"""</span>
|
||||
<span class="w"> </span><span class="sd">"""</span>
|
||||
<span class="sd"> Plot the</span>
|
||||
<span class="sd"> :param ax:</span>
|
||||
<span class="sd"> :return:</span>
|
||||
@ -284,7 +284,7 @@
|
||||
</div>
|
||||
<div class="footer" role="contentinfo">
|
||||
© Copyright 2022, Machine Intelligence and Data Science Laboratory - UFMG - Brazil.
|
||||
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 4.5.0.
|
||||
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 4.3.2.
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
@ -47,8 +47,8 @@
|
||||
<span class="kn">import</span> <span class="nn">math</span>
|
||||
<span class="kn">import</span> <span class="nn">random</span> <span class="k">as</span> <span class="nn">rnd</span>
|
||||
<span class="kn">import</span> <span class="nn">functools</span><span class="o">,</span> <span class="nn">operator</span>
|
||||
<span class="kn">from</span> <span class="nn">pyFTS.common</span> <span class="k">import</span> <span class="n">FuzzySet</span><span class="p">,</span> <span class="n">Membership</span>
|
||||
<span class="kn">from</span> <span class="nn">pyFTS.partitioners</span> <span class="k">import</span> <span class="n">partitioner</span>
|
||||
<span class="kn">from</span> <span class="nn">pyFTS.common</span> <span class="kn">import</span> <span class="n">FuzzySet</span><span class="p">,</span> <span class="n">Membership</span>
|
||||
<span class="kn">from</span> <span class="nn">pyFTS.partitioners</span> <span class="kn">import</span> <span class="n">partitioner</span>
|
||||
|
||||
|
||||
<div class="viewcode-block" id="distance"><a class="viewcode-back" href="../../../pyFTS.partitioners.html#pyFTS.partitioners.CMeans.distance">[docs]</a><span class="k">def</span> <span class="nf">distance</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="n">y</span><span class="p">):</span>
|
||||
@ -123,7 +123,7 @@
|
||||
|
||||
|
||||
<div class="viewcode-block" id="CMeansPartitioner"><a class="viewcode-back" href="../../../pyFTS.partitioners.html#pyFTS.partitioners.CMeans.CMeansPartitioner">[docs]</a><span class="k">class</span> <span class="nc">CMeansPartitioner</span><span class="p">(</span><span class="n">partitioner</span><span class="o">.</span><span class="n">Partitioner</span><span class="p">):</span>
|
||||
<span class="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="fm">__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">CMeansPartitioner</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="o">=</span><span class="s2">"CMeans"</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">)</span>
|
||||
|
||||
<div class="viewcode-block" id="CMeansPartitioner.build"><a class="viewcode-back" href="../../../pyFTS.partitioners.html#pyFTS.partitioners.CMeans.CMeansPartitioner.build">[docs]</a> <span class="k">def</span> <span class="nf">build</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">data</span><span class="p">):</span>
|
||||
@ -181,7 +181,7 @@
|
||||
</div>
|
||||
<div class="footer" role="contentinfo">
|
||||
© Copyright 2022, Machine Intelligence and Data Science Laboratory - UFMG - Brazil.
|
||||
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 4.5.0.
|
||||
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 4.3.2.
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
123
docs/build/html/_modules/pyFTS/partitioners/ClassPartitioner.html
vendored
Normal file
123
docs/build/html/_modules/pyFTS/partitioners/ClassPartitioner.html
vendored
Normal file
@ -0,0 +1,123 @@
|
||||
|
||||
|
||||
<!doctype html>
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>pyFTS.partitioners.ClassPartitioner — pyFTS 1.7 documentation</title>
|
||||
<link rel="stylesheet" type="text/css" href="../../../_static/pygments.css" />
|
||||
<link rel="stylesheet" type="text/css" href="../../../_static/bizstyle.css" />
|
||||
|
||||
<script data-url_root="../../../" id="documentation_options" src="../../../_static/documentation_options.js"></script>
|
||||
<script src="../../../_static/jquery.js"></script>
|
||||
<script src="../../../_static/underscore.js"></script>
|
||||
<script src="../../../_static/doctools.js"></script>
|
||||
<script src="../../../_static/bizstyle.js"></script>
|
||||
<link rel="index" title="Index" href="../../../genindex.html" />
|
||||
<link rel="search" title="Search" href="../../../search.html" />
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1.0" />
|
||||
<!--[if lt IE 9]>
|
||||
<script src="_static/css3-mediaqueries.js"></script>
|
||||
<![endif]-->
|
||||
</head><body>
|
||||
<div class="related" role="navigation" aria-label="related navigation">
|
||||
<h3>Navigation</h3>
|
||||
<ul>
|
||||
<li class="right" style="margin-right: 10px">
|
||||
<a href="../../../genindex.html" title="General Index"
|
||||
accesskey="I">index</a></li>
|
||||
<li class="right" >
|
||||
<a href="../../../py-modindex.html" title="Python Module Index"
|
||||
>modules</a> |</li>
|
||||
<li class="nav-item nav-item-0"><a href="../../../index.html">pyFTS 1.7 documentation</a> »</li>
|
||||
<li class="nav-item nav-item-1"><a href="../../index.html" accesskey="U">Module code</a> »</li>
|
||||
<li class="nav-item nav-item-this"><a href="">pyFTS.partitioners.ClassPartitioner</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="document">
|
||||
<div class="documentwrapper">
|
||||
<div class="bodywrapper">
|
||||
<div class="body" role="main">
|
||||
|
||||
<h1>Source code for pyFTS.partitioners.ClassPartitioner</h1><div class="highlight"><pre>
|
||||
<span></span><span class="sd">"""Class Partitioner with Singleton Fuzzy Sets"""</span>
|
||||
|
||||
<span class="kn">import</span> <span class="nn">numpy</span> <span class="k">as</span> <span class="nn">np</span>
|
||||
<span class="kn">import</span> <span class="nn">math</span>
|
||||
<span class="kn">import</span> <span class="nn">random</span> <span class="k">as</span> <span class="nn">rnd</span>
|
||||
<span class="kn">import</span> <span class="nn">functools</span><span class="o">,</span> <span class="nn">operator</span>
|
||||
<span class="kn">from</span> <span class="nn">pyFTS.common</span> <span class="kn">import</span> <span class="n">FuzzySet</span><span class="p">,</span> <span class="n">Membership</span>
|
||||
<span class="kn">from</span> <span class="nn">pyFTS.partitioners</span> <span class="kn">import</span> <span class="n">partitioner</span>
|
||||
|
||||
|
||||
<div class="viewcode-block" id="ClassPartitioner"><a class="viewcode-back" href="../../../pyFTS.partitioners.html#pyFTS.partitioners.ClassPartitioner.ClassPartitioner">[docs]</a><span class="k">class</span> <span class="nc">ClassPartitioner</span><span class="p">(</span><span class="n">partitioner</span><span class="o">.</span><span class="n">Partitioner</span><span class="p">):</span>
|
||||
<span class="w"> </span><span class="sd">"""Class Partitioner: Given a dictionary with class/values pairs, create singleton fuzzy sets for each class"""</span>
|
||||
|
||||
<span class="k">def</span> <span class="fm">__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="w"> </span><span class="sd">"""</span>
|
||||
<span class="sd"> Class Partitioner</span>
|
||||
<span class="sd"> """</span>
|
||||
<span class="nb">super</span><span class="p">(</span><span class="n">ClassPartitioner</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="o">=</span><span class="s2">"Class"</span><span class="p">,</span> <span class="n">preprocess</span> <span class="o">=</span> <span class="kc">False</span><span class="p">)</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="bp">self</span><span class="o">.</span><span class="n">min</span> <span class="o">=</span> <span class="mi">0</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">max</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>
|
||||
|
||||
<span class="n">classes</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">"classes"</span><span class="p">,</span> <span class="p">{})</span>
|
||||
|
||||
<span class="k">for</span> <span class="n">k</span><span class="p">,</span><span class="n">v</span> <span class="ow">in</span> <span class="n">classes</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">min</span> <span class="o">=</span> <span class="nb">min</span><span class="p">([</span><span class="bp">self</span><span class="o">.</span><span class="n">min</span><span class="p">,</span> <span class="n">v</span><span class="p">])</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">max</span> <span class="o">=</span> <span class="nb">max</span><span class="p">([</span><span class="bp">self</span><span class="o">.</span><span class="n">max</span><span class="p">,</span> <span class="n">v</span><span class="p">])</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">sets</span><span class="p">[</span><span class="n">k</span><span class="p">]</span> <span class="o">=</span> <span class="n">FuzzySet</span><span class="o">.</span><span class="n">FuzzySet</span><span class="p">(</span><span class="n">k</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="p">[</span><span class="n">v</span><span class="p">],</span> <span class="n">v</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">ordered_sets</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">k</span><span class="p">)</span>
|
||||
|
||||
<div class="viewcode-block" id="ClassPartitioner.build"><a class="viewcode-back" href="../../../pyFTS.partitioners.html#pyFTS.partitioners.ClassPartitioner.ClassPartitioner.build">[docs]</a> <span class="k">def</span> <span class="nf">build</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">data</span> <span class="p">:</span> <span class="nb">list</span><span class="p">):</span>
|
||||
<span class="k">pass</span></div></div>
|
||||
</pre></div>
|
||||
|
||||
<div class="clearer"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
|
||||
<div class="sphinxsidebarwrapper">
|
||||
<div id="searchbox" style="display: none" role="search">
|
||||
<h3 id="searchlabel">Quick search</h3>
|
||||
<div class="searchformwrapper">
|
||||
<form class="search" action="../../../search.html" method="get">
|
||||
<input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
|
||||
<input type="submit" value="Go" />
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<script>$('#searchbox').show(0);</script>
|
||||
</div>
|
||||
</div>
|
||||
<div class="clearer"></div>
|
||||
</div>
|
||||
<div class="related" role="navigation" aria-label="related navigation">
|
||||
<h3>Navigation</h3>
|
||||
<ul>
|
||||
<li class="right" style="margin-right: 10px">
|
||||
<a href="../../../genindex.html" title="General Index"
|
||||
>index</a></li>
|
||||
<li class="right" >
|
||||
<a href="../../../py-modindex.html" title="Python Module Index"
|
||||
>modules</a> |</li>
|
||||
<li class="nav-item nav-item-0"><a href="../../../index.html">pyFTS 1.7 documentation</a> »</li>
|
||||
<li class="nav-item nav-item-1"><a href="../../index.html" >Module code</a> »</li>
|
||||
<li class="nav-item nav-item-this"><a href="">pyFTS.partitioners.ClassPartitioner</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="footer" role="contentinfo">
|
||||
© Copyright 2022, Machine Intelligence and Data Science Laboratory - UFMG - Brazil.
|
||||
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 4.3.2.
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
@ -52,8 +52,8 @@
|
||||
<span class="kn">import</span> <span class="nn">math</span>
|
||||
<span class="kn">import</span> <span class="nn">random</span> <span class="k">as</span> <span class="nn">rnd</span>
|
||||
<span class="kn">import</span> <span class="nn">functools</span><span class="o">,</span> <span class="nn">operator</span>
|
||||
<span class="kn">from</span> <span class="nn">pyFTS.common</span> <span class="k">import</span> <span class="n">FuzzySet</span><span class="p">,</span> <span class="n">Membership</span>
|
||||
<span class="kn">from</span> <span class="nn">pyFTS.partitioners</span> <span class="k">import</span> <span class="n">partitioner</span>
|
||||
<span class="kn">from</span> <span class="nn">pyFTS.common</span> <span class="kn">import</span> <span class="n">FuzzySet</span><span class="p">,</span> <span class="n">Membership</span>
|
||||
<span class="kn">from</span> <span class="nn">pyFTS.partitioners</span> <span class="kn">import</span> <span class="n">partitioner</span>
|
||||
|
||||
|
||||
<div class="viewcode-block" id="splitBelow"><a class="viewcode-back" href="../../../pyFTS.partitioners.html#pyFTS.partitioners.Entropy.splitBelow">[docs]</a><span class="k">def</span> <span class="nf">splitBelow</span><span class="p">(</span><span class="n">data</span><span class="p">,</span><span class="n">threshold</span><span class="p">):</span>
|
||||
@ -125,8 +125,8 @@
|
||||
|
||||
|
||||
<div class="viewcode-block" id="EntropyPartitioner"><a class="viewcode-back" href="../../../pyFTS.partitioners.html#pyFTS.partitioners.Entropy.EntropyPartitioner">[docs]</a><span class="k">class</span> <span class="nc">EntropyPartitioner</span><span class="p">(</span><span class="n">partitioner</span><span class="o">.</span><span class="n">Partitioner</span><span class="p">):</span>
|
||||
<span class="sd">"""Huarng Entropy Partitioner"""</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="w"> </span><span class="sd">"""Huarng Entropy Partitioner"""</span>
|
||||
<span class="k">def</span> <span class="fm">__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">EntropyPartitioner</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="o">=</span><span class="s2">"Entropy"</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">)</span>
|
||||
|
||||
<div class="viewcode-block" id="EntropyPartitioner.build"><a class="viewcode-back" href="../../../pyFTS.partitioners.html#pyFTS.partitioners.Entropy.EntropyPartitioner.build">[docs]</a> <span class="k">def</span> <span class="nf">build</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">data</span><span class="p">):</span>
|
||||
@ -191,7 +191,7 @@
|
||||
</div>
|
||||
<div class="footer" role="contentinfo">
|
||||
© Copyright 2022, Machine Intelligence and Data Science Laboratory - UFMG - Brazil.
|
||||
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 4.5.0.
|
||||
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 4.3.2.
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
@ -52,8 +52,8 @@
|
||||
<span class="kn">import</span> <span class="nn">math</span>
|
||||
<span class="kn">import</span> <span class="nn">random</span> <span class="k">as</span> <span class="nn">rnd</span>
|
||||
<span class="kn">import</span> <span class="nn">functools</span><span class="o">,</span> <span class="nn">operator</span>
|
||||
<span class="kn">from</span> <span class="nn">pyFTS.common</span> <span class="k">import</span> <span class="n">FuzzySet</span><span class="p">,</span> <span class="n">Membership</span>
|
||||
<span class="kn">from</span> <span class="nn">pyFTS.partitioners</span> <span class="k">import</span> <span class="n">partitioner</span>
|
||||
<span class="kn">from</span> <span class="nn">pyFTS.common</span> <span class="kn">import</span> <span class="n">FuzzySet</span><span class="p">,</span> <span class="n">Membership</span>
|
||||
<span class="kn">from</span> <span class="nn">pyFTS.partitioners</span> <span class="kn">import</span> <span class="n">partitioner</span>
|
||||
|
||||
|
||||
<div class="viewcode-block" id="fuzzy_distance"><a class="viewcode-back" href="../../../pyFTS.partitioners.html#pyFTS.partitioners.FCM.fuzzy_distance">[docs]</a><span class="k">def</span> <span class="nf">fuzzy_distance</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="n">y</span><span class="p">):</span>
|
||||
@ -136,11 +136,11 @@
|
||||
|
||||
|
||||
<div class="viewcode-block" id="FCMPartitioner"><a class="viewcode-back" href="../../../pyFTS.partitioners.html#pyFTS.partitioners.FCM.FCMPartitioner">[docs]</a><span class="k">class</span> <span class="nc">FCMPartitioner</span><span class="p">(</span><span class="n">partitioner</span><span class="o">.</span><span class="n">Partitioner</span><span class="p">):</span>
|
||||
<span class="sd">"""</span>
|
||||
<span class="w"> </span><span class="sd">"""</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="o">**</span><span class="n">kwargs</span><span class="p">):</span>
|
||||
<span class="k">def</span> <span class="fm">__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">FCMPartitioner</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="o">=</span><span class="s2">"FCM"</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">)</span>
|
||||
|
||||
<div class="viewcode-block" id="FCMPartitioner.build"><a class="viewcode-back" href="../../../pyFTS.partitioners.html#pyFTS.partitioners.FCM.FCMPartitioner.build">[docs]</a> <span class="k">def</span> <span class="nf">build</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">data</span><span class="p">):</span>
|
||||
@ -207,7 +207,7 @@
|
||||
</div>
|
||||
<div class="footer" role="contentinfo">
|
||||
© Copyright 2022, Machine Intelligence and Data Science Laboratory - UFMG - Brazil.
|
||||
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 4.5.0.
|
||||
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 4.3.2.
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
@ -49,15 +49,15 @@
|
||||
<span class="kn">import</span> <span class="nn">math</span>
|
||||
<span class="kn">import</span> <span class="nn">random</span> <span class="k">as</span> <span class="nn">rnd</span>
|
||||
<span class="kn">import</span> <span class="nn">functools</span><span class="o">,</span> <span class="nn">operator</span>
|
||||
<span class="kn">from</span> <span class="nn">pyFTS.common</span> <span class="k">import</span> <span class="n">FuzzySet</span><span class="p">,</span> <span class="n">Membership</span>
|
||||
<span class="kn">from</span> <span class="nn">pyFTS.partitioners</span> <span class="k">import</span> <span class="n">partitioner</span>
|
||||
<span class="kn">from</span> <span class="nn">pyFTS.common</span> <span class="kn">import</span> <span class="n">FuzzySet</span><span class="p">,</span> <span class="n">Membership</span>
|
||||
<span class="kn">from</span> <span class="nn">pyFTS.partitioners</span> <span class="kn">import</span> <span class="n">partitioner</span>
|
||||
|
||||
|
||||
<div class="viewcode-block" id="GridPartitioner"><a class="viewcode-back" href="../../../pyFTS.partitioners.html#pyFTS.partitioners.Grid.GridPartitioner">[docs]</a><span class="k">class</span> <span class="nc">GridPartitioner</span><span class="p">(</span><span class="n">partitioner</span><span class="o">.</span><span class="n">Partitioner</span><span class="p">):</span>
|
||||
<span class="sd">"""Even Length Grid Partitioner"""</span>
|
||||
<span class="w"> </span><span class="sd">"""Even Length Grid Partitioner"""</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="k">def</span> <span class="fm">__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="w"> </span><span class="sd">"""</span>
|
||||
<span class="sd"> Even Length Grid Partitioner</span>
|
||||
<span class="sd"> """</span>
|
||||
<span class="nb">super</span><span class="p">(</span><span class="n">GridPartitioner</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="o">=</span><span class="s2">"Grid"</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">)</span>
|
||||
@ -67,11 +67,12 @@
|
||||
|
||||
<span class="n">kwargs</span> <span class="o">=</span> <span class="p">{</span><span class="s1">'type'</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">type</span><span class="p">,</span> <span class="s1">'variable'</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">variable</span><span class="p">}</span>
|
||||
|
||||
<span class="n">dlen</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">max</span> <span class="o">-</span> <span class="bp">self</span><span class="o">.</span><span class="n">min</span>
|
||||
<span class="n">partlen</span> <span class="o">=</span> <span class="n">dlen</span> <span class="o">/</span> <span class="bp">self</span><span class="o">.</span><span class="n">partitions</span>
|
||||
<span class="c1">#dlen = self.max - self.min</span>
|
||||
<span class="c1">#partlen = dlen / self.partitions</span>
|
||||
|
||||
<span class="n">count</span> <span class="o">=</span> <span class="mi">0</span>
|
||||
<span class="k">for</span> <span class="n">c</span> <span class="ow">in</span> <span class="n">np</span><span class="o">.</span><span class="n">arange</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">min</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">max</span><span class="p">,</span> <span class="n">partlen</span><span class="p">):</span>
|
||||
<span class="n">centers</span><span class="p">,</span> <span class="n">partlen</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">linspace</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">min</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">max</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">partitions</span><span class="p">,</span> <span class="n">retstep</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
|
||||
<span class="k">for</span> <span class="n">c</span> <span class="ow">in</span> <span class="n">centers</span><span class="p">:</span>
|
||||
<span class="n">_name</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">get_name</span><span class="p">(</span><span class="n">count</span><span class="p">)</span>
|
||||
<span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">membership_function</span> <span class="o">==</span> <span class="n">Membership</span><span class="o">.</span><span class="n">trimf</span><span class="p">:</span>
|
||||
<span class="n">sets</span><span class="p">[</span><span class="n">_name</span><span class="p">]</span> <span class="o">=</span> <span class="n">FuzzySet</span><span class="o">.</span><span class="n">FuzzySet</span><span class="p">(</span><span class="n">_name</span><span class="p">,</span> <span class="n">Membership</span><span class="o">.</span><span class="n">trimf</span><span class="p">,</span> <span class="p">[</span><span class="n">c</span> <span class="o">-</span> <span class="n">partlen</span><span class="p">,</span> <span class="n">c</span><span class="p">,</span> <span class="n">c</span> <span class="o">+</span> <span class="n">partlen</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>
|
||||
@ -88,10 +89,10 @@
|
||||
|
||||
|
||||
<div class="viewcode-block" id="PreFixedGridPartitioner"><a class="viewcode-back" href="../../../pyFTS.partitioners.html#pyFTS.partitioners.Grid.PreFixedGridPartitioner">[docs]</a><span class="k">class</span> <span class="nc">PreFixedGridPartitioner</span><span class="p">(</span><span class="n">GridPartitioner</span><span class="p">):</span>
|
||||
<span class="sd">"""Prefixed UoD with Even Length Grid Partitioner"""</span>
|
||||
<span class="w"> </span><span class="sd">"""Prefixed UoD with Even Length Grid Partitioner"""</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="k">def</span> <span class="fm">__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="w"> </span><span class="sd">"""</span>
|
||||
<span class="sd"> Fixed UoD with Even Length Grid Partitioner</span>
|
||||
<span class="sd"> """</span>
|
||||
|
||||
@ -156,7 +157,7 @@
|
||||
</div>
|
||||
<div class="footer" role="contentinfo">
|
||||
© Copyright 2022, Machine Intelligence and Data Science Laboratory - UFMG - Brazil.
|
||||
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 4.5.0.
|
||||
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 4.3.2.
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
@ -49,15 +49,15 @@
|
||||
<span class="kn">import</span> <span class="nn">math</span>
|
||||
<span class="kn">import</span> <span class="nn">random</span> <span class="k">as</span> <span class="nn">rnd</span>
|
||||
<span class="kn">import</span> <span class="nn">functools</span><span class="o">,</span> <span class="nn">operator</span>
|
||||
<span class="kn">from</span> <span class="nn">pyFTS.common</span> <span class="k">import</span> <span class="n">FuzzySet</span><span class="p">,</span> <span class="n">Membership</span>
|
||||
<span class="kn">from</span> <span class="nn">pyFTS.partitioners</span> <span class="k">import</span> <span class="n">partitioner</span>
|
||||
<span class="kn">from</span> <span class="nn">pyFTS.common</span> <span class="kn">import</span> <span class="n">FuzzySet</span><span class="p">,</span> <span class="n">Membership</span>
|
||||
<span class="kn">from</span> <span class="nn">pyFTS.partitioners</span> <span class="kn">import</span> <span class="n">partitioner</span>
|
||||
|
||||
|
||||
<div class="viewcode-block" id="SimplePartitioner"><a class="viewcode-back" href="../../../pyFTS.partitioners.html#pyFTS.partitioners.Simple.SimplePartitioner">[docs]</a><span class="k">class</span> <span class="nc">SimplePartitioner</span><span class="p">(</span><span class="n">partitioner</span><span class="o">.</span><span class="n">Partitioner</span><span class="p">):</span>
|
||||
<span class="sd">"""Simple Partitioner for manually informed fuzzy sets"""</span>
|
||||
<span class="w"> </span><span class="sd">"""Simple Partitioner for manually informed fuzzy sets"""</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="k">def</span> <span class="fm">__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="w"> </span><span class="sd">"""</span>
|
||||
<span class="sd"> Simple Partitioner - the fuzzy sets are informed manually</span>
|
||||
<span class="sd"> """</span>
|
||||
<span class="n">kwargs</span><span class="p">[</span><span class="s1">'preprocess'</span><span class="p">]</span> <span class="o">=</span> <span class="kc">False</span>
|
||||
@ -76,7 +76,7 @@
|
||||
<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>
|
||||
<span class="sd">"""</span>
|
||||
<span class="w"> </span><span class="sd">"""</span>
|
||||
<span class="sd"> Append a new partition (fuzzy set) to the partitioner</span>
|
||||
|
||||
<span class="sd"> :param name: Fuzzy set name</span>
|
||||
@ -168,7 +168,7 @@
|
||||
</div>
|
||||
<div class="footer" role="contentinfo">
|
||||
© Copyright 2022, Machine Intelligence and Data Science Laboratory - UFMG - Brazil.
|
||||
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 4.5.0.
|
||||
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 4.3.2.
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
@ -49,15 +49,15 @@
|
||||
<span class="kn">import</span> <span class="nn">math</span>
|
||||
<span class="kn">import</span> <span class="nn">random</span> <span class="k">as</span> <span class="nn">rnd</span>
|
||||
<span class="kn">import</span> <span class="nn">functools</span><span class="o">,</span> <span class="nn">operator</span>
|
||||
<span class="kn">from</span> <span class="nn">pyFTS.common</span> <span class="k">import</span> <span class="n">FuzzySet</span><span class="p">,</span> <span class="n">Membership</span>
|
||||
<span class="kn">from</span> <span class="nn">pyFTS.partitioners</span> <span class="k">import</span> <span class="n">partitioner</span>
|
||||
<span class="kn">from</span> <span class="nn">pyFTS.common</span> <span class="kn">import</span> <span class="n">FuzzySet</span><span class="p">,</span> <span class="n">Membership</span>
|
||||
<span class="kn">from</span> <span class="nn">pyFTS.partitioners</span> <span class="kn">import</span> <span class="n">partitioner</span>
|
||||
|
||||
|
||||
<div class="viewcode-block" id="SingletonPartitioner"><a class="viewcode-back" href="../../../pyFTS.partitioners.html#pyFTS.partitioners.Singleton.SingletonPartitioner">[docs]</a><span class="k">class</span> <span class="nc">SingletonPartitioner</span><span class="p">(</span><span class="n">partitioner</span><span class="o">.</span><span class="n">Partitioner</span><span class="p">):</span>
|
||||
<span class="sd">"""Singleton Partitioner: Create singleton fuzzy sets for each distinct value in UoD"""</span>
|
||||
<span class="w"> </span><span class="sd">"""Singleton Partitioner: Create singleton fuzzy sets for each distinct value in UoD"""</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="k">def</span> <span class="fm">__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="w"> </span><span class="sd">"""</span>
|
||||
<span class="sd"> Singleton Partitioner</span>
|
||||
<span class="sd"> """</span>
|
||||
<span class="nb">super</span><span class="p">(</span><span class="n">SingletonPartitioner</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="o">=</span><span class="s2">"Singleton"</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">)</span>
|
||||
@ -110,7 +110,7 @@
|
||||
</div>
|
||||
<div class="footer" role="contentinfo">
|
||||
© Copyright 2022, Machine Intelligence and Data Science Laboratory - UFMG - Brazil.
|
||||
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 4.5.0.
|
||||
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 4.3.2.
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
@ -51,8 +51,8 @@
|
||||
<span class="kn">import</span> <span class="nn">math</span>
|
||||
<span class="kn">import</span> <span class="nn">random</span> <span class="k">as</span> <span class="nn">rnd</span>
|
||||
<span class="kn">import</span> <span class="nn">functools</span><span class="o">,</span> <span class="nn">operator</span>
|
||||
<span class="kn">from</span> <span class="nn">pyFTS.common</span> <span class="k">import</span> <span class="n">FuzzySet</span><span class="p">,</span> <span class="n">Membership</span>
|
||||
<span class="kn">from</span> <span class="nn">pyFTS.partitioners</span> <span class="k">import</span> <span class="n">partitioner</span>
|
||||
<span class="kn">from</span> <span class="nn">pyFTS.common</span> <span class="kn">import</span> <span class="n">FuzzySet</span><span class="p">,</span> <span class="n">Membership</span>
|
||||
<span class="kn">from</span> <span class="nn">pyFTS.partitioners</span> <span class="kn">import</span> <span class="n">partitioner</span>
|
||||
|
||||
|
||||
<div class="viewcode-block" id="imax"><a class="viewcode-back" href="../../../pyFTS.partitioners.html#pyFTS.partitioners.SubClust.imax">[docs]</a><span class="k">def</span> <span class="nf">imax</span><span class="p">(</span><span class="n">vec</span><span class="p">):</span>
|
||||
@ -105,8 +105,8 @@
|
||||
|
||||
|
||||
<div class="viewcode-block" id="SubClustPartitioner"><a class="viewcode-back" href="../../../pyFTS.partitioners.html#pyFTS.partitioners.SubClust.SubClustPartitioner">[docs]</a><span class="k">class</span> <span class="nc">SubClustPartitioner</span><span class="p">(</span><span class="n">partitioner</span><span class="o">.</span><span class="n">Partitioner</span><span class="p">):</span>
|
||||
<span class="sd">"""Subtractive Clustering Partitioner"""</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="w"> </span><span class="sd">"""Subtractive Clustering Partitioner"""</span>
|
||||
<span class="k">def</span> <span class="fm">__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="bp">self</span><span class="o">.</span><span class="n">ra</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">'ra'</span><span class="p">,</span> <span class="mf">0.8</span><span class="p">)</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">rb</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">'rb'</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">ra</span> <span class="o">*</span> <span class="mf">1.5</span><span class="p">)</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">eps_sup</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">'eps_sup'</span><span class="p">,</span> <span class="mf">0.5</span><span class="p">)</span>
|
||||
@ -177,7 +177,7 @@
|
||||
</div>
|
||||
<div class="footer" role="contentinfo">
|
||||
© Copyright 2022, Machine Intelligence and Data Science Laboratory - UFMG - Brazil.
|
||||
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 4.5.0.
|
||||
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 4.3.2.
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
@ -43,49 +43,49 @@
|
||||
<div class="body" role="main">
|
||||
|
||||
<h1>Source code for pyFTS.partitioners.partitioner</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">FuzzySet</span><span class="p">,</span> <span class="n">Membership</span>
|
||||
<span></span><span class="kn">from</span> <span class="nn">pyFTS.common</span> <span class="kn">import</span> <span class="n">FuzzySet</span><span class="p">,</span> <span class="n">Membership</span>
|
||||
<span class="kn">import</span> <span class="nn">numpy</span> <span class="k">as</span> <span class="nn">np</span>
|
||||
<span class="kn">from</span> <span class="nn">scipy.spatial</span> <span class="k">import</span> <span class="n">KDTree</span>
|
||||
<span class="kn">from</span> <span class="nn">scipy.spatial</span> <span class="kn">import</span> <span class="n">KDTree</span>
|
||||
|
||||
|
||||
<div class="viewcode-block" id="Partitioner"><a class="viewcode-back" href="../../../pyFTS.partitioners.html#pyFTS.partitioners.partitioner.Partitioner">[docs]</a><span class="k">class</span> <span class="nc">Partitioner</span><span class="p">(</span><span class="nb">object</span><span class="p">):</span>
|
||||
<span class="sd">"""</span>
|
||||
<span class="w"> </span><span class="sd">"""</span>
|
||||
<span class="sd"> Universe of Discourse partitioner. Split data on several fuzzy sets</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="sd">"""</span>
|
||||
<span class="k">def</span> <span class="fm">__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="w"> </span><span class="sd">"""</span>
|
||||
<span class="sd"> Universe of Discourse partitioner scheme. Split data on several fuzzy sets</span>
|
||||
<span class="sd"> """</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">name</span> <span class="p">:</span> <span class="nb">str</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">'name'</span><span class="p">,</span><span class="s2">""</span><span class="p">)</span>
|
||||
<span class="sd">"""partitioner name"""</span>
|
||||
<span class="w"> </span><span class="sd">"""partitioner name"""</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">partitions</span> <span class="p">:</span> <span class="nb">int</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">'npart'</span><span class="p">,</span> <span class="mi">10</span><span class="p">)</span>
|
||||
<span class="sd">"""The number of universe of discourse partitions, i.e., the number of fuzzy sets that will be created"""</span>
|
||||
<span class="w"> </span><span class="sd">"""The number of universe of discourse partitions, i.e., the number of fuzzy sets that will be created"""</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">sets</span> <span class="p">:</span> <span class="nb">dict</span> <span class="o">=</span> <span class="p">{}</span>
|
||||
<span class="sd">"""The fuzzy sets dictionary"""</span>
|
||||
<span class="w"> </span><span class="sd">"""The fuzzy sets dictionary"""</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">membership_function</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">'func'</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="sd">"""Fuzzy membership function (pyFTS.common.Membership)"""</span>
|
||||
<span class="w"> </span><span class="sd">"""Fuzzy membership function (pyFTS.common.Membership)"""</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">setnames</span> <span class="p">:</span> <span class="nb">list</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">'names'</span><span class="p">,</span> <span class="kc">None</span><span class="p">)</span>
|
||||
<span class="sd">"""list of partitions names. If None is given the partitions will be auto named with prefix"""</span>
|
||||
<span class="w"> </span><span class="sd">"""list of partitions names. If None is given the partitions will be auto named with prefix"""</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">prefix</span> <span class="p">:</span> <span class="nb">str</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">'prefix'</span><span class="p">,</span> <span class="s1">'A'</span><span class="p">)</span>
|
||||
<span class="sd">"""prefix of auto generated partition names"""</span>
|
||||
<span class="w"> </span><span class="sd">"""prefix of auto generated partition names"""</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="sd">"""data transformation to be applied on data"""</span>
|
||||
<span class="w"> </span><span class="sd">"""data transformation to be applied on data"""</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">indexer</span> <span class="o">=</span> <span class="n">kwargs</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">'indexer'</span><span class="p">,</span> <span class="kc">None</span><span class="p">)</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">variable</span> <span class="o">=</span> <span class="n">kwargs</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">'variable'</span><span class="p">,</span> <span class="kc">None</span><span class="p">)</span>
|
||||
<span class="sd">"""In a multivariate context, the variable that contains this partitioner"""</span>
|
||||
<span class="w"> </span><span class="sd">"""In a multivariate context, the variable that contains this partitioner"""</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">type</span> <span class="p">:</span> <span class="nb">str</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="sd">"""The type of fuzzy sets that are generated by this partitioner"""</span>
|
||||
<span class="w"> </span><span class="sd">"""The type of fuzzy sets that are generated by this partitioner"""</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">ordered_sets</span> <span class="p">:</span> <span class="nb">list</span> <span class="o">=</span> <span class="kc">None</span>
|
||||
<span class="sd">"""A ordered list of the fuzzy sets names, sorted by their middle point"""</span>
|
||||
<span class="w"> </span><span class="sd">"""A ordered list of the fuzzy sets names, sorted by their middle point"""</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">kdtree</span> <span class="p">:</span> <span class="n">KDTree</span> <span class="o">=</span> <span class="kc">None</span>
|
||||
<span class="sd">"""A spatial index to help in fuzzyfication"""</span>
|
||||
<span class="w"> </span><span class="sd">"""A spatial index to help in fuzzyfication"""</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">margin</span> <span class="p">:</span> <span class="nb">float</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">"margin"</span><span class="p">,</span> <span class="mf">0.1</span><span class="p">)</span>
|
||||
<span class="sd">"""The upper and lower exceeding margins for the known UoD. The default value is .1"""</span>
|
||||
<span class="w"> </span><span class="sd">"""The upper and lower exceeding margins for the known UoD. The default value is .1"""</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">lower_margin</span> <span class="p">:</span> <span class="nb">float</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">"lower_margin"</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">margin</span><span class="p">)</span>
|
||||
<span class="sd">"""Specific lower exceeding margins for the known UoD. The default value is the self.margin parameter"""</span>
|
||||
<span class="w"> </span><span class="sd">"""Specific lower exceeding margins for the known UoD. The default value is the self.margin parameter"""</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">upper_margin</span> <span class="p">:</span> <span class="nb">float</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">"lower_margin"</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">margin</span><span class="p">)</span>
|
||||
<span class="sd">"""Specific upper exceeding margins for the known UoD. The default value is the self.margin parameter"""</span>
|
||||
<span class="w"> </span><span class="sd">"""Specific upper exceeding margins for the known UoD. The default value is the self.margin parameter"""</span>
|
||||
|
||||
<span class="k">if</span> <span class="n">kwargs</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s1">'preprocess'</span><span class="p">,</span><span class="kc">True</span><span class="p">):</span>
|
||||
|
||||
@ -126,11 +126,11 @@
|
||||
<span class="k">del</span><span class="p">(</span><span class="n">ndata</span><span class="p">)</span>
|
||||
|
||||
<div class="viewcode-block" id="Partitioner.extractor"><a class="viewcode-back" href="../../../pyFTS.partitioners.html#pyFTS.partitioners.partitioner.Partitioner.extractor">[docs]</a> <span class="k">def</span> <span class="nf">extractor</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">"""Extract a single primitive type from an structured instance"""</span>
|
||||
<span class="w"> </span><span class="sd">"""Extract a single primitive type from an structured instance"""</span>
|
||||
<span class="k">return</span> <span class="n">x</span></div>
|
||||
|
||||
<div class="viewcode-block" id="Partitioner.build"><a class="viewcode-back" href="../../../pyFTS.partitioners.html#pyFTS.partitioners.partitioner.Partitioner.build">[docs]</a> <span class="k">def</span> <span class="nf">build</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">data</span><span class="p">):</span>
|
||||
<span class="sd">"""</span>
|
||||
<span class="w"> </span><span class="sd">"""</span>
|
||||
<span class="sd"> Perform the partitioning of the Universe of Discourse</span>
|
||||
|
||||
<span class="sd"> :param data: training data</span>
|
||||
@ -139,7 +139,7 @@
|
||||
<span class="k">pass</span></div>
|
||||
|
||||
<div class="viewcode-block" id="Partitioner.get_name"><a class="viewcode-back" href="../../../pyFTS.partitioners.html#pyFTS.partitioners.partitioner.Partitioner.get_name">[docs]</a> <span class="k">def</span> <span class="nf">get_name</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">counter</span><span class="p">):</span>
|
||||
<span class="sd">"""</span>
|
||||
<span class="w"> </span><span class="sd">"""</span>
|
||||
<span class="sd"> Find the name of the fuzzy set given its counter id.</span>
|
||||
|
||||
<span class="sd"> :param counter: The number of the fuzzy set</span>
|
||||
@ -148,7 +148,7 @@
|
||||
<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">prefix</span> <span class="o">+</span> <span class="nb">str</span><span class="p">(</span><span class="n">counter</span><span class="p">)</span> <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">setnames</span> <span class="ow">is</span> <span class="kc">None</span> <span class="k">else</span> <span class="bp">self</span><span class="o">.</span><span class="n">setnames</span><span class="p">[</span><span class="n">counter</span><span class="p">]</span></div>
|
||||
|
||||
<div class="viewcode-block" id="Partitioner.lower_set"><a class="viewcode-back" href="../../../pyFTS.partitioners.html#pyFTS.partitioners.partitioner.Partitioner.lower_set">[docs]</a> <span class="k">def</span> <span class="nf">lower_set</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
|
||||
<span class="sd">"""</span>
|
||||
<span class="w"> </span><span class="sd">"""</span>
|
||||
<span class="sd"> Return the fuzzy set on lower bound of the universe of discourse.</span>
|
||||
|
||||
<span class="sd"> :return: Fuzzy Set</span>
|
||||
@ -156,7 +156,7 @@
|
||||
<span class="k">return</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></div>
|
||||
|
||||
<div class="viewcode-block" id="Partitioner.upper_set"><a class="viewcode-back" href="../../../pyFTS.partitioners.html#pyFTS.partitioners.partitioner.Partitioner.upper_set">[docs]</a> <span class="k">def</span> <span class="nf">upper_set</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
|
||||
<span class="sd">"""</span>
|
||||
<span class="w"> </span><span class="sd">"""</span>
|
||||
<span class="sd"> Return the fuzzy set on upper bound of the universe of discourse.</span>
|
||||
|
||||
<span class="sd"> :return: Fuzzy Set</span>
|
||||
@ -181,7 +181,7 @@
|
||||
<span class="n">sys</span><span class="o">.</span><span class="n">setrecursionlimit</span><span class="p">(</span><span class="mi">1000</span><span class="p">)</span></div>
|
||||
|
||||
<div class="viewcode-block" id="Partitioner.fuzzyfy"><a class="viewcode-back" href="../../../pyFTS.partitioners.html#pyFTS.partitioners.partitioner.Partitioner.fuzzyfy">[docs]</a> <span class="k">def</span> <span class="nf">fuzzyfy</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">data</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
|
||||
<span class="sd">"""</span>
|
||||
<span class="w"> </span><span class="sd">"""</span>
|
||||
<span class="sd"> Fuzzyfy the input data according to this partitioner fuzzy sets.</span>
|
||||
|
||||
<span class="sd"> :param data: input value to be fuzzyfied</span>
|
||||
@ -261,7 +261,7 @@
|
||||
<span class="k">return</span> <span class="n">np</span><span class="o">.</span><span class="n">nanmean</span><span class="p">(</span><span class="n">num</span><span class="p">)</span></div>
|
||||
|
||||
<div class="viewcode-block" id="Partitioner.check_bounds"><a class="viewcode-back" href="../../../pyFTS.partitioners.html#pyFTS.partitioners.partitioner.Partitioner.check_bounds">[docs]</a> <span class="k">def</span> <span class="nf">check_bounds</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="sd">"""</span>
|
||||
<span class="w"> </span><span class="sd">"""</span>
|
||||
<span class="sd"> Check if the input data is outside the known Universe of Discourse and, if it is, round it to the closest</span>
|
||||
<span class="sd"> fuzzy set.</span>
|
||||
|
||||
@ -276,7 +276,7 @@
|
||||
<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">partitions</span><span class="o">-</span><span class="mi">1</span></div>
|
||||
|
||||
<div class="viewcode-block" id="Partitioner.search"><a class="viewcode-back" href="../../../pyFTS.partitioners.html#pyFTS.partitioners.partitioner.Partitioner.search">[docs]</a> <span class="k">def</span> <span class="nf">search</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="sd">"""</span>
|
||||
<span class="w"> </span><span class="sd">"""</span>
|
||||
<span class="sd"> Perform a search for the nearest fuzzy sets of the point 'data'. This function were designed to work with several</span>
|
||||
<span class="sd"> overlapped fuzzy sets.</span>
|
||||
|
||||
@ -301,7 +301,7 @@
|
||||
|
||||
|
||||
<div class="viewcode-block" id="Partitioner.plot"><a class="viewcode-back" href="../../../pyFTS.partitioners.html#pyFTS.partitioners.partitioner.Partitioner.plot">[docs]</a> <span class="k">def</span> <span class="nf">plot</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">ax</span><span class="p">,</span> <span class="n">rounding</span><span class="o">=</span><span class="mi">0</span><span class="p">):</span>
|
||||
<span class="sd">"""</span>
|
||||
<span class="w"> </span><span class="sd">"""</span>
|
||||
<span class="sd"> Plot the partitioning using the Matplotlib axis ax</span>
|
||||
|
||||
<span class="sd"> :param ax: Matplotlib axis</span>
|
||||
@ -324,7 +324,7 @@
|
||||
<span class="n">ax</span><span class="o">.</span><span class="n">xaxis</span><span class="o">.</span><span class="n">set_ticks</span><span class="p">(</span><span class="n">x</span><span class="p">)</span></div>
|
||||
|
||||
<div class="viewcode-block" id="Partitioner.plot_set"><a class="viewcode-back" href="../../../pyFTS.partitioners.html#pyFTS.partitioners.partitioner.Partitioner.plot_set">[docs]</a> <span class="k">def</span> <span class="nf">plot_set</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">ax</span><span class="p">,</span> <span class="n">s</span><span class="p">):</span>
|
||||
<span class="sd">"""</span>
|
||||
<span class="w"> </span><span class="sd">"""</span>
|
||||
<span class="sd"> Plot an isolate fuzzy set on Matplotlib axis</span>
|
||||
|
||||
<span class="sd"> :param ax: Matplotlib axis</span>
|
||||
@ -341,8 +341,8 @@
|
||||
<span class="k">elif</span> <span class="n">s</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">singleton</span><span class="p">:</span>
|
||||
<span class="n">ax</span><span class="o">.</span><span class="n">plot</span><span class="p">([</span><span class="n">s</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="n">s</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="p">[</span><span class="mi">0</span><span class="p">,</span> <span class="n">s</span><span class="o">.</span><span class="n">alpha</span><span class="p">])</span></div>
|
||||
|
||||
<span class="k">def</span> <span class="nf">__str__</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
|
||||
<span class="sd">"""</span>
|
||||
<span class="k">def</span> <span class="fm">__str__</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
|
||||
<span class="w"> </span><span class="sd">"""</span>
|
||||
<span class="sd"> Return a string representation of the partitioner, the list of fuzzy sets and their parameters</span>
|
||||
|
||||
<span class="sd"> :return:</span>
|
||||
@ -352,23 +352,23 @@
|
||||
<span class="n">tmp</span> <span class="o">+=</span> <span class="nb">str</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">sets</span><span class="p">[</span><span class="n">key</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>
|
||||
|
||||
<span class="k">def</span> <span class="nf">__len__</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
|
||||
<span class="sd">"""</span>
|
||||
<span class="k">def</span> <span class="fm">__len__</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
|
||||
<span class="w"> </span><span class="sd">"""</span>
|
||||
<span class="sd"> Return the number of partitions</span>
|
||||
|
||||
<span class="sd"> :return: number of partitions</span>
|
||||
<span class="sd"> """</span>
|
||||
<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">partitions</span>
|
||||
|
||||
<span class="k">def</span> <span class="nf">__getitem__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">item</span><span class="p">):</span>
|
||||
<span class="sd">"""</span>
|
||||
<span class="k">def</span> <span class="fm">__getitem__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">item</span><span class="p">):</span>
|
||||
<span class="w"> </span><span class="sd">"""</span>
|
||||
<span class="sd"> Return a fuzzy set by its order or its name.</span>
|
||||
|
||||
<span class="sd"> :param item: If item is an integer then it represents the fuzzy set index (order), if it was a string then</span>
|
||||
<span class="sd"> it represents the fuzzy set name.</span>
|
||||
<span class="sd"> :return: the fuzzy set</span>
|
||||
<span class="sd"> """</span>
|
||||
<span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">item</span><span class="p">,</span> <span class="p">(</span><span class="nb">int</span><span class="p">,</span> <span class="n">np</span><span class="o">.</span><span class="n">int</span><span class="p">,</span> <span class="n">np</span><span class="o">.</span><span class="n">int8</span><span class="p">,</span> <span class="n">np</span><span class="o">.</span><span class="n">int16</span><span class="p">,</span> <span class="n">np</span><span class="o">.</span><span class="n">int32</span><span class="p">,</span> <span class="n">np</span><span class="o">.</span><span class="n">int64</span><span class="p">)):</span>
|
||||
<span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">item</span><span class="p">,</span> <span class="p">(</span><span class="nb">int</span><span class="p">,</span> <span class="n">np</span><span class="o">.</span><span class="n">int8</span><span class="p">,</span> <span class="n">np</span><span class="o">.</span><span class="n">int16</span><span class="p">,</span> <span class="n">np</span><span class="o">.</span><span class="n">int32</span><span class="p">,</span> <span class="n">np</span><span class="o">.</span><span class="n">int64</span><span class="p">)):</span>
|
||||
<span class="k">if</span> <span class="n">item</span> <span class="o"><</span> <span class="mi">0</span> <span class="ow">or</span> <span class="n">item</span> <span class="o">>=</span> <span class="bp">self</span><span class="o">.</span><span class="n">partitions</span><span class="p">:</span>
|
||||
<span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span><span class="s2">"The fuzzy set index must be between 0 and </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">partitions</span><span class="p">))</span>
|
||||
<span class="k">return</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="n">item</span><span class="p">]]</span>
|
||||
@ -380,8 +380,8 @@
|
||||
<span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span><span class="s2">"The parameter 'item' must be an integer or a string and the value informed was </span><span class="si">{}</span><span class="s2"> of type </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">item</span><span class="p">,</span> <span class="nb">type</span><span class="p">(</span><span class="n">item</span><span class="p">)))</span>
|
||||
|
||||
|
||||
<span class="k">def</span> <span class="nf">__iter__</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
|
||||
<span class="sd">"""</span>
|
||||
<span class="k">def</span> <span class="fm">__iter__</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
|
||||
<span class="w"> </span><span class="sd">"""</span>
|
||||
<span class="sd"> Iterate over the fuzzy sets, ordered by its midpoints.</span>
|
||||
|
||||
<span class="sd"> :return: An iterator over the fuzzy sets.</span>
|
||||
@ -427,7 +427,7 @@
|
||||
</div>
|
||||
<div class="footer" role="contentinfo">
|
||||
© Copyright 2022, Machine Intelligence and Data Science Laboratory - UFMG - Brazil.
|
||||
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 4.5.0.
|
||||
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 4.3.2.
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
@ -12,6 +12,14 @@ Module contents
|
||||
Submodules
|
||||
----------
|
||||
|
||||
pyFTS.common.Activations module
|
||||
-------------------------------
|
||||
|
||||
.. automodule:: pyFTS.common.Activations
|
||||
:members:
|
||||
:undoc-members:
|
||||
:show-inheritance:
|
||||
|
||||
pyFTS.common.Composite module
|
||||
-----------------------------
|
||||
|
||||
|
@ -20,6 +20,14 @@ pyFTS.partitioners.partitioner module
|
||||
:undoc-members:
|
||||
:show-inheritance:
|
||||
|
||||
pyFTS.partitioners.ClassPartitioner module
|
||||
-----------------------------------
|
||||
|
||||
.. automodule:: pyFTS.partitioners.ClassPartitioner
|
||||
:members:
|
||||
:undoc-members:
|
||||
:show-inheritance:
|
||||
|
||||
pyFTS.partitioners.CMeans module
|
||||
--------------------------------
|
||||
|
||||
|
3
docs/build/html/_static/basic.css
vendored
3
docs/build/html/_static/basic.css
vendored
@ -4,7 +4,7 @@
|
||||
*
|
||||
* Sphinx stylesheet -- basic theme.
|
||||
*
|
||||
* :copyright: Copyright 2007-2022 by the Sphinx team, see AUTHORS.
|
||||
* :copyright: Copyright 2007-2021 by the Sphinx team, see AUTHORS.
|
||||
* :license: BSD, see LICENSE for details.
|
||||
*
|
||||
*/
|
||||
@ -757,7 +757,6 @@ span.pre {
|
||||
-ms-hyphens: none;
|
||||
-webkit-hyphens: none;
|
||||
hyphens: none;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
div[class*="highlight-"] {
|
||||
|
51
docs/build/html/_static/doctools.js
vendored
51
docs/build/html/_static/doctools.js
vendored
@ -4,7 +4,7 @@
|
||||
*
|
||||
* Sphinx JavaScript utilities for all documentation.
|
||||
*
|
||||
* :copyright: Copyright 2007-2022 by the Sphinx team, see AUTHORS.
|
||||
* :copyright: Copyright 2007-2021 by the Sphinx team, see AUTHORS.
|
||||
* :license: BSD, see LICENSE for details.
|
||||
*
|
||||
*/
|
||||
@ -154,7 +154,9 @@ var Documentation = {
|
||||
this.fixFirefoxAnchorBug();
|
||||
this.highlightSearchWords();
|
||||
this.initIndexTable();
|
||||
if (DOCUMENTATION_OPTIONS.NAVIGATION_WITH_KEYS) {
|
||||
this.initOnKeyListeners();
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
@ -262,16 +264,6 @@ var Documentation = {
|
||||
hideSearchWords : function() {
|
||||
$('#searchbox .highlight-link').fadeOut(300);
|
||||
$('span.highlighted').removeClass('highlighted');
|
||||
var url = new URL(window.location);
|
||||
url.searchParams.delete('highlight');
|
||||
window.history.replaceState({}, '', url);
|
||||
},
|
||||
|
||||
/**
|
||||
* helper function to focus on search bar
|
||||
*/
|
||||
focusSearchBar : function() {
|
||||
$('input[name=q]').first().focus();
|
||||
},
|
||||
|
||||
/**
|
||||
@ -296,54 +288,27 @@ var Documentation = {
|
||||
},
|
||||
|
||||
initOnKeyListeners: function() {
|
||||
// only install a listener if it is really needed
|
||||
if (!DOCUMENTATION_OPTIONS.NAVIGATION_WITH_KEYS &&
|
||||
!DOCUMENTATION_OPTIONS.ENABLE_SEARCH_SHORTCUTS)
|
||||
return;
|
||||
|
||||
$(document).keydown(function(event) {
|
||||
var activeElementType = document.activeElement.tagName;
|
||||
// don't navigate when in search box, textarea, dropdown or button
|
||||
if (activeElementType !== 'TEXTAREA' && activeElementType !== 'INPUT' && activeElementType !== 'SELECT'
|
||||
&& activeElementType !== 'BUTTON') {
|
||||
if (event.altKey || event.ctrlKey || event.metaKey)
|
||||
return;
|
||||
|
||||
if (!event.shiftKey) {
|
||||
switch (event.key) {
|
||||
case 'ArrowLeft':
|
||||
if (!DOCUMENTATION_OPTIONS.NAVIGATION_WITH_KEYS)
|
||||
break;
|
||||
&& activeElementType !== 'BUTTON' && !event.altKey && !event.ctrlKey && !event.metaKey
|
||||
&& !event.shiftKey) {
|
||||
switch (event.keyCode) {
|
||||
case 37: // left
|
||||
var prevHref = $('link[rel="prev"]').prop('href');
|
||||
if (prevHref) {
|
||||
window.location.href = prevHref;
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
case 'ArrowRight':
|
||||
if (!DOCUMENTATION_OPTIONS.NAVIGATION_WITH_KEYS)
|
||||
break;
|
||||
case 39: // right
|
||||
var nextHref = $('link[rel="next"]').prop('href');
|
||||
if (nextHref) {
|
||||
window.location.href = nextHref;
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
case 'Escape':
|
||||
if (!DOCUMENTATION_OPTIONS.ENABLE_SEARCH_SHORTCUTS)
|
||||
break;
|
||||
Documentation.hideSearchWords();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// some keyboard layouts may need Shift to get /
|
||||
switch (event.key) {
|
||||
case '/':
|
||||
if (!DOCUMENTATION_OPTIONS.ENABLE_SEARCH_SHORTCUTS)
|
||||
break;
|
||||
Documentation.focusSearchBar();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@ -8,7 +8,5 @@ var DOCUMENTATION_OPTIONS = {
|
||||
LINK_SUFFIX: '.html',
|
||||
HAS_SOURCE: true,
|
||||
SOURCELINK_SUFFIX: '.txt',
|
||||
NAVIGATION_WITH_KEYS: false,
|
||||
SHOW_SEARCH_SUMMARY: true,
|
||||
ENABLE_SEARCH_SHORTCUTS: true,
|
||||
NAVIGATION_WITH_KEYS: false
|
||||
};
|
10881
docs/build/html/_static/jquery.js
vendored
10881
docs/build/html/_static/jquery.js
vendored
File diff suppressed because one or more lines are too long
2
docs/build/html/_static/language_data.js
vendored
2
docs/build/html/_static/language_data.js
vendored
@ -5,7 +5,7 @@
|
||||
* This script contains the language-specific data used by searchtools.js,
|
||||
* namely the list of stopwords, stemmer, scorer and splitter.
|
||||
*
|
||||
* :copyright: Copyright 2007-2022 by the Sphinx team, see AUTHORS.
|
||||
* :copyright: Copyright 2007-2021 by the Sphinx team, see AUTHORS.
|
||||
* :license: BSD, see LICENSE for details.
|
||||
*
|
||||
*/
|
||||
|
5
docs/build/html/_static/pygments.css
vendored
5
docs/build/html/_static/pygments.css
vendored
@ -1,3 +1,8 @@
|
||||
pre { line-height: 125%; }
|
||||
td.linenos .normal { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; }
|
||||
span.linenos { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; }
|
||||
td.linenos .special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
|
||||
span.linenos.special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
|
||||
.highlight .hll { background-color: #ffffcc }
|
||||
.highlight { background: #eeffcc; }
|
||||
.highlight .c { color: #408090; font-style: italic } /* Comment */
|
||||
|
13
docs/build/html/_static/searchtools.js
vendored
13
docs/build/html/_static/searchtools.js
vendored
@ -4,7 +4,7 @@
|
||||
*
|
||||
* Sphinx JavaScript utilities for the full-text search.
|
||||
*
|
||||
* :copyright: Copyright 2007-2022 by the Sphinx team, see AUTHORS.
|
||||
* :copyright: Copyright 2007-2021 by the Sphinx team, see AUTHORS.
|
||||
* :license: BSD, see LICENSE for details.
|
||||
*
|
||||
*/
|
||||
@ -172,6 +172,10 @@ var Search = {
|
||||
}
|
||||
// stem the word
|
||||
var word = stemmer.stemWord(tmp[i].toLowerCase());
|
||||
// prevent stemmer from cutting word smaller than two chars
|
||||
if(word.length < 3 && tmp[i].length >= 3) {
|
||||
word = tmp[i];
|
||||
}
|
||||
var toAppend;
|
||||
// select the correct list
|
||||
if (word[0] == '-') {
|
||||
@ -272,7 +276,7 @@ var Search = {
|
||||
setTimeout(function() {
|
||||
displayNextItem();
|
||||
}, 5);
|
||||
} else if (DOCUMENTATION_OPTIONS.SHOW_SEARCH_SUMMARY) {
|
||||
} else if (DOCUMENTATION_OPTIONS.HAS_SOURCE) {
|
||||
$.ajax({url: requestUrl,
|
||||
dataType: "text",
|
||||
complete: function(jqxhr, textstatus) {
|
||||
@ -289,7 +293,7 @@ var Search = {
|
||||
}, 5);
|
||||
}});
|
||||
} else {
|
||||
// just display title
|
||||
// no source available, just display title
|
||||
Search.output.append(listItem);
|
||||
setTimeout(function() {
|
||||
displayNextItem();
|
||||
@ -324,6 +328,9 @@ var Search = {
|
||||
var results = [];
|
||||
|
||||
for (var prefix in objects) {
|
||||
if (!(objects[prefix] instanceof Array)) {
|
||||
objects[prefix] = Object.entries(objects[prefix]).map(([name, match]) => [...match, name]);
|
||||
}
|
||||
for (var iMatch = 0; iMatch != objects[prefix].length; ++iMatch) {
|
||||
var match = objects[prefix][iMatch];
|
||||
var name = match[4];
|
||||
|
2042
docs/build/html/_static/underscore-1.13.1.js
vendored
Normal file
2042
docs/build/html/_static/underscore-1.13.1.js
vendored
Normal file
File diff suppressed because it is too large
Load Diff
2042
docs/build/html/_static/underscore.js
vendored
2042
docs/build/html/_static/underscore.js
vendored
File diff suppressed because one or more lines are too long
3816
docs/build/html/genindex.html
vendored
3816
docs/build/html/genindex.html
vendored
File diff suppressed because it is too large
Load Diff
25
docs/build/html/index.html
vendored
25
docs/build/html/index.html
vendored
@ -5,7 +5,8 @@
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.17.1: http://docutils.sourceforge.net/" />
|
||||
|
||||
<title>pyFTS - Fuzzy Time Series for Python — pyFTS 1.7 documentation</title>
|
||||
<link rel="stylesheet" type="text/css" href="_static/pygments.css" />
|
||||
<link rel="stylesheet" type="text/css" href="_static/bizstyle.css" />
|
||||
@ -45,9 +46,9 @@
|
||||
<div class="bodywrapper">
|
||||
<div class="body" role="main">
|
||||
|
||||
<div class="section" id="pyfts-fuzzy-time-series-for-python">
|
||||
<section id="pyfts-fuzzy-time-series-for-python">
|
||||
<h1>pyFTS - Fuzzy Time Series for Python<a class="headerlink" href="#pyfts-fuzzy-time-series-for-python" title="Permalink to this headline">¶</a></h1>
|
||||
<div class="section" id="what-is-pyfts-library">
|
||||
<section id="what-is-pyfts-library">
|
||||
<h2>What is pyFTS Library?<a class="headerlink" href="#what-is-pyfts-library" title="Permalink to this headline">¶</a></h2>
|
||||
<img alt="https://img.shields.io/badge/License-GPLv3-blue.svg" src="https://img.shields.io/badge/License-GPLv3-blue.svg" /><img alt="https://img.shields.io/badge/Made%20with-Python-1f425f.svg" src="https://img.shields.io/badge/Made%20with-Python-1f425f.svg" /><style>
|
||||
#forkongithub a{ background:#000; color:#fff; text-decoration:none; font-family:arial,sans-serif;
|
||||
@ -99,21 +100,21 @@ src="http://www.ifmg.edu.br/portal/imagens/logovertical.jpg" alt="IFMG" width="1
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="section" id="how-to-reference-pyfts">
|
||||
</section>
|
||||
<section id="how-to-reference-pyfts">
|
||||
<h2>How to reference pyFTS?<a class="headerlink" href="#how-to-reference-pyfts" title="Permalink to this headline">¶</a></h2>
|
||||
<a class="reference external image-reference" href="https://doi.org/10.5281/zenodo.597359"><img alt="https://zenodo.org/badge/DOI/10.5281/zenodo.597359.svg" src="https://zenodo.org/badge/DOI/10.5281/zenodo.597359.svg" /></a>
|
||||
<p>Silva, P. C. L. et al. <em>pyFTS: Fuzzy Time Series for Python.</em> Belo Horizonte. 2018. DOI: 10.5281/zenodo.597359. Url: <<a class="reference external" href="https://doi.org/10.5281/zenodo.597359">https://doi.org/10.5281/zenodo.597359</a>></p>
|
||||
</div>
|
||||
<div class="section" id="indexes">
|
||||
</section>
|
||||
<section id="indexes">
|
||||
<h2>Indexes<a class="headerlink" href="#indexes" title="Permalink to this headline">¶</a></h2>
|
||||
<ul class="simple">
|
||||
<li><p><a class="reference internal" href="genindex.html"><span class="std std-ref">Index</span></a></p></li>
|
||||
<li><p><a class="reference internal" href="py-modindex.html"><span class="std std-ref">Module Index</span></a></p></li>
|
||||
<li><p><a class="reference internal" href="search.html"><span class="std std-ref">Search Page</span></a></p></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</section>
|
||||
|
||||
|
||||
<div class="clearer"></div>
|
||||
@ -122,7 +123,6 @@ src="http://www.ifmg.edu.br/portal/imagens/logovertical.jpg" alt="IFMG" width="1
|
||||
</div>
|
||||
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
|
||||
<div class="sphinxsidebarwrapper">
|
||||
<div>
|
||||
<h3><a href="#">Table of Contents</a></h3>
|
||||
<ul>
|
||||
<li><a class="reference internal" href="#">pyFTS - Fuzzy Time Series for Python</a><ul>
|
||||
@ -133,12 +133,9 @@ src="http://www.ifmg.edu.br/portal/imagens/logovertical.jpg" alt="IFMG" width="1
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
<div>
|
||||
<h4>Next topic</h4>
|
||||
<p class="topless"><a href="quickstart.html"
|
||||
title="next chapter">pyFTS Quick Start</a></p>
|
||||
</div>
|
||||
<div role="note" aria-label="source link">
|
||||
<h3>This Page</h3>
|
||||
<ul class="this-page-menu">
|
||||
@ -178,7 +175,7 @@ src="http://www.ifmg.edu.br/portal/imagens/logovertical.jpg" alt="IFMG" width="1
|
||||
</div>
|
||||
<div class="footer" role="contentinfo">
|
||||
© Copyright 2022, Machine Intelligence and Data Science Laboratory - UFMG - Brazil.
|
||||
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 4.5.0.
|
||||
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 4.3.2.
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
75
docs/build/html/modules.html
vendored
75
docs/build/html/modules.html
vendored
@ -5,7 +5,8 @@
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.17.1: http://docutils.sourceforge.net/" />
|
||||
|
||||
<title>pyFTS — pyFTS 1.7 documentation</title>
|
||||
<link rel="stylesheet" type="text/css" href="_static/pygments.css" />
|
||||
<link rel="stylesheet" type="text/css" href="_static/bizstyle.css" />
|
||||
@ -49,7 +50,7 @@
|
||||
<div class="bodywrapper">
|
||||
<div class="body" role="main">
|
||||
|
||||
<div class="section" id="pyfts">
|
||||
<section id="pyfts">
|
||||
<h1>pyFTS<a class="headerlink" href="#pyfts" title="Permalink to this headline">¶</a></h1>
|
||||
<div class="toctree-wrapper compound">
|
||||
<ul>
|
||||
@ -58,30 +59,31 @@
|
||||
<li class="toctree-l3"><a class="reference internal" href="pyFTS.benchmarks.html">pyFTS.benchmarks package</a><ul>
|
||||
<li class="toctree-l4"><a class="reference internal" href="pyFTS.benchmarks.html#module-pyFTS.benchmarks">Module contents</a></li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="pyFTS.benchmarks.html#submodules">Submodules</a></li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="pyFTS.benchmarks.html#module-pyFTS.benchmarks.benchmarks">pyFTS.benchmarks.benchmarks module</a></li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="pyFTS.benchmarks.html#module-pyFTS.benchmarks.Measures">pyFTS.benchmarks.Measures module</a></li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="pyFTS.benchmarks.html#module-pyFTS.benchmarks.ResidualAnalysis">pyFTS.benchmarks.ResidualAnalysis module</a></li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="pyFTS.benchmarks.html#module-pyFTS.benchmarks.Tests">pyFTS.benchmarks.Tests module</a></li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="pyFTS.benchmarks.html#module-pyFTS.benchmarks.Util">pyFTS.benchmarks.Util module</a></li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="pyFTS.benchmarks.html#module-pyFTS.benchmarks.arima">pyFTS.benchmarks.arima module</a></li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="pyFTS.benchmarks.html#module-pyFTS.benchmarks.knn">pyFTS.benchmarks.knn module</a></li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="pyFTS.benchmarks.html#module-pyFTS.benchmarks.naive">pyFTS.benchmarks.naive module</a></li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="pyFTS.benchmarks.html#module-pyFTS.benchmarks.quantreg">pyFTS.benchmarks.quantreg module</a></li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="pyFTS.benchmarks.html#pyfts-benchmarks-benchmarks-module">pyFTS.benchmarks.benchmarks module</a></li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="pyFTS.benchmarks.html#pyfts-benchmarks-measures-module">pyFTS.benchmarks.Measures module</a></li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="pyFTS.benchmarks.html#pyfts-benchmarks-residualanalysis-module">pyFTS.benchmarks.ResidualAnalysis module</a></li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="pyFTS.benchmarks.html#pyfts-benchmarks-tests-module">pyFTS.benchmarks.Tests module</a></li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="pyFTS.benchmarks.html#pyfts-benchmarks-util-module">pyFTS.benchmarks.Util module</a></li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="pyFTS.benchmarks.html#pyfts-benchmarks-arima-module">pyFTS.benchmarks.arima module</a></li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="pyFTS.benchmarks.html#pyfts-benchmarks-knn-module">pyFTS.benchmarks.knn module</a></li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="pyFTS.benchmarks.html#pyfts-benchmarks-naive-module">pyFTS.benchmarks.naive module</a></li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="pyFTS.benchmarks.html#pyfts-benchmarks-quantreg-module">pyFTS.benchmarks.quantreg module</a></li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="pyFTS.benchmarks.html#pyfts-benchmarks-gaussianproc-module">pyFTS.benchmarks.gaussianproc module</a></li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="pyFTS.benchmarks.html#module-pyFTS.benchmarks.BSTS">pyFTS.benchmarks.BSTS module</a></li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="pyFTS.benchmarks.html#pyfts-benchmarks-bsts-module">pyFTS.benchmarks.BSTS module</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="pyFTS.common.html">pyFTS.common package</a><ul>
|
||||
<li class="toctree-l4"><a class="reference internal" href="pyFTS.common.html#module-pyFTS.common">Module contents</a></li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="pyFTS.common.html#submodules">Submodules</a></li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="pyFTS.common.html#module-pyFTS.common.Activations">pyFTS.common.Activations module</a></li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="pyFTS.common.html#module-pyFTS.common.Composite">pyFTS.common.Composite module</a></li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="pyFTS.common.html#module-pyFTS.common.FLR">pyFTS.common.FLR module</a></li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="pyFTS.common.html#module-pyFTS.common.FuzzySet">pyFTS.common.FuzzySet module</a></li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="pyFTS.common.html#module-pyFTS.common.Membership">pyFTS.common.Membership module</a></li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="pyFTS.common.html#module-pyFTS.common.SortedCollection">pyFTS.common.SortedCollection module</a></li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="pyFTS.common.html#module-pyFTS.common.Util">pyFTS.common.Util module</a></li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="pyFTS.common.html#pyfts-common-util-module">pyFTS.common.Util module</a></li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="pyFTS.common.html#module-pyFTS.common.flrg">pyFTS.common.flrg module</a></li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="pyFTS.common.html#module-pyFTS.common.fts">pyFTS.common.fts module</a></li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="pyFTS.common.html#pyfts-common-fts-module">pyFTS.common.fts module</a></li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="pyFTS.common.html#module-pyFTS.common.tree">pyFTS.common.tree module</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
@ -97,7 +99,7 @@
|
||||
<li class="toctree-l4"><a class="reference internal" href="pyFTS.common.transformations.html#module-pyFTS.common.transformations.smoothing">pyFTS.common.transformations.smoothing module</a></li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="pyFTS.common.transformations.html#module-pyFTS.common.transformations.som">pyFTS.common.transformations.som module</a></li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="pyFTS.common.transformations.html#module-pyFTS.common.transformations.transformation">pyFTS.common.transformations.transformation module</a></li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="pyFTS.common.transformations.html#module-pyFTS.common.transformations.trend">pyFTS.common.transformations.trend module</a></li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="pyFTS.common.transformations.html#pyfts-common-transformations-trend-module">pyFTS.common.transformations.trend module</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="pyFTS.data.html">pyFTS.data package</a><ul>
|
||||
@ -139,8 +141,8 @@
|
||||
<li class="toctree-l4"><a class="reference internal" href="pyFTS.hyperparam.html#module-pyFTS.hyperparam">Module contents</a></li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="pyFTS.hyperparam.html#submodules">Submodules</a></li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="pyFTS.hyperparam.html#module-pyFTS.hyperparam.Util">pyFTS.hyperparam.Util module</a></li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="pyFTS.hyperparam.html#module-pyFTS.hyperparam.GridSearch">pyFTS.hyperparam.GridSearch module</a></li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="pyFTS.hyperparam.html#module-pyFTS.hyperparam.Evolutionary">pyFTS.hyperparam.Evolutionary module</a></li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="pyFTS.hyperparam.html#pyfts-hyperparam-gridsearch-module">pyFTS.hyperparam.GridSearch module</a></li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="pyFTS.hyperparam.html#pyfts-hyperparam-evolutionary-module">pyFTS.hyperparam.Evolutionary module</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="pyFTS.models.html">pyFTS.models package</a><ul>
|
||||
@ -154,39 +156,40 @@
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="pyFTS.models.html#submodules">Submodules</a></li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="pyFTS.models.html#module-pyFTS.models.song">pyFTS.models.song module</a></li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="pyFTS.models.html#module-pyFTS.models.chen">pyFTS.models.chen module</a></li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="pyFTS.models.html#module-pyFTS.models.yu">pyFTS.models.yu module</a></li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="pyFTS.models.html#module-pyFTS.models.cheng">pyFTS.models.cheng module</a></li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="pyFTS.models.html#module-pyFTS.models.hofts">pyFTS.models.hofts module</a></li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="pyFTS.models.html#module-pyFTS.models.hwang">pyFTS.models.hwang module</a></li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="pyFTS.models.html#module-pyFTS.models.ifts">pyFTS.models.ifts module</a></li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="pyFTS.models.html#module-pyFTS.models.ismailefendi">pyFTS.models.ismailefendi module</a></li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="pyFTS.models.html#module-pyFTS.models.pwfts">pyFTS.models.pwfts module</a></li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="pyFTS.models.html#module-pyFTS.models.sadaei">pyFTS.models.sadaei module</a></li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="pyFTS.models.html#pyfts-models-song-module">pyFTS.models.song module</a></li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="pyFTS.models.html#pyfts-models-chen-module">pyFTS.models.chen module</a></li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="pyFTS.models.html#pyfts-models-yu-module">pyFTS.models.yu module</a></li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="pyFTS.models.html#pyfts-models-cheng-module">pyFTS.models.cheng module</a></li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="pyFTS.models.html#pyfts-models-hofts-module">pyFTS.models.hofts module</a></li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="pyFTS.models.html#pyfts-models-hwang-module">pyFTS.models.hwang module</a></li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="pyFTS.models.html#pyfts-models-ifts-module">pyFTS.models.ifts module</a></li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="pyFTS.models.html#pyfts-models-ismailefendi-module">pyFTS.models.ismailefendi module</a></li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="pyFTS.models.html#pyfts-models-pwfts-module">pyFTS.models.pwfts module</a></li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="pyFTS.models.html#pyfts-models-sadaei-module">pyFTS.models.sadaei module</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="pyFTS.partitioners.html">pyFTS.partitioners package</a><ul>
|
||||
<li class="toctree-l4"><a class="reference internal" href="pyFTS.partitioners.html#module-pyFTS.partitioners">Module contents</a></li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="pyFTS.partitioners.html#submodules">Submodules</a></li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="pyFTS.partitioners.html#module-pyFTS.partitioners.partitioner">pyFTS.partitioners.partitioner module</a></li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="pyFTS.partitioners.html#pyfts-partitioners-classpartitioner-module">pyFTS.partitioners.ClassPartitioner module</a></li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="pyFTS.partitioners.html#module-pyFTS.partitioners.CMeans">pyFTS.partitioners.CMeans module</a></li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="pyFTS.partitioners.html#module-pyFTS.partitioners.Entropy">pyFTS.partitioners.Entropy module</a></li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="pyFTS.partitioners.html#module-pyFTS.partitioners.FCM">pyFTS.partitioners.FCM module</a></li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="pyFTS.partitioners.html#module-pyFTS.partitioners.Grid">pyFTS.partitioners.Grid module</a></li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="pyFTS.partitioners.html#module-pyFTS.partitioners.Huarng">pyFTS.partitioners.Huarng module</a></li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="pyFTS.partitioners.html#pyfts-partitioners-huarng-module">pyFTS.partitioners.Huarng module</a></li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="pyFTS.partitioners.html#module-pyFTS.partitioners.Singleton">pyFTS.partitioners.Singleton module</a></li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="pyFTS.partitioners.html#module-pyFTS.partitioners.Simple">pyFTS.partitioners.Simple module</a></li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="pyFTS.partitioners.html#module-pyFTS.partitioners.SubClust">pyFTS.partitioners.SubClust module</a></li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="pyFTS.partitioners.html#module-pyFTS.partitioners.Util">pyFTS.partitioners.Util module</a></li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="pyFTS.partitioners.html#module-pyFTS.partitioners.parallel_util">pyFTS.partitioners.parallel_util module</a></li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="pyFTS.partitioners.html#pyfts-partitioners-util-module">pyFTS.partitioners.Util module</a></li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="pyFTS.partitioners.html#pyfts-partitioners-parallel-util-module">pyFTS.partitioners.parallel_util module</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="toctree-l3"><a class="reference internal" href="pyFTS.probabilistic.html">pyFTS.probabilistic package</a><ul>
|
||||
<li class="toctree-l4"><a class="reference internal" href="pyFTS.probabilistic.html#module-pyFTS.probabilistic">Module contents</a></li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="pyFTS.probabilistic.html#submodules">Submodules</a></li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="pyFTS.probabilistic.html#module-pyFTS.probabilistic.ProbabilityDistribution">pyFTS.probabilistic.ProbabilityDistribution module</a></li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="pyFTS.probabilistic.html#module-pyFTS.probabilistic.kde">pyFTS.probabilistic.kde module</a></li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="pyFTS.probabilistic.html#pyfts-probabilistic-probabilitydistribution-module">pyFTS.probabilistic.ProbabilityDistribution module</a></li>
|
||||
<li class="toctree-l4"><a class="reference internal" href="pyFTS.probabilistic.html#pyfts-probabilistic-kde-module">pyFTS.probabilistic.kde module</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
@ -198,7 +201,7 @@
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
|
||||
<div class="clearer"></div>
|
||||
@ -207,16 +210,12 @@
|
||||
</div>
|
||||
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
|
||||
<div class="sphinxsidebarwrapper">
|
||||
<div>
|
||||
<h4>Previous topic</h4>
|
||||
<p class="topless"><a href="quickstart.html"
|
||||
title="previous chapter">pyFTS Quick Start</a></p>
|
||||
</div>
|
||||
<div>
|
||||
<h4>Next topic</h4>
|
||||
<p class="topless"><a href="pyFTS.html"
|
||||
title="next chapter">pyFTS package</a></p>
|
||||
</div>
|
||||
<div role="note" aria-label="source link">
|
||||
<h3>This Page</h3>
|
||||
<ul class="this-page-menu">
|
||||
@ -259,7 +258,7 @@
|
||||
</div>
|
||||
<div class="footer" role="contentinfo">
|
||||
© Copyright 2022, Machine Intelligence and Data Science Laboratory - UFMG - Brazil.
|
||||
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 4.5.0.
|
||||
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 4.3.2.
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
BIN
docs/build/html/objects.inv
vendored
BIN
docs/build/html/objects.inv
vendored
Binary file not shown.
242
docs/build/html/py-modindex.html
vendored
242
docs/build/html/py-modindex.html
vendored
@ -66,61 +66,16 @@
|
||||
<td>   
|
||||
<a href="pyFTS.benchmarks.html#module-pyFTS.benchmarks"><code class="xref">pyFTS.benchmarks</code></a></td><td>
|
||||
<em></em></td></tr>
|
||||
<tr class="cg-1">
|
||||
<td></td>
|
||||
<td>   
|
||||
<a href="pyFTS.benchmarks.html#module-pyFTS.benchmarks.arima"><code class="xref">pyFTS.benchmarks.arima</code></a></td><td>
|
||||
<em></em></td></tr>
|
||||
<tr class="cg-1">
|
||||
<td></td>
|
||||
<td>   
|
||||
<a href="pyFTS.benchmarks.html#module-pyFTS.benchmarks.benchmarks"><code class="xref">pyFTS.benchmarks.benchmarks</code></a></td><td>
|
||||
<em></em></td></tr>
|
||||
<tr class="cg-1">
|
||||
<td></td>
|
||||
<td>   
|
||||
<a href="pyFTS.benchmarks.html#module-pyFTS.benchmarks.BSTS"><code class="xref">pyFTS.benchmarks.BSTS</code></a></td><td>
|
||||
<em></em></td></tr>
|
||||
<tr class="cg-1">
|
||||
<td></td>
|
||||
<td>   
|
||||
<a href="pyFTS.benchmarks.html#module-pyFTS.benchmarks.knn"><code class="xref">pyFTS.benchmarks.knn</code></a></td><td>
|
||||
<em></em></td></tr>
|
||||
<tr class="cg-1">
|
||||
<td></td>
|
||||
<td>   
|
||||
<a href="pyFTS.benchmarks.html#module-pyFTS.benchmarks.Measures"><code class="xref">pyFTS.benchmarks.Measures</code></a></td><td>
|
||||
<em></em></td></tr>
|
||||
<tr class="cg-1">
|
||||
<td></td>
|
||||
<td>   
|
||||
<a href="pyFTS.benchmarks.html#module-pyFTS.benchmarks.naive"><code class="xref">pyFTS.benchmarks.naive</code></a></td><td>
|
||||
<em></em></td></tr>
|
||||
<tr class="cg-1">
|
||||
<td></td>
|
||||
<td>   
|
||||
<a href="pyFTS.benchmarks.html#module-pyFTS.benchmarks.quantreg"><code class="xref">pyFTS.benchmarks.quantreg</code></a></td><td>
|
||||
<em></em></td></tr>
|
||||
<tr class="cg-1">
|
||||
<td></td>
|
||||
<td>   
|
||||
<a href="pyFTS.benchmarks.html#module-pyFTS.benchmarks.ResidualAnalysis"><code class="xref">pyFTS.benchmarks.ResidualAnalysis</code></a></td><td>
|
||||
<em></em></td></tr>
|
||||
<tr class="cg-1">
|
||||
<td></td>
|
||||
<td>   
|
||||
<a href="pyFTS.benchmarks.html#module-pyFTS.benchmarks.Tests"><code class="xref">pyFTS.benchmarks.Tests</code></a></td><td>
|
||||
<em></em></td></tr>
|
||||
<tr class="cg-1">
|
||||
<td></td>
|
||||
<td>   
|
||||
<a href="pyFTS.benchmarks.html#module-pyFTS.benchmarks.Util"><code class="xref">pyFTS.benchmarks.Util</code></a></td><td>
|
||||
<em></em></td></tr>
|
||||
<tr class="cg-1">
|
||||
<td></td>
|
||||
<td>   
|
||||
<a href="pyFTS.common.html#module-pyFTS.common"><code class="xref">pyFTS.common</code></a></td><td>
|
||||
<em></em></td></tr>
|
||||
<tr class="cg-1">
|
||||
<td></td>
|
||||
<td>   
|
||||
<a href="pyFTS.common.html#module-pyFTS.common.Activations"><code class="xref">pyFTS.common.Activations</code></a></td><td>
|
||||
<em></em></td></tr>
|
||||
<tr class="cg-1">
|
||||
<td></td>
|
||||
<td>   
|
||||
@ -136,11 +91,6 @@
|
||||
<td>   
|
||||
<a href="pyFTS.common.html#module-pyFTS.common.flrg"><code class="xref">pyFTS.common.flrg</code></a></td><td>
|
||||
<em></em></td></tr>
|
||||
<tr class="cg-1">
|
||||
<td></td>
|
||||
<td>   
|
||||
<a href="pyFTS.common.html#module-pyFTS.common.fts"><code class="xref">pyFTS.common.fts</code></a></td><td>
|
||||
<em></em></td></tr>
|
||||
<tr class="cg-1">
|
||||
<td></td>
|
||||
<td>   
|
||||
@ -201,21 +151,11 @@
|
||||
<td>   
|
||||
<a href="pyFTS.common.transformations.html#module-pyFTS.common.transformations.transformation"><code class="xref">pyFTS.common.transformations.transformation</code></a></td><td>
|
||||
<em></em></td></tr>
|
||||
<tr class="cg-1">
|
||||
<td></td>
|
||||
<td>   
|
||||
<a href="pyFTS.common.transformations.html#module-pyFTS.common.transformations.trend"><code class="xref">pyFTS.common.transformations.trend</code></a></td><td>
|
||||
<em></em></td></tr>
|
||||
<tr class="cg-1">
|
||||
<td></td>
|
||||
<td>   
|
||||
<a href="pyFTS.common.html#module-pyFTS.common.tree"><code class="xref">pyFTS.common.tree</code></a></td><td>
|
||||
<em></em></td></tr>
|
||||
<tr class="cg-1">
|
||||
<td></td>
|
||||
<td>   
|
||||
<a href="pyFTS.common.html#module-pyFTS.common.Util"><code class="xref">pyFTS.common.Util</code></a></td><td>
|
||||
<em></em></td></tr>
|
||||
<tr class="cg-1">
|
||||
<td></td>
|
||||
<td>   
|
||||
@ -346,16 +286,6 @@
|
||||
<td>   
|
||||
<a href="pyFTS.hyperparam.html#module-pyFTS.hyperparam"><code class="xref">pyFTS.hyperparam</code></a></td><td>
|
||||
<em></em></td></tr>
|
||||
<tr class="cg-1">
|
||||
<td></td>
|
||||
<td>   
|
||||
<a href="pyFTS.hyperparam.html#module-pyFTS.hyperparam.Evolutionary"><code class="xref">pyFTS.hyperparam.Evolutionary</code></a></td><td>
|
||||
<em></em></td></tr>
|
||||
<tr class="cg-1">
|
||||
<td></td>
|
||||
<td>   
|
||||
<a href="pyFTS.hyperparam.html#module-pyFTS.hyperparam.GridSearch"><code class="xref">pyFTS.hyperparam.GridSearch</code></a></td><td>
|
||||
<em></em></td></tr>
|
||||
<tr class="cg-1">
|
||||
<td></td>
|
||||
<td>   
|
||||
@ -366,76 +296,21 @@
|
||||
<td>   
|
||||
<a href="pyFTS.models.html#module-pyFTS.models"><code class="xref">pyFTS.models</code></a></td><td>
|
||||
<em></em></td></tr>
|
||||
<tr class="cg-1">
|
||||
<td></td>
|
||||
<td>   
|
||||
<a href="pyFTS.models.html#module-pyFTS.models.chen"><code class="xref">pyFTS.models.chen</code></a></td><td>
|
||||
<em></em></td></tr>
|
||||
<tr class="cg-1">
|
||||
<td></td>
|
||||
<td>   
|
||||
<a href="pyFTS.models.html#module-pyFTS.models.cheng"><code class="xref">pyFTS.models.cheng</code></a></td><td>
|
||||
<em></em></td></tr>
|
||||
<tr class="cg-1">
|
||||
<td></td>
|
||||
<td>   
|
||||
<a href="pyFTS.models.ensemble.html#module-pyFTS.models.ensemble"><code class="xref">pyFTS.models.ensemble</code></a></td><td>
|
||||
<em></em></td></tr>
|
||||
<tr class="cg-1">
|
||||
<td></td>
|
||||
<td>   
|
||||
<a href="pyFTS.models.ensemble.html#module-pyFTS.models.ensemble.ensemble"><code class="xref">pyFTS.models.ensemble.ensemble</code></a></td><td>
|
||||
<em></em></td></tr>
|
||||
<tr class="cg-1">
|
||||
<td></td>
|
||||
<td>   
|
||||
<a href="pyFTS.models.ensemble.html#module-pyFTS.models.ensemble.multiseasonal"><code class="xref">pyFTS.models.ensemble.multiseasonal</code></a></td><td>
|
||||
<em></em></td></tr>
|
||||
<tr class="cg-1">
|
||||
<td></td>
|
||||
<td>   
|
||||
<a href="pyFTS.models.html#module-pyFTS.models.hofts"><code class="xref">pyFTS.models.hofts</code></a></td><td>
|
||||
<em></em></td></tr>
|
||||
<tr class="cg-1">
|
||||
<td></td>
|
||||
<td>   
|
||||
<a href="pyFTS.models.html#module-pyFTS.models.hwang"><code class="xref">pyFTS.models.hwang</code></a></td><td>
|
||||
<em></em></td></tr>
|
||||
<tr class="cg-1">
|
||||
<td></td>
|
||||
<td>   
|
||||
<a href="pyFTS.models.html#module-pyFTS.models.ifts"><code class="xref">pyFTS.models.ifts</code></a></td><td>
|
||||
<em></em></td></tr>
|
||||
<tr class="cg-1">
|
||||
<td></td>
|
||||
<td>   
|
||||
<a href="pyFTS.models.incremental.html#module-pyFTS.models.incremental"><code class="xref">pyFTS.models.incremental</code></a></td><td>
|
||||
<em></em></td></tr>
|
||||
<tr class="cg-1">
|
||||
<td></td>
|
||||
<td>   
|
||||
<a href="pyFTS.models.incremental.html#module-pyFTS.models.incremental.IncrementalEnsemble"><code class="xref">pyFTS.models.incremental.IncrementalEnsemble</code></a></td><td>
|
||||
<em></em></td></tr>
|
||||
<tr class="cg-1">
|
||||
<td></td>
|
||||
<td>   
|
||||
<a href="pyFTS.models.incremental.html#module-pyFTS.models.incremental.TimeVariant"><code class="xref">pyFTS.models.incremental.TimeVariant</code></a></td><td>
|
||||
<em></em></td></tr>
|
||||
<tr class="cg-1">
|
||||
<td></td>
|
||||
<td>   
|
||||
<a href="pyFTS.models.html#module-pyFTS.models.ismailefendi"><code class="xref">pyFTS.models.ismailefendi</code></a></td><td>
|
||||
<em></em></td></tr>
|
||||
<tr class="cg-1">
|
||||
<td></td>
|
||||
<td>   
|
||||
<a href="pyFTS.models.multivariate.html#module-pyFTS.models.multivariate"><code class="xref">pyFTS.models.multivariate</code></a></td><td>
|
||||
<em></em></td></tr>
|
||||
<tr class="cg-1">
|
||||
<td></td>
|
||||
<td>   
|
||||
<a href="pyFTS.models.multivariate.html#module-pyFTS.models.multivariate.cmvfts"><code class="xref">pyFTS.models.multivariate.cmvfts</code></a></td><td>
|
||||
<em></em></td></tr>
|
||||
<tr class="cg-1">
|
||||
<td></td>
|
||||
<td>   
|
||||
@ -451,36 +326,16 @@
|
||||
<td>   
|
||||
<a href="pyFTS.models.multivariate.html#module-pyFTS.models.multivariate.flrg"><code class="xref">pyFTS.models.multivariate.flrg</code></a></td><td>
|
||||
<em></em></td></tr>
|
||||
<tr class="cg-1">
|
||||
<td></td>
|
||||
<td>   
|
||||
<a href="pyFTS.models.multivariate.html#module-pyFTS.models.multivariate.granular"><code class="xref">pyFTS.models.multivariate.granular</code></a></td><td>
|
||||
<em></em></td></tr>
|
||||
<tr class="cg-1">
|
||||
<td></td>
|
||||
<td>   
|
||||
<a href="pyFTS.models.multivariate.html#module-pyFTS.models.multivariate.grid"><code class="xref">pyFTS.models.multivariate.grid</code></a></td><td>
|
||||
<em></em></td></tr>
|
||||
<tr class="cg-1">
|
||||
<td></td>
|
||||
<td>   
|
||||
<a href="pyFTS.models.multivariate.html#module-pyFTS.models.multivariate.mvfts"><code class="xref">pyFTS.models.multivariate.mvfts</code></a></td><td>
|
||||
<em></em></td></tr>
|
||||
<tr class="cg-1">
|
||||
<td></td>
|
||||
<td>   
|
||||
<a href="pyFTS.models.multivariate.html#module-pyFTS.models.multivariate.partitioner"><code class="xref">pyFTS.models.multivariate.partitioner</code></a></td><td>
|
||||
<em></em></td></tr>
|
||||
<tr class="cg-1">
|
||||
<td></td>
|
||||
<td>   
|
||||
<a href="pyFTS.models.multivariate.html#module-pyFTS.models.multivariate.variable"><code class="xref">pyFTS.models.multivariate.variable</code></a></td><td>
|
||||
<em></em></td></tr>
|
||||
<tr class="cg-1">
|
||||
<td></td>
|
||||
<td>   
|
||||
<a href="pyFTS.models.multivariate.html#module-pyFTS.models.multivariate.wmvfts"><code class="xref">pyFTS.models.multivariate.wmvfts</code></a></td><td>
|
||||
<em></em></td></tr>
|
||||
<tr class="cg-1">
|
||||
<td></td>
|
||||
<td>   
|
||||
@ -491,26 +346,11 @@
|
||||
<td>   
|
||||
<a href="pyFTS.models.nonstationary.html#module-pyFTS.models.nonstationary.common"><code class="xref">pyFTS.models.nonstationary.common</code></a></td><td>
|
||||
<em></em></td></tr>
|
||||
<tr class="cg-1">
|
||||
<td></td>
|
||||
<td>   
|
||||
<a href="pyFTS.models.nonstationary.html#module-pyFTS.models.nonstationary.cvfts"><code class="xref">pyFTS.models.nonstationary.cvfts</code></a></td><td>
|
||||
<em></em></td></tr>
|
||||
<tr class="cg-1">
|
||||
<td></td>
|
||||
<td>   
|
||||
<a href="pyFTS.models.nonstationary.html#module-pyFTS.models.nonstationary.flrg"><code class="xref">pyFTS.models.nonstationary.flrg</code></a></td><td>
|
||||
<em></em></td></tr>
|
||||
<tr class="cg-1">
|
||||
<td></td>
|
||||
<td>   
|
||||
<a href="pyFTS.models.nonstationary.html#module-pyFTS.models.nonstationary.honsfts"><code class="xref">pyFTS.models.nonstationary.honsfts</code></a></td><td>
|
||||
<em></em></td></tr>
|
||||
<tr class="cg-1">
|
||||
<td></td>
|
||||
<td>   
|
||||
<a href="pyFTS.models.nonstationary.html#module-pyFTS.models.nonstationary.nsfts"><code class="xref">pyFTS.models.nonstationary.nsfts</code></a></td><td>
|
||||
<em></em></td></tr>
|
||||
<tr class="cg-1">
|
||||
<td></td>
|
||||
<td>   
|
||||
@ -521,41 +361,16 @@
|
||||
<td>   
|
||||
<a href="pyFTS.models.nonstationary.html#module-pyFTS.models.nonstationary.perturbation"><code class="xref">pyFTS.models.nonstationary.perturbation</code></a></td><td>
|
||||
<em></em></td></tr>
|
||||
<tr class="cg-1">
|
||||
<td></td>
|
||||
<td>   
|
||||
<a href="pyFTS.models.nonstationary.html#module-pyFTS.models.nonstationary.util"><code class="xref">pyFTS.models.nonstationary.util</code></a></td><td>
|
||||
<em></em></td></tr>
|
||||
<tr class="cg-1">
|
||||
<td></td>
|
||||
<td>   
|
||||
<a href="pyFTS.models.html#module-pyFTS.models.pwfts"><code class="xref">pyFTS.models.pwfts</code></a></td><td>
|
||||
<em></em></td></tr>
|
||||
<tr class="cg-1">
|
||||
<td></td>
|
||||
<td>   
|
||||
<a href="pyFTS.models.html#module-pyFTS.models.sadaei"><code class="xref">pyFTS.models.sadaei</code></a></td><td>
|
||||
<em></em></td></tr>
|
||||
<tr class="cg-1">
|
||||
<td></td>
|
||||
<td>   
|
||||
<a href="pyFTS.models.seasonal.html#module-pyFTS.models.seasonal"><code class="xref">pyFTS.models.seasonal</code></a></td><td>
|
||||
<em></em></td></tr>
|
||||
<tr class="cg-1">
|
||||
<td></td>
|
||||
<td>   
|
||||
<a href="pyFTS.models.seasonal.html#module-pyFTS.models.seasonal.cmsfts"><code class="xref">pyFTS.models.seasonal.cmsfts</code></a></td><td>
|
||||
<em></em></td></tr>
|
||||
<tr class="cg-1">
|
||||
<td></td>
|
||||
<td>   
|
||||
<a href="pyFTS.models.seasonal.html#module-pyFTS.models.seasonal.common"><code class="xref">pyFTS.models.seasonal.common</code></a></td><td>
|
||||
<em></em></td></tr>
|
||||
<tr class="cg-1">
|
||||
<td></td>
|
||||
<td>   
|
||||
<a href="pyFTS.models.seasonal.html#module-pyFTS.models.seasonal.msfts"><code class="xref">pyFTS.models.seasonal.msfts</code></a></td><td>
|
||||
<em></em></td></tr>
|
||||
<tr class="cg-1">
|
||||
<td></td>
|
||||
<td>   
|
||||
@ -566,26 +381,16 @@
|
||||
<td>   
|
||||
<a href="pyFTS.models.seasonal.html#module-pyFTS.models.seasonal.SeasonalIndexer"><code class="xref">pyFTS.models.seasonal.SeasonalIndexer</code></a></td><td>
|
||||
<em></em></td></tr>
|
||||
<tr class="cg-1">
|
||||
<td></td>
|
||||
<td>   
|
||||
<a href="pyFTS.models.seasonal.html#module-pyFTS.models.seasonal.sfts"><code class="xref">pyFTS.models.seasonal.sfts</code></a></td><td>
|
||||
<em></em></td></tr>
|
||||
<tr class="cg-1">
|
||||
<td></td>
|
||||
<td>   
|
||||
<a href="pyFTS.models.html#module-pyFTS.models.song"><code class="xref">pyFTS.models.song</code></a></td><td>
|
||||
<em></em></td></tr>
|
||||
<tr class="cg-1">
|
||||
<td></td>
|
||||
<td>   
|
||||
<a href="pyFTS.models.html#module-pyFTS.models.yu"><code class="xref">pyFTS.models.yu</code></a></td><td>
|
||||
<em></em></td></tr>
|
||||
<tr class="cg-1">
|
||||
<td></td>
|
||||
<td>   
|
||||
<a href="pyFTS.partitioners.html#module-pyFTS.partitioners"><code class="xref">pyFTS.partitioners</code></a></td><td>
|
||||
<em></em></td></tr>
|
||||
<tr class="cg-1">
|
||||
<td></td>
|
||||
<td>   
|
||||
<a href="pyFTS.partitioners.html#module-pyFTS.partitioners.ClassPartitioner"><code class="xref">pyFTS.partitioners.ClassPartitioner</code></a></td><td>
|
||||
<em></em></td></tr>
|
||||
<tr class="cg-1">
|
||||
<td></td>
|
||||
<td>   
|
||||
@ -606,16 +411,6 @@
|
||||
<td>   
|
||||
<a href="pyFTS.partitioners.html#module-pyFTS.partitioners.Grid"><code class="xref">pyFTS.partitioners.Grid</code></a></td><td>
|
||||
<em></em></td></tr>
|
||||
<tr class="cg-1">
|
||||
<td></td>
|
||||
<td>   
|
||||
<a href="pyFTS.partitioners.html#module-pyFTS.partitioners.Huarng"><code class="xref">pyFTS.partitioners.Huarng</code></a></td><td>
|
||||
<em></em></td></tr>
|
||||
<tr class="cg-1">
|
||||
<td></td>
|
||||
<td>   
|
||||
<a href="pyFTS.partitioners.html#module-pyFTS.partitioners.parallel_util"><code class="xref">pyFTS.partitioners.parallel_util</code></a></td><td>
|
||||
<em></em></td></tr>
|
||||
<tr class="cg-1">
|
||||
<td></td>
|
||||
<td>   
|
||||
@ -636,26 +431,11 @@
|
||||
<td>   
|
||||
<a href="pyFTS.partitioners.html#module-pyFTS.partitioners.SubClust"><code class="xref">pyFTS.partitioners.SubClust</code></a></td><td>
|
||||
<em></em></td></tr>
|
||||
<tr class="cg-1">
|
||||
<td></td>
|
||||
<td>   
|
||||
<a href="pyFTS.partitioners.html#module-pyFTS.partitioners.Util"><code class="xref">pyFTS.partitioners.Util</code></a></td><td>
|
||||
<em></em></td></tr>
|
||||
<tr class="cg-1">
|
||||
<td></td>
|
||||
<td>   
|
||||
<a href="pyFTS.probabilistic.html#module-pyFTS.probabilistic"><code class="xref">pyFTS.probabilistic</code></a></td><td>
|
||||
<em></em></td></tr>
|
||||
<tr class="cg-1">
|
||||
<td></td>
|
||||
<td>   
|
||||
<a href="pyFTS.probabilistic.html#module-pyFTS.probabilistic.kde"><code class="xref">pyFTS.probabilistic.kde</code></a></td><td>
|
||||
<em></em></td></tr>
|
||||
<tr class="cg-1">
|
||||
<td></td>
|
||||
<td>   
|
||||
<a href="pyFTS.probabilistic.html#module-pyFTS.probabilistic.ProbabilityDistribution"><code class="xref">pyFTS.probabilistic.ProbabilityDistribution</code></a></td><td>
|
||||
<em></em></td></tr>
|
||||
</table>
|
||||
|
||||
|
||||
@ -694,7 +474,7 @@
|
||||
</div>
|
||||
<div class="footer" role="contentinfo">
|
||||
© Copyright 2022, Machine Intelligence and Data Science Laboratory - UFMG - Brazil.
|
||||
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 4.5.0.
|
||||
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 4.3.2.
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
1900
docs/build/html/pyFTS.benchmarks.html
vendored
1900
docs/build/html/pyFTS.benchmarks.html
vendored
File diff suppressed because it is too large
Load Diff
945
docs/build/html/pyFTS.common.html
vendored
945
docs/build/html/pyFTS.common.html
vendored
File diff suppressed because it is too large
Load Diff
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user