metacountregressor 1.0.5__py3-none-any.whl → 1.0.7__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -265,6 +265,10 @@ def simulated_annealing(objective_function, initial_slns=None, **kwargs):
265
265
  # else:
266
266
  # TEMP_ALPHA, MAX_STEPS, INTL_ACCEPT, STEPS, SWAP_PERC, NUM_INTL_SLNS, IS_MULTI= hyperparameters
267
267
  man = None
268
+ try:
269
+ objective_function.instance_number = str(0)
270
+ except:
271
+ pass
268
272
  if 'Manual_Fit' in kwargs:
269
273
  if kwargs['Manual_Fit'] is not None:
270
274
  man = kwargs['Manual_Fit']
@@ -292,7 +296,10 @@ def harmony_search(objective_function, initial_harmonies=None, hyperparameters=N
292
296
  objective_function._hms = kwargs.get('_hms')
293
297
  if kwargs.get('_hmcr') is not None:
294
298
  objective_function._hmcr = kwargs.get('_hmcr')
295
-
299
+ try:
300
+ objective_function.instance_number = str(0)
301
+ except:
302
+ pass
296
303
 
297
304
  man = None
298
305
  if 'Manual_Fit' in kwargs:
@@ -416,6 +423,10 @@ class DifferentialEvolution(object):
416
423
 
417
424
  def __init__(self, objective_function, **kwargs):
418
425
  objective_function.algorithm = 'de'
426
+ try:
427
+ objective_function.instance_number = str(0)
428
+ except:
429
+ pass
419
430
  self._obj_fun = objective_function
420
431
  if self._obj_fun._obj_1 is None:
421
432
  print('no objective found, automatically selecting BIC')
@@ -257,7 +257,7 @@ class ObjectiveFunction(object):
257
257
  self.test_percentage = float(kwargs.get('test_percentage', 0))
258
258
  self.val_percentage = float(kwargs.get('val_percentage', 0))
259
259
  if self.test_percentage == 0:
260
- print('test percentage is 0, please enter arg test_percentage as decimal, eg 0.8')
260
+ print('test percentage is 0, please enter arg test_percentage as decimal if intended for multi objective optimisation, eg 0.8')
261
261
  print('continuing single objective')
262
262
  time.sleep(2)
263
263
  self.is_multi = False
@@ -296,6 +296,7 @@ class ObjectiveFunction(object):
296
296
  ids = np.random.choice(N, training_size, replace=False)
297
297
  id_unique = np.array([i for i in range(N)])
298
298
  ids = id_unique[ids]
299
+ #todo make sure its split so counts are split
299
300
  train_idx = [ii for ii in range(len(id_unique)) if id_unique[ii] in ids]
300
301
  test_idx = [ii for ii in range(len(id_unique)) if id_unique[ii] not in ids]
301
302
  df_train = x_data.loc[train_idx, :]
@@ -429,7 +430,7 @@ class ObjectiveFunction(object):
429
430
 
430
431
 
431
432
 
432
- self.Ndraws = kwargs.get('Ndraws', 100)
433
+ self.Ndraws = kwargs.get('Ndraws', 200)
433
434
  self.draws1 = None
434
435
  self.initial_sig = 1 # pass the test of a single model
435
436
  self.pvalue_sig_value = .1
@@ -484,12 +485,24 @@ class ObjectiveFunction(object):
484
485
  self._discrete_values = self._discrete_values + \
485
486
  self.define_distributions_analyst(extra=kwargs.get('decisions', None))
486
487
 
487
- if 'model_types' in kwargs:
488
- model_types = kwargs['model_types']
488
+ if 'model_types' in kwargs or 'Model' in kwargs:
489
+ model_type_mapping = {
490
+ 'POS': 0,
491
+ 'NB': 1
492
+ }
493
+ model_types = kwargs.get('model_types', kwargs.get('Model', [[0,1]]))
494
+ converted_model_types = [
495
+ [model_type_mapping.get(item, item) for item in sublist]
496
+ for sublist in model_types
497
+ ]
498
+ model_types = converted_model_types
499
+ #this should be a list of list like [[0, 1]]
500
+ # also if it is [['POS', 'NB']] then it will be converted to [0, 1]
489
501
  else:
490
502
 
491
503
 
492
504
  model_types = [[0, 1]] # add 2 for Generalized Poisson
505
+
493
506
  #model_types = [[0]]
494
507
 
495
508
  if self.linear_regression:
@@ -1165,7 +1178,7 @@ class ObjectiveFunction(object):
1165
1178
  signif_list = self.pvalue_asterix_add(self.pvalues)
1166
1179
  if model == 1:
1167
1180
  # raise to the exponential
1168
- self.coeff_[-1] = np.maximum([np.exp(self.coeff_[-1]),2])
1181
+ self.coeff_[-1] = np.maximum(np.exp(self.coeff_[-1]),5)
1169
1182
  if self.no_extra_param:
1170
1183
  self.coeff_ = np.append(self.coeff_, self.nb_parma)
1171
1184
  self.stderr = np.append(self.stderr, 0.00001)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: metacountregressor
3
- Version: 1.0.5
3
+ Version: 1.0.7
4
4
  Summary: Extensive Testing for Estimation of Data Count Models
5
5
  Home-page: https://github.com/zahern/CountDataEstimation
6
6
  Author: Zeke Ahern
@@ -6,16 +6,16 @@ metacountregressor/halton.py,sha256=jhovA45UBoZYU9g-hl6Lb2sBIx_ZBTNdPrpgkzR9fng,
6
6
  metacountregressor/helperprocess.py,sha256=wW45-i31zy6rwaXt5PZt0GyR83PzF30jc9Wl4SQtnUI,26372
7
7
  metacountregressor/main.py,sha256=tGOm8DdbdyDf316qIxDAre6l6GzfJIWYNYIBaSeIemI,23685
8
8
  metacountregressor/main_old.py,sha256=eTS4ygq27MnU-dZ_j983Ucb-D5XfbVF8OJQK2hVVLZc,24123
9
- metacountregressor/metaheuristics.py,sha256=O6JYd5ezuC67uSqIKQfZNFWDkLbvPW0ujcm0TdHe5I8,107608
9
+ metacountregressor/metaheuristics.py,sha256=lAtDmQslzAC4Xg2Ozx4bnycz235le7-qEStlJFPa5xA,107881
10
10
  metacountregressor/pareto_file.py,sha256=whySaoPAUWYjyI8zo0hwAOa3rFk6SIUlHSpqZiLur0k,23096
11
11
  metacountregressor/pareto_logger__plot.py,sha256=mEU2QN4wmsM7t39GJ_XhJ_jjsdl09JOmG0U2jICrAkI,30037
12
12
  metacountregressor/setup.py,sha256=5UcQCCLR8Fm5odA3MX78WwahavxFq4mVD6oq0IuQvAY,936
13
13
  metacountregressor/single_objective_finder.py,sha256=jVG7GJBqzSP4_riYr-kMMKy_LE3SlGmKMunNhHYxgRg,8011
14
- metacountregressor/solution.py,sha256=ZyKFq39Mug5865vZQt4G2vv-oPgsnYuyrJJJVvwO1dA,323939
14
+ metacountregressor/solution.py,sha256=nY9L3X3mBUqbIopriHIzp9zXQOdhSt8dWj4Nx5Gu40Y,324648
15
15
  metacountregressor/test_code.py,sha256=_7Emm2JbhK_NVhxoqMhshN2JeHZtihZuSDl3Jpe7Ajk,1641
16
16
  metacountregressor/test_generated_paper2.py,sha256=pwOoRzl1jJIIOUAAvbkT6HmmTQ81mwpsshn9SLdKOg8,3927
17
- metacountregressor-1.0.5.dist-info/licenses/LICENSE.txt,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
18
- metacountregressor-1.0.5.dist-info/METADATA,sha256=utJe5zUXxsSoUvcaR3bzoUPhMeu8zfIstgn16eroHlo,23618
19
- metacountregressor-1.0.5.dist-info/WHEEL,sha256=pxyMxgL8-pra_rKaQ4drOZAegBVuX-G_4nRHjjgWbmo,91
20
- metacountregressor-1.0.5.dist-info/top_level.txt,sha256=zGG7UC5WIpr76gsFUpwJ4En2aCcoNTONBaS3OewwjR0,19
21
- metacountregressor-1.0.5.dist-info/RECORD,,
17
+ metacountregressor-1.0.7.dist-info/licenses/LICENSE.txt,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
18
+ metacountregressor-1.0.7.dist-info/METADATA,sha256=3-FuTS2ap0lEcxzmCiGjO6825DoAAqNuEuaEeaWVbnY,23618
19
+ metacountregressor-1.0.7.dist-info/WHEEL,sha256=ooBFpIzZCPdw3uqIQsOo4qqbA4ZRPxHnOH7peeONza0,91
20
+ metacountregressor-1.0.7.dist-info/top_level.txt,sha256=zGG7UC5WIpr76gsFUpwJ4En2aCcoNTONBaS3OewwjR0,19
21
+ metacountregressor-1.0.7.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (79.0.0)
2
+ Generator: setuptools (80.0.1)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5