def _add_transform_genes(self): """Sets up for evolution of the ARIMA model.""" self._alleles.add(pu.make_int_gene(1, 1, 10, 1)) # 'AR' backshift (p) self._alleles.add(pu.make_choice_gene(1, [0, 1, 2])) # 'I' backshift (d) self._alleles.add(pu.make_choice_gene(1, [1, 2, 3])) # 'MA' backshift (q) self._loci_list += ['AR_order', 'I_order', 'MA_order']
def _add_transform_genes(self): """Sets up for evolution of a seasonal ARIMA model.""" self._alleles.add(pu.make_int_gene(1, 1, 10, 1)) # 'AR' backshift (p) self._alleles.add(pu.make_choice_gene(1, [0, 1, 2])) # 'I' backshift (d) self._alleles.add(pu.make_choice_gene(1, [1, 2, 3])) # 'MA' backshift (q) self._alleles.add(pu.make_int_gene(1, 1, 10, 1)) # Seasonal 'AR' backshift (p) self._alleles.add(pu.make_choice_gene(1, [0, 1, 2])) # Seasonal 'I' backshift (d) self._alleles.add(pu.make_choice_gene(1, [1, 2, 3])) # Seasonal 'MA' backshift (q) self._loci_list += ['AR_order', 'I_order', 'MA_order', 'ssn_AR_order', 'ssn_I_order', 'ssn_MA_order']
def _add_cleaning_genes(self): def _smoothlist(): return np.concatenate((np.arange(0.001, 0.01, 0.001), np.arange(0.01, 0.1, 0.01), np.arange(0.1, 1, 0.1), np.arange(1, 10, 1), np.arange(10, 100, 10), np.arange(100, 1000, 100))) if not self._options.no_cleaning: self._alleles.add(pu.make_choice_gene(1, _smoothlist()), weight=1) self._alleles.add(pu.make_choice_gene(1, _smoothlist()), weight=1) self._alleles.add(pu.make_choice_gene(1, np.arange(0.1, 3.05, 0.1)), weight=1) self._alleles.add(pu.make_choice_gene(1, np.arange(0.1, 3.05, 0.1)), weight=1) self._loci_list += ['t_smooth', 'l_smooth', 't_zscore', 'l_zscore']
def _add_transform_genes(self): """This is where the models are defined. The models are passed to the GA engine for evolution of the optimal set of parameters. Afterwards, the models are tested, and performance is measured.""" self._alleles.add(pu.make_int_gene(1, 1, 10, 1)) # Scale self._alleles.add(pu.make_choice_gene(1, [2])) # Aj, in the paper 2 gives best results. gene = pu.make_choice_gene(1, [i for i in self._hindsight_days]) self._alleles.add(gene, weight=1) if options.no_cleaning: loci = sg.utils.Enum('scale', 'Aj') else: loci = sg.utils.Enum('scale', 'Aj', 't_smooth', 'l_smooth', 't_zscore', 'l_zscore')
def _add_transform_genes(self): """This is where the models are defined. The models are passed to the GA engine for evolution of the optimal set of parameters. Afterwards, the models are tested, and performance is measured.""" self._alleles.add(pu.make_int_gene(1, 1, 10, 1)) # Scale self._alleles.add(pu.make_choice_gene( 1, [2])) # Aj, in the paper 2 gives best results. gene = pu.make_choice_gene(1, [i for i in self._hindsight_days]) self._alleles.add(gene, weight=1) if options.no_cleaning: loci = sg.utils.Enum('scale', 'Aj') else: loci = sg.utils.Enum('scale', 'Aj', 't_smooth', 'l_smooth', 't_zscore', 'l_zscore')
def _add_transform_genes(self): """This is where the models are defined. The models are passed to the GA engine for evolution of the optimal set of parameters. Afterwards, the models are tested, and performance is measured.""" self._alleles.add(pu.make_int_gene(1, 1, 10, 1)) # Scale self._alleles.add(pu.make_choice_gene(1, [2])) # Aj, in the paper 2 gives best results. self._loci_list += ['scale', 'Aj']
def _add_transform_genes(self): """Sets up for evolution of the ESN model.""" # The 24 hour lags. gene = pu.make_choice_gene(1, [i for i in self._hindsight_days]) self._alleles.add(gene, weight=1) self._loci_list += ['lags'] ESNModelCreator._add_transform_genes(self)
def _add_transform_genes(self): """This is where the models are defined. The models are passed to the GA engine for evolution of the optimal set of parameters. Afterwards, the models are tested, and performance is measured.""" self._alleles.add(pu.make_int_gene(1, 1, 10, 1)) # Scale self._alleles.add(pu.make_choice_gene( 1, [2])) # Aj, in the paper 2 gives best results. self._loci_list += ['scale', 'Aj']
def _add_cleaning_genes(self): def _smoothlist(): return np.concatenate( (np.arange(0.001, 0.01, 0.001), np.arange(0.01, 0.1, 0.01), np.arange(0.1, 1, 0.1), np.arange(1, 10, 1), np.arange(10, 100, 10), np.arange(100, 1000, 100))) if not self._options.no_cleaning: self._alleles.add(pu.make_choice_gene(1, _smoothlist()), weight=1) self._alleles.add(pu.make_choice_gene(1, _smoothlist()), weight=1) self._alleles.add(pu.make_choice_gene(1, np.arange(0.1, 3.05, 0.1)), weight=1) self._alleles.add(pu.make_choice_gene(1, np.arange(0.1, 3.05, 0.1)), weight=1) self._loci_list += ['t_smooth', 'l_smooth', 't_zscore', 'l_zscore']
def _add_transform_genes(self): """Sets up for evolution of the ESN model.""" self._alleles.add(pu.make_int_gene(1, 10, 500, 25), weight=1) # Network size self._alleles.add(pu.make_real_gene(1, 0, 1, 0.05), weight=1) # Leak rate self._alleles.add(pu.make_real_gene(1, 0.1, 0.75, 0.05), weight=1) # Input scaling self._alleles.add(pu.make_real_gene(1, 0, 1, 0.05), weight=1) # Bias scaling self._alleles.add(pu.make_real_gene(1, 0.5, 2, 0.05), weight=1) # Spectral radius # We don't want too many seeds per evolutions, but we don't want to # always evolve on the same 5 networks either: self._alleles.add(pu.make_choice_gene( 1, np.random.random_integers(0, 2**16, 5)), weight=1) # Seed # Grid optimization showed that for a training length of 336, with # other params set based on previous gridopts and operating on the # total dataset rather than single AMS'es, optimal ridge was ~5. Scaled # thus 5/336=0.015. self._alleles.add(pu.make_choice_gene( 1, [0.0001/self._max_hindsight_hours]), weight=1) # Scaled ridge self._loci_list += ['size', 'leak', 'in_scale', 'bias_scale', 'spectral', 'seed', 'ridge' ]
def _add_hindsight_genes(self): gene = pu.make_choice_gene(1, [i * 24 for i in self._hindsight_days]) self._alleles.add(gene, weight=1) self._loci_list += ['hindsight']
def _add_hindsight_genes(self): gene = pu.make_choice_gene(1, [i*24 for i in self._hindsight_days]) self._alleles.add(gene, weight=1) self._loci_list += ['hindsight']