metacountregressor 0.1.312__py3-none-any.whl → 0.1.313__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.
@@ -615,10 +615,16 @@ class DifferentialEvolution(object):
615
615
  obj_trial = self._obj_fun.get_fitness(trial, self.pf.get_objective_is_multi())
616
616
  if not self.pf.get_objective_is_multi():
617
617
  average_iteration += obj_trial[self._obj_fun._obj_1]
618
- logger(i, obj_trial, None, True, self.get_instance_name(), 1)
619
- else:
620
- logger(i, obj_trial, None, True, self.get_instance_name(), self.pf.get_objective_is_multi())
618
+ try:
621
619
 
620
+ logger(i, obj_trial, None, True, self.get_instance_name(), 1)
621
+ except:
622
+ pass
623
+ else:
624
+ try:
625
+ logger(i, obj_trial, None, True, self.get_instance_name(), self.pf.get_objective_is_multi())
626
+ except:
627
+ pass
622
628
  except Exception as e:
623
629
  print('why is there an exception')
624
630
  print(e)
@@ -637,7 +643,7 @@ class DifferentialEvolution(object):
637
643
 
638
644
  iterations_without_improvement = 0
639
645
  self._population[j] = obj_trial
640
-
646
+
641
647
  logger(self.it_process, obj_trial, self._population, True,
642
648
  self.instance_number + '/population_logger_strict_non_pareto.csv', 1)
643
649
  logger(self.it_process, obj_trial, self._pareto_population, True,
@@ -3557,6 +3557,9 @@ class ObjectiveFunction(object):
3557
3557
  varnames if x not in correlation]
3558
3558
  return
3559
3559
 
3560
+
3561
+
3562
+
3560
3563
  def _chol_mat(self, correlationLength, br, Br_w, correlation):
3561
3564
  # if correlation = True correlation pos is randpos, if list get correct pos
3562
3565
 
@@ -3601,13 +3604,15 @@ class ObjectiveFunction(object):
3601
3604
  try:
3602
3605
  rv_val = chol[chol_count] if is_correlated else br_w[rv_count]
3603
3606
  except:
3607
+ print('exception here start')
3604
3608
  print(self.rdm_cor_fit, 'rdm_cor_fit')
3605
3609
  print(self.rdm_fit, 'rdm_fit')
3606
3610
  print('varnames', varnames)
3607
- print(br, 'br')
3611
+ print('br', br, 'br')
3608
3612
  print(Br_w, 'Br_w')
3609
3613
  print(chol, 'chol')
3610
3614
  print(br_w, 'br_w')
3615
+ print('exception here end')
3611
3616
  chol_mat_temp[rv_count_all, rv_count_all] = rv_val
3612
3617
  rv_count_all += 1
3613
3618
  if is_correlated:
@@ -4869,10 +4874,10 @@ class ObjectiveFunction(object):
4869
4874
  n_coeff = self.get_param_num(dispersion)
4870
4875
  Kf_a, Kr_a, Kr_c, Kr_b_a, Kchol_a, Kh = self.get_num_params()
4871
4876
  if Kchol_a != Kchol:
4872
- print('hold qhy')
4877
+ print('this should not hh qhy')
4873
4878
 
4874
- if Kr_b != Kr_b_a:
4875
- print('hold qhy')
4879
+ if Kr_b != Kr_a:
4880
+ print('hold qhy this should never happen')
4876
4881
 
4877
4882
 
4878
4883
 
@@ -4886,13 +4891,14 @@ class ObjectiveFunction(object):
4886
4891
 
4887
4892
  )
4888
4893
  Bf = betas[0:Kf] # Fixed betas
4889
-
4890
-
4891
- # Bf_new, Br_new, Br_std_new, Br_rema = self.extract_parameters(betas, Kf, Kr, Kchol_a, Kr_b_a)
4894
+ TEST_ME = False
4895
+ if not TEST_ME:
4896
+ Bf, br, br_std, Br_rema = self.extract_parameters(betas, Kf, Kr, Kchol_a, Kr_b_a)
4892
4897
 
4893
4898
 
4894
4899
  Vdf = dev.np.einsum('njk,k -> nj', Xdf, Bf, dtype=np.float64) # (N, P)
4895
- br = betas[Kf:Kf + Kr]
4900
+ if TEST_ME:
4901
+ br = betas[Kf:Kf + Kr]
4896
4902
 
4897
4903
 
4898
4904
 
@@ -4910,9 +4916,9 @@ class ObjectiveFunction(object):
4910
4916
  # Kchol_a + Krb_a
4911
4917
  #its grabbing from the
4912
4918
 
4919
+ if TEST_ME:
4913
4920
 
4914
-
4915
- brstd = betas[Kf + Kr:Kf + Kr + Kr_b + Kchol]
4921
+ brstd = betas[Kf + Kr:Kf + Kr + Kr_b + Kchol]
4916
4922
 
4917
4923
  # initialises size matrix
4918
4924
  proba = [] # Temp batching storage
@@ -7209,6 +7215,20 @@ class ObjectiveFunction(object):
7209
7215
  indices = [i for i, name in enumerate(self._characteristics_names) if name in names and isinstance(name, str)]
7210
7216
  return indices
7211
7217
 
7218
+ def sanity_check(self, Xr):
7219
+ a =len(self.rdm_cor_fit)+len(self.rdm_fit) != Xr.shape[2]
7220
+ if a:
7221
+ print('why')
7222
+ print('The number of random effects does not match the data')
7223
+ print(Xr.shape)
7224
+ print(self.rdm_cor_fit)
7225
+ print(self.rdm_fit)
7226
+
7227
+ #raise Exception('The number of random effects does not match the data')
7228
+ else:
7229
+ return True
7230
+
7231
+
7212
7232
  """
7213
7233
  This function is named 'makeRegression'. It takes several parameters; 'self', 'model_nature', 'layout', '*args', and '**kwargs'.
7214
7234
  The purpose of this function is to execute a regression based on the training and testing datasets.
@@ -7315,7 +7335,7 @@ class ObjectiveFunction(object):
7315
7335
  Xr_cor = df_tf[:, :, indices3]
7316
7336
  # FIXME not sure if this is the right way orientatied
7317
7337
  Xr = np.concatenate((Xr, Xr_cor), axis=2)
7318
-
7338
+ self.sanity_check(Xr)
7319
7339
  model_nature['Xr'] = Xr
7320
7340
  if self.is_multi:
7321
7341
  Xr_test = df_test[:, :, indices2]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: metacountregressor
3
- Version: 0.1.312
3
+ Version: 0.1.313
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,15 +6,15 @@ metacountregressor/halton.py,sha256=jhovA45UBoZYU9g-hl6Lb2sBIx_ZBTNdPrpgkzR9fng,
6
6
  metacountregressor/helperprocess.py,sha256=komn_EjCShFg-_8INh1Q06GdWWN4nxhHOgJ3V1X6aJI,26309
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=P0Xjlvhp1cEwZFACrqeeets6x8BK7F2iDyu1OfS4bog,107010
9
+ metacountregressor/metaheuristics.py,sha256=Qhu06AdF8HwEpyN-Q-6deG4b4kr7BKslgL8i2T7t1aI,107234
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=k6SkxlVAR6MoPZi5zJ0xh39f-6UGxqZX1bL_XRb2MPk,319289
14
+ metacountregressor/solution.py,sha256=biAgfV5X4EXhzw1vGkNec53C-6ph02WpUWPtCQJfHKc,320016
15
15
  metacountregressor/test_generated_paper2.py,sha256=pwOoRzl1jJIIOUAAvbkT6HmmTQ81mwpsshn9SLdKOg8,3927
16
- metacountregressor-0.1.312.dist-info/licenses/LICENSE.txt,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
17
- metacountregressor-0.1.312.dist-info/METADATA,sha256=2SPbRZ94EwJOVLWVbFdHjbmHXYa53AEmrIpmjcmESMA,23581
18
- metacountregressor-0.1.312.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
19
- metacountregressor-0.1.312.dist-info/top_level.txt,sha256=zGG7UC5WIpr76gsFUpwJ4En2aCcoNTONBaS3OewwjR0,19
20
- metacountregressor-0.1.312.dist-info/RECORD,,
16
+ metacountregressor-0.1.313.dist-info/licenses/LICENSE.txt,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
17
+ metacountregressor-0.1.313.dist-info/METADATA,sha256=kUz8SzD7wzpQxrwHbBSqlIqA7ZRnkJClAMvxYlZVrns,23581
18
+ metacountregressor-0.1.313.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
19
+ metacountregressor-0.1.313.dist-info/top_level.txt,sha256=zGG7UC5WIpr76gsFUpwJ4En2aCcoNTONBaS3OewwjR0,19
20
+ metacountregressor-0.1.313.dist-info/RECORD,,