metacountregressor 0.1.315__py3-none-any.whl → 0.1.317__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.
- metacountregressor/solution.py +52 -13
- {metacountregressor-0.1.315.dist-info → metacountregressor-0.1.317.dist-info}/METADATA +1 -1
- {metacountregressor-0.1.315.dist-info → metacountregressor-0.1.317.dist-info}/RECORD +6 -6
- {metacountregressor-0.1.315.dist-info → metacountregressor-0.1.317.dist-info}/WHEEL +0 -0
- {metacountregressor-0.1.315.dist-info → metacountregressor-0.1.317.dist-info}/licenses/LICENSE.txt +0 -0
- {metacountregressor-0.1.315.dist-info → metacountregressor-0.1.317.dist-info}/top_level.txt +0 -0
metacountregressor/solution.py
CHANGED
@@ -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
|
-
|
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['
|
1044
|
+
for i in model_nature['transform_hetro']:
|
1039
1045
|
abct = abct + i
|
1040
|
-
for i in model_nature['
|
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
|
4883
|
+
print('this should not happeb but why', Kr_b, 'kr)b is')
|
4878
4884
|
|
4879
4885
|
if Kr_b != Kr_a:
|
4880
|
-
print('
|
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
|
-
|
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
|
-
|
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['
|
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'):
|
@@ -11,10 +11,10 @@ metacountregressor/pareto_file.py,sha256=whySaoPAUWYjyI8zo0hwAOa3rFk6SIUlHSpqZiL
|
|
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=
|
14
|
+
metacountregressor/solution.py,sha256=ap9HscK_9N1m3jpgJju75Y7LLxZ8Kxa-Pkcg1hBnkZI,321872
|
15
15
|
metacountregressor/test_generated_paper2.py,sha256=pwOoRzl1jJIIOUAAvbkT6HmmTQ81mwpsshn9SLdKOg8,3927
|
16
|
-
metacountregressor-0.1.
|
17
|
-
metacountregressor-0.1.
|
18
|
-
metacountregressor-0.1.
|
19
|
-
metacountregressor-0.1.
|
20
|
-
metacountregressor-0.1.
|
16
|
+
metacountregressor-0.1.317.dist-info/licenses/LICENSE.txt,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
|
17
|
+
metacountregressor-0.1.317.dist-info/METADATA,sha256=eaozI5zX4AjG-rz0NJ6b8BvpI46FehiiVzq8yYbtTGk,23581
|
18
|
+
metacountregressor-0.1.317.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
|
19
|
+
metacountregressor-0.1.317.dist-info/top_level.txt,sha256=zGG7UC5WIpr76gsFUpwJ4En2aCcoNTONBaS3OewwjR0,19
|
20
|
+
metacountregressor-0.1.317.dist-info/RECORD,,
|
File without changes
|
{metacountregressor-0.1.315.dist-info → metacountregressor-0.1.317.dist-info}/licenses/LICENSE.txt
RENAMED
File without changes
|
File without changes
|