pyFTS/docs/build/html/pyFTS.hyperparam.html

546 lines
38 KiB
HTML
Raw Normal View History

2018-11-13 18:11:49 +04:00
<!doctype html>
2020-08-19 00:06:41 +04:00
<html>
2018-11-13 18:11:49 +04:00
<head>
2020-08-19 00:06:41 +04:00
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0"><script type="text/javascript">
2018-11-13 18:11:49 +04:00
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-55120145-3']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
<title>pyFTS.hyperparam package &#8212; pyFTS 1.6 documentation</title>
2018-11-13 18:11:49 +04:00
<link rel="stylesheet" href="_static/bizstyle.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
2020-08-19 00:06:41 +04:00
<script id="documentation_options" data-url_root="./" 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/language_data.js"></script>
<script src="_static/bizstyle.js"></script>
2018-11-13 18:11:49 +04:00
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="next" title="pyFTS.models package" href="pyFTS.models.html" />
2019-02-21 19:00:09 +04:00
<link rel="prev" title="pyFTS.distributed package" href="pyFTS.distributed.html" />
2018-11-13 18:11:49 +04:00
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<!--[if lt IE 9]>
2020-08-19 00:06:41 +04:00
<script src="_static/css3-mediaqueries.js"></script>
2018-11-13 18:11:49 +04:00
<![endif]-->
</head><body>
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="right" >
<a href="pyFTS.models.html" title="pyFTS.models package"
accesskey="N">next</a> |</li>
<li class="right" >
2019-02-21 19:00:09 +04:00
<a href="pyFTS.distributed.html" title="pyFTS.distributed package"
2018-11-13 18:11:49 +04:00
accesskey="P">previous</a> |</li>
<li class="nav-item nav-item-0"><a href="index.html">pyFTS 1.6 documentation</a> &#187;</li>
2018-11-13 18:11:49 +04:00
<li class="nav-item nav-item-1"><a href="modules.html" >pyFTS</a> &#187;</li>
2020-08-19 00:06:41 +04:00
<li class="nav-item nav-item-2"><a href="pyFTS.html" accesskey="U">pyFTS package</a> &#187;</li>
<li class="nav-item nav-item-this"><a href="">pyFTS.hyperparam package</a></li>
2018-11-13 18:11:49 +04:00
</ul>
2020-08-19 00:06:41 +04:00
</div>
2018-11-13 18:11:49 +04:00
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<div class="section" id="pyfts-hyperparam-package">
<h1>pyFTS.hyperparam package<a class="headerlink" href="#pyfts-hyperparam-package" title="Permalink to this headline"></a></h1>
<div class="section" id="module-pyFTS.hyperparam">
<span id="module-contents"></span><h2>Module contents<a class="headerlink" href="#module-pyFTS.hyperparam" title="Permalink to this headline"></a></h2>
</div>
<div class="section" id="submodules">
<h2>Submodules<a class="headerlink" href="#submodules" title="Permalink to this headline"></a></h2>
</div>
<div class="section" id="module-pyFTS.hyperparam.Util">
<span id="pyfts-hyperparam-util-module"></span><h2>pyFTS.hyperparam.Util module<a class="headerlink" href="#module-pyFTS.hyperparam.Util" title="Permalink to this headline"></a></h2>
2019-09-24 06:16:06 +04:00
<p>Common facilities for hyperparameter optimization</p>
2020-08-19 00:06:41 +04:00
<dl class="py function">
2018-11-13 18:11:49 +04:00
<dt id="pyFTS.hyperparam.Util.create_hyperparam_tables">
2020-08-19 00:06:41 +04:00
<code class="sig-prename descclassname">pyFTS.hyperparam.Util.</code><code class="sig-name descname">create_hyperparam_tables</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">conn</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pyFTS/hyperparam/Util.html#create_hyperparam_tables"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyFTS.hyperparam.Util.create_hyperparam_tables" title="Permalink to this definition"></a></dt>
2018-11-13 18:11:49 +04:00
<dd><p>Create a sqlite3 table designed to store benchmark results.</p>
2020-08-19 00:06:41 +04:00
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>conn</strong> a sqlite3 database connection</p>
</dd>
</dl>
2018-11-13 18:11:49 +04:00
</dd></dl>
2020-08-19 00:06:41 +04:00
<dl class="py function">
2018-11-13 18:11:49 +04:00
<dt id="pyFTS.hyperparam.Util.insert_hyperparam">
2020-08-19 00:06:41 +04:00
<code class="sig-prename descclassname">pyFTS.hyperparam.Util.</code><code class="sig-name descname">insert_hyperparam</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">data</span></em>, <em class="sig-param"><span class="n">conn</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pyFTS/hyperparam/Util.html#insert_hyperparam"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyFTS.hyperparam.Util.insert_hyperparam" title="Permalink to this definition"></a></dt>
2018-11-13 18:11:49 +04:00
<dd><p>Insert benchmark data on database</p>
2020-08-19 00:06:41 +04:00
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>data</strong> a tuple with the benchmark data with format:</p>
</dd>
</dl>
2018-11-13 18:11:49 +04:00
<p>Dataset: Identify on which dataset the dataset was performed
Tag: a user defined word that indentify a benchmark set
Model: FTS model
Transformation: The name of data transformation, if one was used
mf: membership function
Order: the order of the FTS method
Partitioner: UoD partitioning scheme
Partitions: Number of partitions
alpha: alpha cut
lags: lags
Measure: accuracy measure
Value: the measure value</p>
2020-08-19 00:06:41 +04:00
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>conn</strong> a sqlite3 database connection</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p></p>
</dd>
</dl>
</dd></dl>
<dl class="py function">
2018-11-13 18:11:49 +04:00
<dt id="pyFTS.hyperparam.Util.open_hyperparam_db">
2020-08-19 00:06:41 +04:00
<code class="sig-prename descclassname">pyFTS.hyperparam.Util.</code><code class="sig-name descname">open_hyperparam_db</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">name</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pyFTS/hyperparam/Util.html#open_hyperparam_db"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyFTS.hyperparam.Util.open_hyperparam_db" title="Permalink to this definition"></a></dt>
2018-11-13 18:11:49 +04:00
<dd><p>Open a connection with a Sqlite database designed to store benchmark results.</p>
2020-08-19 00:06:41 +04:00
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>name</strong> database filenem</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>a sqlite3 database connection</p>
</dd>
</dl>
2018-11-13 18:11:49 +04:00
</dd></dl>
</div>
2021-01-13 01:04:42 +04:00
<div class="section" id="module-pyFTS.hyperparam.GridSearch">
<span id="pyfts-hyperparam-gridsearch-module"></span><h2>pyFTS.hyperparam.GridSearch module<a class="headerlink" href="#module-pyFTS.hyperparam.GridSearch" title="Permalink to this headline"></a></h2>
<dl class="py function">
<dt id="pyFTS.hyperparam.GridSearch.cluster_method">
<code class="sig-prename descclassname">pyFTS.hyperparam.GridSearch.</code><code class="sig-name descname">cluster_method</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">individual</span></em>, <em class="sig-param"><span class="n">dataset</span></em>, <em class="sig-param"><span class="o">**</span><span class="n">kwargs</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pyFTS/hyperparam/GridSearch.html#cluster_method"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyFTS.hyperparam.GridSearch.cluster_method" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py function">
<dt id="pyFTS.hyperparam.GridSearch.dict_individual">
<code class="sig-prename descclassname">pyFTS.hyperparam.GridSearch.</code><code class="sig-name descname">dict_individual</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">mf</span></em>, <em class="sig-param"><span class="n">partitioner</span></em>, <em class="sig-param"><span class="n">partitions</span></em>, <em class="sig-param"><span class="n">order</span></em>, <em class="sig-param"><span class="n">lags</span></em>, <em class="sig-param"><span class="n">alpha_cut</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pyFTS/hyperparam/GridSearch.html#dict_individual"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyFTS.hyperparam.GridSearch.dict_individual" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py function">
<dt id="pyFTS.hyperparam.GridSearch.execute">
<code class="sig-prename descclassname">pyFTS.hyperparam.GridSearch.</code><code class="sig-name descname">execute</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">hyperparams</span></em>, <em class="sig-param"><span class="n">datasetname</span></em>, <em class="sig-param"><span class="n">dataset</span></em>, <em class="sig-param"><span class="o">**</span><span class="n">kwargs</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pyFTS/hyperparam/GridSearch.html#execute"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyFTS.hyperparam.GridSearch.execute" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py function">
<dt id="pyFTS.hyperparam.GridSearch.process_jobs">
<code class="sig-prename descclassname">pyFTS.hyperparam.GridSearch.</code><code class="sig-name descname">process_jobs</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">jobs</span></em>, <em class="sig-param"><span class="n">datasetname</span></em>, <em class="sig-param"><span class="n">conn</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pyFTS/hyperparam/GridSearch.html#process_jobs"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyFTS.hyperparam.GridSearch.process_jobs" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
2019-02-21 19:00:09 +04:00
</div>
2021-01-13 01:04:42 +04:00
<div class="section" id="module-pyFTS.hyperparam.Evolutionary">
<span id="pyfts-hyperparam-evolutionary-module"></span><h2>pyFTS.hyperparam.Evolutionary module<a class="headerlink" href="#module-pyFTS.hyperparam.Evolutionary" title="Permalink to this headline"></a></h2>
<p>Distributed Evolutionary Hyperparameter Optimization (DEHO) for MVFTS</p>
<dl class="py function">
<dt id="pyFTS.hyperparam.Evolutionary.GeneticAlgorithm">
<code class="sig-prename descclassname">pyFTS.hyperparam.Evolutionary.</code><code class="sig-name descname">GeneticAlgorithm</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">dataset</span></em>, <em class="sig-param"><span class="o">**</span><span class="n">kwargs</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pyFTS/hyperparam/Evolutionary.html#GeneticAlgorithm"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyFTS.hyperparam.Evolutionary.GeneticAlgorithm" title="Permalink to this definition"></a></dt>
<dd><p>Genetic algoritm for Distributed Evolutionary Hyperparameter Optimization (DEHO)</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>dataset</strong> The time series to optimize the FTS</p></li>
<li><p><strong>ngen</strong> An integer value with the maximum number of generations, default value: 30</p></li>
<li><p><strong>mgen</strong> An integer value with the maximum number of generations without improvement to stop, default value 7</p></li>
<li><p><strong>npop</strong> An integer value with the population size, default value: 20</p></li>
<li><p><strong>pcross</strong> A float value between 0 and 1 with the probability of crossover, default: .5</p></li>
<li><p><strong>psel</strong> A float value between 0 and 1 with the probability of selection, default: .5</p></li>
<li><p><strong>pmut</strong> A float value between 0 and 1 with the probability of mutation, default: .3</p></li>
<li><p><strong>fts_method</strong> The FTS method to optimize</p></li>
<li><p><strong>parameters</strong> dict with model specific arguments for fts_method</p></li>
<li><p><strong>elitism</strong> A boolean value indicating if the best individual must always survive to next population</p></li>
<li><p><strong>initial_operator</strong> a function that receives npop and return a random population with size npop</p></li>
<li><p><strong>evalutation_operator</strong> a function that receives a dataset and an individual and return its fitness</p></li>
<li><p><strong>selection_operator</strong> a function that receives the whole population and return a selected individual</p></li>
<li><p><strong>crossover_operator</strong> a function that receives the whole population and return a descendent individual</p></li>
<li><p><strong>mutation_operator</strong> a function that receives one individual and return a changed individual</p></li>
<li><p><strong>window_size</strong> An integer value with the the length of scrolling window for train/test on dataset</p></li>
<li><p><strong>train_rate</strong> A float value between 0 and 1 with the train/test split ([0,1])</p></li>
<li><p><strong>increment_rate</strong> A float value between 0 and 1 with the the increment of the scrolling window,
relative to the window_size ([0,1])</p></li>
<li><p><strong>collect_statistics</strong> A boolean value indicating to collect statistics for each generation</p></li>
<li><p><strong>distributed</strong> A value indicating it the execution will be local and sequential (distributed=False),
or parallel and distributed (distributed=dispy or distributed=spark)</p></li>
<li><p><strong>cluster</strong> If distributed=dispy the list of cluster nodes, else if distributed=spark it is the master node</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>the best genotype</p>
</dd>
</dl>
</dd></dl>
<dl class="py function">
<dt id="pyFTS.hyperparam.Evolutionary.crossover">
<code class="sig-prename descclassname">pyFTS.hyperparam.Evolutionary.</code><code class="sig-name descname">crossover</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">population</span></em>, <em class="sig-param"><span class="o">**</span><span class="n">kwargs</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pyFTS/hyperparam/Evolutionary.html#crossover"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyFTS.hyperparam.Evolutionary.crossover" title="Permalink to this definition"></a></dt>
<dd><p>Crossover operation between two parents</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>population</strong> the original population</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>a genotype</p>
</dd>
</dl>
</dd></dl>
<dl class="py function">
<dt id="pyFTS.hyperparam.Evolutionary.double_tournament">
<code class="sig-prename descclassname">pyFTS.hyperparam.Evolutionary.</code><code class="sig-name descname">double_tournament</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">population</span></em>, <em class="sig-param"><span class="o">**</span><span class="n">kwargs</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pyFTS/hyperparam/Evolutionary.html#double_tournament"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyFTS.hyperparam.Evolutionary.double_tournament" title="Permalink to this definition"></a></dt>
<dd><p>Double tournament selection strategy.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>population</strong> </p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p></p>
</dd>
</dl>
</dd></dl>
<dl class="py function">
<dt id="pyFTS.hyperparam.Evolutionary.elitism">
<code class="sig-prename descclassname">pyFTS.hyperparam.Evolutionary.</code><code class="sig-name descname">elitism</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">population</span></em>, <em class="sig-param"><span class="n">new_population</span></em>, <em class="sig-param"><span class="o">**</span><span class="n">kwargs</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pyFTS/hyperparam/Evolutionary.html#elitism"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyFTS.hyperparam.Evolutionary.elitism" title="Permalink to this definition"></a></dt>
<dd><p>Elitism operation, always select the best individual of the population and discard the worst</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>population</strong> </p></li>
<li><p><strong>new_population</strong> </p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p></p>
</dd>
</dl>
</dd></dl>
<dl class="py function">
<dt id="pyFTS.hyperparam.Evolutionary.evaluate">
<code class="sig-prename descclassname">pyFTS.hyperparam.Evolutionary.</code><code class="sig-name descname">evaluate</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">dataset</span></em>, <em class="sig-param"><span class="n">individual</span></em>, <em class="sig-param"><span class="o">**</span><span class="n">kwargs</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pyFTS/hyperparam/Evolutionary.html#evaluate"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyFTS.hyperparam.Evolutionary.evaluate" title="Permalink to this definition"></a></dt>
<dd><p>Evaluate an individual using a sliding window cross validation over the dataset.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>dataset</strong> Evaluation dataset</p></li>
<li><p><strong>individual</strong> genotype to be tested</p></li>
<li><p><strong>window_size</strong> The length of scrolling window for train/test on dataset</p></li>
<li><p><strong>train_rate</strong> The train/test split ([0,1])</p></li>
<li><p><strong>increment_rate</strong> The increment of the scrolling window, relative to the window_size ([0,1])</p></li>
<li><p><strong>parameters</strong> dict with model specific arguments for fit method.</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>a tuple (len_lags, rmse) with the parsimony fitness value and the accuracy fitness value</p>
</dd>
</dl>
</dd></dl>
<dl class="py function">
<dt id="pyFTS.hyperparam.Evolutionary.execute">
<code class="sig-prename descclassname">pyFTS.hyperparam.Evolutionary.</code><code class="sig-name descname">execute</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">datasetname</span></em>, <em class="sig-param"><span class="n">dataset</span></em>, <em class="sig-param"><span class="o">**</span><span class="n">kwargs</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pyFTS/hyperparam/Evolutionary.html#execute"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyFTS.hyperparam.Evolutionary.execute" title="Permalink to this definition"></a></dt>
<dd><p>Batch execution of Distributed Evolutionary Hyperparameter Optimization (DEHO) for monovariate methods</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>datasetname</strong> </p></li>
<li><p><strong>dataset</strong> The time series to optimize the FTS</p></li>
<li><p><strong>file</strong> </p></li>
<li><p><strong>experiments</strong> </p></li>
<li><p><strong>distributed</strong> </p></li>
<li><p><strong>ngen</strong> An integer value with the maximum number of generations, default value: 30</p></li>
<li><p><strong>mgen</strong> An integer value with the maximum number of generations without improvement to stop, default value 7</p></li>
<li><p><strong>npop</strong> An integer value with the population size, default value: 20</p></li>
<li><p><strong>pcross</strong> A float value between 0 and 1 with the probability of crossover, default: .5</p></li>
<li><p><strong>psel</strong> A float value between 0 and 1 with the probability of selection, default: .5</p></li>
<li><p><strong>pmut</strong> A float value between 0 and 1 with the probability of mutation, default: .3</p></li>
<li><p><strong>fts_method</strong> The FTS method to optimize</p></li>
<li><p><strong>parameters</strong> dict with model specific arguments for fts_method</p></li>
<li><p><strong>elitism</strong> A boolean value indicating if the best individual must always survive to next population</p></li>
<li><p><strong>initial_operator</strong> a function that receives npop and return a random population with size npop</p></li>
<li><p><strong>random_individual</strong> create an random genotype</p></li>
<li><p><strong>evalutation_operator</strong> a function that receives a dataset and an individual and return its fitness</p></li>
<li><p><strong>selection_operator</strong> a function that receives the whole population and return a selected individual</p></li>
<li><p><strong>crossover_operator</strong> a function that receives the whole population and return a descendent individual</p></li>
<li><p><strong>mutation_operator</strong> a function that receives one individual and return a changed individual</p></li>
<li><p><strong>window_size</strong> An integer value with the the length of scrolling window for train/test on dataset</p></li>
<li><p><strong>train_rate</strong> A float value between 0 and 1 with the train/test split ([0,1])</p></li>
<li><p><strong>increment_rate</strong> A float value between 0 and 1 with the the increment of the scrolling window,
relative to the window_size ([0,1])</p></li>
<li><p><strong>collect_statistics</strong> A boolean value indicating to collect statistics for each generation</p></li>
<li><p><strong>distributed</strong> A value indicating it the execution will be local and sequential (distributed=False),
or parallel and distributed (distributed=dispy or distributed=spark)</p></li>
<li><p><strong>cluster</strong> If distributed=dispy the list of cluster nodes, else if distributed=spark it is the master node</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>the best genotype</p>
</dd>
</dl>
</dd></dl>
<dl class="py function">
<dt id="pyFTS.hyperparam.Evolutionary.genotype">
<code class="sig-prename descclassname">pyFTS.hyperparam.Evolutionary.</code><code class="sig-name descname">genotype</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">mf</span></em>, <em class="sig-param"><span class="n">npart</span></em>, <em class="sig-param"><span class="n">partitioner</span></em>, <em class="sig-param"><span class="n">order</span></em>, <em class="sig-param"><span class="n">alpha</span></em>, <em class="sig-param"><span class="n">lags</span></em>, <em class="sig-param"><span class="n">f1</span></em>, <em class="sig-param"><span class="n">f2</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pyFTS/hyperparam/Evolutionary.html#genotype"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyFTS.hyperparam.Evolutionary.genotype" title="Permalink to this definition"></a></dt>
<dd><p>Create the individual genotype</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>mf</strong> membership function</p></li>
<li><p><strong>npart</strong> number of partitions</p></li>
<li><p><strong>partitioner</strong> partitioner method</p></li>
<li><p><strong>order</strong> model order</p></li>
<li><p><strong>alpha</strong> alpha-cut</p></li>
<li><p><strong>lags</strong> array with lag indexes</p></li>
<li><p><strong>f1</strong> accuracy fitness value</p></li>
<li><p><strong>f2</strong> parsimony fitness value</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>the genotype, a dictionary with all hyperparameters</p>
</dd>
</dl>
</dd></dl>
<dl class="py function">
<dt id="pyFTS.hyperparam.Evolutionary.initial_population">
<code class="sig-prename descclassname">pyFTS.hyperparam.Evolutionary.</code><code class="sig-name descname">initial_population</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">n</span></em>, <em class="sig-param"><span class="o">**</span><span class="n">kwargs</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pyFTS/hyperparam/Evolutionary.html#initial_population"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyFTS.hyperparam.Evolutionary.initial_population" title="Permalink to this definition"></a></dt>
<dd><p>Create a random population of size n</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>n</strong> the size of the population</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>a list with n random individuals</p>
</dd>
</dl>
</dd></dl>
<dl class="py function">
<dt id="pyFTS.hyperparam.Evolutionary.lag_crossover2">
<code class="sig-prename descclassname">pyFTS.hyperparam.Evolutionary.</code><code class="sig-name descname">lag_crossover2</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">best</span></em>, <em class="sig-param"><span class="n">worst</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pyFTS/hyperparam/Evolutionary.html#lag_crossover2"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyFTS.hyperparam.Evolutionary.lag_crossover2" title="Permalink to this definition"></a></dt>
<dd><p>Cross over two lag genes</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>best</strong> best genotype</p></li>
<li><p><strong>worst</strong> worst genotype</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>a tuple (order, lags)</p>
</dd>
</dl>
</dd></dl>
<dl class="py function">
<dt id="pyFTS.hyperparam.Evolutionary.log_result">
<code class="sig-prename descclassname">pyFTS.hyperparam.Evolutionary.</code><code class="sig-name descname">log_result</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">conn</span></em>, <em class="sig-param"><span class="n">datasetname</span></em>, <em class="sig-param"><span class="n">fts_method</span></em>, <em class="sig-param"><span class="n">result</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pyFTS/hyperparam/Evolutionary.html#log_result"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyFTS.hyperparam.Evolutionary.log_result" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py function">
<dt id="pyFTS.hyperparam.Evolutionary.mutation">
<code class="sig-prename descclassname">pyFTS.hyperparam.Evolutionary.</code><code class="sig-name descname">mutation</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">individual</span></em>, <em class="sig-param"><span class="o">**</span><span class="n">kwargs</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pyFTS/hyperparam/Evolutionary.html#mutation"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyFTS.hyperparam.Evolutionary.mutation" title="Permalink to this definition"></a></dt>
<dd><p>Mutation operator</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>individual</strong> an individual genotype</p></li>
<li><p><strong>pmut</strong> individual probability o</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p></p>
</dd>
</dl>
</dd></dl>
<dl class="py function">
<dt id="pyFTS.hyperparam.Evolutionary.mutation_lags">
<code class="sig-prename descclassname">pyFTS.hyperparam.Evolutionary.</code><code class="sig-name descname">mutation_lags</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">lags</span></em>, <em class="sig-param"><span class="n">order</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pyFTS/hyperparam/Evolutionary.html#mutation_lags"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyFTS.hyperparam.Evolutionary.mutation_lags" title="Permalink to this definition"></a></dt>
<dd><p>Mutation operation for lags gene</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>lags</strong> </p></li>
<li><p><strong>order</strong> </p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p></p>
</dd>
</dl>
</dd></dl>
<dl class="py function">
<dt id="pyFTS.hyperparam.Evolutionary.persist_statistics">
<code class="sig-prename descclassname">pyFTS.hyperparam.Evolutionary.</code><code class="sig-name descname">persist_statistics</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">datasetname</span></em>, <em class="sig-param"><span class="n">statistics</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pyFTS/hyperparam/Evolutionary.html#persist_statistics"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyFTS.hyperparam.Evolutionary.persist_statistics" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py function">
<dt id="pyFTS.hyperparam.Evolutionary.phenotype">
<code class="sig-prename descclassname">pyFTS.hyperparam.Evolutionary.</code><code class="sig-name descname">phenotype</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">individual</span></em>, <em class="sig-param"><span class="n">train</span></em>, <em class="sig-param"><span class="n">fts_method</span></em>, <em class="sig-param"><span class="n">parameters</span><span class="o">=</span><span class="default_value">{}</span></em>, <em class="sig-param"><span class="o">**</span><span class="n">kwargs</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pyFTS/hyperparam/Evolutionary.html#phenotype"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyFTS.hyperparam.Evolutionary.phenotype" title="Permalink to this definition"></a></dt>
<dd><p>Instantiate the genotype, creating a fitted model with the genotype hyperparameters</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>individual</strong> a genotype</p></li>
<li><p><strong>train</strong> the training dataset</p></li>
<li><p><strong>fts_method</strong> the FTS method</p></li>
<li><p><strong>parameters</strong> dict with model specific arguments for fit method.</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>a fitted FTS model</p>
</dd>
</dl>
</dd></dl>
<dl class="py function">
<dt id="pyFTS.hyperparam.Evolutionary.process_experiment">
<code class="sig-prename descclassname">pyFTS.hyperparam.Evolutionary.</code><code class="sig-name descname">process_experiment</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">fts_method</span></em>, <em class="sig-param"><span class="n">result</span></em>, <em class="sig-param"><span class="n">datasetname</span></em>, <em class="sig-param"><span class="n">conn</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pyFTS/hyperparam/Evolutionary.html#process_experiment"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyFTS.hyperparam.Evolutionary.process_experiment" title="Permalink to this definition"></a></dt>
<dd><p>Persist the results of an DEHO execution in sqlite database (best hyperparameters) and json file (generation statistics)</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>fts_method</strong> </p></li>
<li><p><strong>result</strong> </p></li>
<li><p><strong>datasetname</strong> </p></li>
<li><p><strong>conn</strong> </p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p></p>
</dd>
</dl>
</dd></dl>
<dl class="py function">
<dt id="pyFTS.hyperparam.Evolutionary.random_genotype">
<code class="sig-prename descclassname">pyFTS.hyperparam.Evolutionary.</code><code class="sig-name descname">random_genotype</code><span class="sig-paren">(</span><em class="sig-param"><span class="o">**</span><span class="n">kwargs</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pyFTS/hyperparam/Evolutionary.html#random_genotype"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyFTS.hyperparam.Evolutionary.random_genotype" title="Permalink to this definition"></a></dt>
<dd><p>Create random genotype</p>
<dl class="field-list simple">
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p>the genotype, a dictionary with all hyperparameters</p>
</dd>
</dl>
</dd></dl>
<dl class="py function">
<dt id="pyFTS.hyperparam.Evolutionary.tournament">
<code class="sig-prename descclassname">pyFTS.hyperparam.Evolutionary.</code><code class="sig-name descname">tournament</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">population</span></em>, <em class="sig-param"><span class="n">objective</span></em>, <em class="sig-param"><span class="o">**</span><span class="n">kwargs</span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pyFTS/hyperparam/Evolutionary.html#tournament"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pyFTS.hyperparam.Evolutionary.tournament" title="Permalink to this definition"></a></dt>
<dd><p>Simple tournament selection strategy.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>population</strong> the population</p></li>
<li><p><strong>objective</strong> the objective to be considered on tournament</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p></p>
</dd>
</dl>
</dd></dl>
2018-11-13 18:11:49 +04:00
</div>
</div>
2020-08-19 00:06:41 +04:00
<div class="clearer"></div>
2018-11-13 18:11:49 +04:00
</div>
</div>
</div>
2020-08-19 00:06:41 +04:00
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebarwrapper">
<h3><a href="index.html">Table of Contents</a></h3>
<ul>
<li><a class="reference internal" href="#">pyFTS.hyperparam package</a><ul>
<li><a class="reference internal" href="#module-pyFTS.hyperparam">Module contents</a></li>
<li><a class="reference internal" href="#submodules">Submodules</a></li>
<li><a class="reference internal" href="#module-pyFTS.hyperparam.Util">pyFTS.hyperparam.Util module</a></li>
2021-01-13 01:04:42 +04:00
<li><a class="reference internal" href="#module-pyFTS.hyperparam.GridSearch">pyFTS.hyperparam.GridSearch module</a></li>
<li><a class="reference internal" href="#module-pyFTS.hyperparam.Evolutionary">pyFTS.hyperparam.Evolutionary module</a></li>
2020-08-19 00:06:41 +04:00
</ul>
</li>
</ul>
<h4>Previous topic</h4>
<p class="topless"><a href="pyFTS.distributed.html"
title="previous chapter">pyFTS.distributed package</a></p>
<h4>Next topic</h4>
<p class="topless"><a href="pyFTS.models.html"
title="next chapter">pyFTS.models package</a></p>
<div role="note" aria-label="source link">
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="_sources/pyFTS.hyperparam.rst.txt"
rel="nofollow">Show Source</a></li>
</ul>
</div>
<div id="searchbox" style="display: none" role="search">
<h3 id="searchlabel">Quick search</h3>
<div class="searchformwrapper">
<form class="search" action="search.html" method="get">
<input type="text" name="q" aria-labelledby="searchlabel" />
<input type="submit" value="Go" />
</form>
</div>
</div>
<script>$('#searchbox').show(0);</script>
</div>
</div>
2018-11-13 18:11:49 +04:00
<div class="clearer"></div>
</div>
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
>index</a></li>
<li class="right" >
<a href="py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="right" >
<a href="pyFTS.models.html" title="pyFTS.models package"
>next</a> |</li>
<li class="right" >
2019-02-21 19:00:09 +04:00
<a href="pyFTS.distributed.html" title="pyFTS.distributed package"
2018-11-13 18:11:49 +04:00
>previous</a> |</li>
<li class="nav-item nav-item-0"><a href="index.html">pyFTS 1.6 documentation</a> &#187;</li>
2018-11-13 18:11:49 +04:00
<li class="nav-item nav-item-1"><a href="modules.html" >pyFTS</a> &#187;</li>
2020-08-19 00:06:41 +04:00
<li class="nav-item nav-item-2"><a href="pyFTS.html" >pyFTS package</a> &#187;</li>
<li class="nav-item nav-item-this"><a href="">pyFTS.hyperparam package</a></li>
2018-11-13 18:11:49 +04:00
</ul>
</div>
<div class="footer" role="contentinfo">
&#169; Copyright 2018, Machine Intelligence and Data Science Laboratory - UFMG - Brazil.
2020-08-19 00:06:41 +04:00
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 3.1.2.
2018-11-13 18:11:49 +04:00
</div>
</body>
</html>