metacountregressor 0.1.313__tar.gz → 0.1.315__tar.gz

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.
Files changed (31) hide show
  1. {metacountregressor-0.1.313/metacountregressor.egg-info → metacountregressor-0.1.315}/PKG-INFO +1 -1
  2. {metacountregressor-0.1.313 → metacountregressor-0.1.315}/metacountregressor/solution.py +52 -13
  3. {metacountregressor-0.1.313 → metacountregressor-0.1.315/metacountregressor.egg-info}/PKG-INFO +1 -1
  4. metacountregressor-0.1.315/version.txt +1 -0
  5. metacountregressor-0.1.313/version.txt +0 -1
  6. {metacountregressor-0.1.313 → metacountregressor-0.1.315}/LICENSE.txt +0 -0
  7. {metacountregressor-0.1.313 → metacountregressor-0.1.315}/MANIFEST.in +0 -0
  8. {metacountregressor-0.1.313 → metacountregressor-0.1.315}/README.md +0 -0
  9. {metacountregressor-0.1.313 → metacountregressor-0.1.315}/README.rst +0 -0
  10. {metacountregressor-0.1.313 → metacountregressor-0.1.315}/metacountregressor/__init__.py +0 -0
  11. {metacountregressor-0.1.313 → metacountregressor-0.1.315}/metacountregressor/_device_cust.py +0 -0
  12. {metacountregressor-0.1.313 → metacountregressor-0.1.315}/metacountregressor/app_main.py +0 -0
  13. {metacountregressor-0.1.313 → metacountregressor-0.1.315}/metacountregressor/data_split_helper.py +0 -0
  14. {metacountregressor-0.1.313 → metacountregressor-0.1.315}/metacountregressor/halton.py +0 -0
  15. {metacountregressor-0.1.313 → metacountregressor-0.1.315}/metacountregressor/helperprocess.py +0 -0
  16. {metacountregressor-0.1.313 → metacountregressor-0.1.315}/metacountregressor/main.py +0 -0
  17. {metacountregressor-0.1.313 → metacountregressor-0.1.315}/metacountregressor/main_old.py +0 -0
  18. {metacountregressor-0.1.313 → metacountregressor-0.1.315}/metacountregressor/metaheuristics.py +0 -0
  19. {metacountregressor-0.1.313 → metacountregressor-0.1.315}/metacountregressor/pareto_file.py +0 -0
  20. {metacountregressor-0.1.313 → metacountregressor-0.1.315}/metacountregressor/pareto_logger__plot.py +0 -0
  21. {metacountregressor-0.1.313 → metacountregressor-0.1.315}/metacountregressor/setup.py +0 -0
  22. {metacountregressor-0.1.313 → metacountregressor-0.1.315}/metacountregressor/single_objective_finder.py +0 -0
  23. {metacountregressor-0.1.313 → metacountregressor-0.1.315}/metacountregressor/test_generated_paper2.py +0 -0
  24. {metacountregressor-0.1.313 → metacountregressor-0.1.315}/metacountregressor.egg-info/SOURCES.txt +0 -0
  25. {metacountregressor-0.1.313 → metacountregressor-0.1.315}/metacountregressor.egg-info/dependency_links.txt +0 -0
  26. {metacountregressor-0.1.313 → metacountregressor-0.1.315}/metacountregressor.egg-info/not-zip-safe +0 -0
  27. {metacountregressor-0.1.313 → metacountregressor-0.1.315}/metacountregressor.egg-info/requires.txt +0 -0
  28. {metacountregressor-0.1.313 → metacountregressor-0.1.315}/metacountregressor.egg-info/top_level.txt +0 -0
  29. {metacountregressor-0.1.313 → metacountregressor-0.1.315}/setup.cfg +0 -0
  30. {metacountregressor-0.1.313 → metacountregressor-0.1.315}/setup.py +0 -0
  31. {metacountregressor-0.1.313 → metacountregressor-0.1.315}/tests/test.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: metacountregressor
3
- Version: 0.1.313
3
+ Version: 0.1.315
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
@@ -459,8 +459,14 @@ class ObjectiveFunction(object):
459
459
 
460
460
  if self.G is not None:
461
461
  #TODO need to handle this for groups
462
- self._distribution = ["trad| " + item for item in self._distribution
462
+ print('group by groups off for now')
463
+ NAH_GROUP = 0
464
+ if NAH_GROUP:
465
+ self._distribution = ["trad| " + item for item in self._distribution
463
466
  ] + ["grpd| " + item for item in self._distribution]
467
+ else:
468
+ self._distribution = ["trad| " + item for item in self._distribution
469
+ ]
464
470
 
465
471
  # output information
466
472
  self.convergence = None
@@ -1035,9 +1041,9 @@ class ObjectiveFunction(object):
1035
1041
 
1036
1042
  abct = []
1037
1043
  hetro_long = hetro_long + hetro_std
1038
- for i in model_nature['transfrom_hetro']:
1044
+ for i in model_nature['transform_hetro']:
1039
1045
  abct = abct + i
1040
- for i in model_nature['transfrom_hetro']:
1046
+ for i in model_nature['transform_hetro']:
1041
1047
  abct = abct + ['']
1042
1048
  else:
1043
1049
  big_hetro = []
@@ -3563,9 +3569,9 @@ class ObjectiveFunction(object):
3563
3569
  def _chol_mat(self, correlationLength, br, Br_w, correlation):
3564
3570
  # if correlation = True correlation pos is randpos, if list get correct pos
3565
3571
 
3572
+ print(self.rdm_grouped_fit, 'i think this causes the errror')
3566
3573
 
3567
-
3568
- varnames = self.none_handler(
3574
+ varnames = self.none_handler(self.grouped_rpm)+ self.none_handler(
3569
3575
  self.rdm_fit) + self.none_handler(self.rdm_cor_fit)
3570
3576
 
3571
3577
 
@@ -4874,11 +4880,17 @@ class ObjectiveFunction(object):
4874
4880
  n_coeff = self.get_param_num(dispersion)
4875
4881
  Kf_a, Kr_a, Kr_c, Kr_b_a, Kchol_a, Kh = self.get_num_params()
4876
4882
  if Kchol_a != Kchol:
4877
- print('this should not hh qhy')
4883
+ print('this should not happeb but why', Kr_b, 'kr)b is')
4878
4884
 
4879
4885
  if Kr_b != Kr_a:
4880
- print('hold qhy this should never happen')
4886
+ print('self.rdm_cor_fit', self.rdm_cor_fit)
4887
+ print('grouped_fit', self.rdm_grouped_fit)
4888
+ print('self.rdm_fit', self.rdm_fit)
4889
+ print('odd, check this this should never happen')
4890
+
4891
+
4881
4892
 
4893
+ self.sanity_check(Xr, self.grouped_rpm)
4882
4894
 
4883
4895
 
4884
4896
 
@@ -4971,7 +4983,8 @@ class ObjectiveFunction(object):
4971
4983
  betas_hetro = betas[Kf + Kr + Kr_b + Kchol:Kf + Kr + Kr_b + Kchol + KFH]
4972
4984
  # betas_hetro = betas[:Xdh.shape[2]+1]
4973
4985
  betas_hetro_sd = betas[Kf + Kr + Kr_b + Kchol + KFH:Kf + Kr + Kr_b + Kchol + KFH + KFHs]
4974
- if KFHs > 1:
4986
+
4987
+ if KFHs >= 1:
4975
4988
  # print('now what how do i split')
4976
4989
  x_i_h = model_nature.get('x_h_storage_test') if test_set else model_nature.get('x_h_storage')
4977
4990
  if test_set == 2:
@@ -4992,6 +5005,7 @@ class ObjectiveFunction(object):
4992
5005
  Vdh += dev.cust_einsum("njk,nkr -> njr", i, Bh)
4993
5006
 
4994
5007
  else:
5008
+ print('this will not work cause i cant trul the right drawse')
4995
5009
  Bh = self._transform_rand_betas(betas_hetro, betas_hetro_sd, draws_hetro)
4996
5010
 
4997
5011
  Vdh = dev.cust_einsum("njk,nkr -> njr", Xdh, Bh)
@@ -5971,13 +5985,13 @@ class ObjectiveFunction(object):
5971
5985
  Solution object with updated objectives.
5972
5986
  """
5973
5987
  # Extract relevant data
5974
- X, Xr, XG = mod.get('X'), mod.get('Xr'), mod.get('XG')
5988
+ X, Xr, XG, XH= mod.get('X'), mod.get('Xr'), mod.get('XG'), mod.get('XH')
5975
5989
  distribution = mod.get('dist_fit')
5976
5990
 
5977
5991
  # Prepare draws
5978
5992
  draws = self._prepare_draws(Xr, distribution)
5979
5993
  draws_grouped = self._prepare_grouped_draws(XG, mod) if XG is not None else None
5980
-
5994
+ mod = self._prepare_hetro(mod)
5981
5995
  # Optimization method and options
5982
5996
  method = self.method_ll if bounds is None else 'L-BFGS-B'
5983
5997
 
@@ -6451,6 +6465,27 @@ class ObjectiveFunction(object):
6451
6465
  return self.prepare_halton(
6452
6466
  n_random_effects, n_samples, self.Ndraws, distribution, long=False, slice_this_way=self.group_halton
6453
6467
  )
6468
+
6469
+ def _prepare_hetro(self, mod):
6470
+ if 'XH' in mod and len(mod.get('hetro_hold')) > 0:
6471
+
6472
+ XH = mod.get('XH')
6473
+
6474
+ styd = list(mod.get('hetro_hold').keys())
6475
+
6476
+ nh, ph, ______ = XH.shape
6477
+ kgh = len(mod.get('hetro_hold'))
6478
+ draws_hetro = self.prepare_halton(kgh, nh, self.Ndraws, styd, slice_this_way=self.group_halton)
6479
+ mod['draws_hetro'] = draws_hetro.copy()
6480
+ if self.is_multi:
6481
+ XHtest = mod.get('XH_test')
6482
+ nht, pht, ______ = XHtest.shape
6483
+ draws_hetro_test = self.prepare_halton(kgh, nht, self.Ndraws, styd,
6484
+ slice_this_way=self.group_halton_test)
6485
+ mod['draws_hetro_test'] = draws_hetro_test.copy()
6486
+ return mod
6487
+
6488
+
6454
6489
 
6455
6490
  def _prepare_grouped_draws(self, XG, mod):
6456
6491
  """
@@ -7216,8 +7251,12 @@ class ObjectiveFunction(object):
7216
7251
  indices = [i for i, name in enumerate(self._characteristics_names) if name in names and isinstance(name, str)]
7217
7252
  return indices
7218
7253
 
7219
- def sanity_check(self, Xr):
7220
- a =len(self.rdm_cor_fit)+len(self.rdm_fit) != Xr.shape[2]
7254
+ def sanity_check(self, Xr, grouped_rpm = None):
7255
+ if grouped_rpm is None:
7256
+ a =len(self.rdm_cor_fit)+len(self.rdm_fit) != Xr.shape[2]
7257
+ else:
7258
+ a = len(self.none_handler(self.rdm_cor_fit)) + len(self.none_handler(self.rdm_fit)) + len(self.none_handler(grouped_rpm)) != Xr.shape[2]
7259
+
7221
7260
  if a:
7222
7261
  print('why')
7223
7262
  print('The number of random effects does not match the data')
@@ -7291,7 +7330,7 @@ class ObjectiveFunction(object):
7291
7330
  X_h_test = df_test[:, :, indices_hetro]
7292
7331
  x_h_storage_test.append(X_h_test)
7293
7332
  model_nature['x_h_storage'] = x_h_storage
7294
- model_nature['transfrom_hetro'] = transform_hetro
7333
+ model_nature['transform_hetro'] = transform_hetro
7295
7334
  model_nature['x_h_storage_test'] = x_h_storage_test
7296
7335
 
7297
7336
  if hasattr(self, 'group_dummies'):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: metacountregressor
3
- Version: 0.1.313
3
+ Version: 0.1.315
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
@@ -0,0 +1 @@
1
+ 0.1.315
@@ -1 +0,0 @@
1
- 0.1.313