metacountregressor 0.1.311__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.
- metacountregressor/metaheuristics.py +10 -4
- metacountregressor/solution.py +55 -36
- {metacountregressor-0.1.311.dist-info → metacountregressor-0.1.313.dist-info}/METADATA +1 -1
- {metacountregressor-0.1.311.dist-info → metacountregressor-0.1.313.dist-info}/RECORD +7 -7
- {metacountregressor-0.1.311.dist-info → metacountregressor-0.1.313.dist-info}/WHEEL +0 -0
- {metacountregressor-0.1.311.dist-info → metacountregressor-0.1.313.dist-info}/licenses/LICENSE.txt +0 -0
- {metacountregressor-0.1.311.dist-info → metacountregressor-0.1.313.dist-info}/top_level.txt +0 -0
@@ -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
|
-
|
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,
|
metacountregressor/solution.py
CHANGED
@@ -3549,37 +3549,30 @@ class ObjectiveFunction(object):
|
|
3549
3549
|
|
3550
3550
|
return inv_hess
|
3551
3551
|
|
3552
|
+
def _correlated_pos(self, correlation, varnames):
|
3553
|
+
if (isinstance(correlation, list)):
|
3554
|
+
correlationpos = [varnames.tolist().index(x) for x in
|
3555
|
+
varnames if x in correlation]
|
3556
|
+
uncorrelatedpos = [varnames.tolist().index(x) for x in
|
3557
|
+
varnames if x not in correlation]
|
3558
|
+
return
|
3559
|
+
|
3560
|
+
|
3561
|
+
|
3562
|
+
|
3552
3563
|
def _chol_mat(self, correlationLength, br, Br_w, correlation):
|
3553
3564
|
# if correlation = True correlation pos is randpos, if list get correct pos
|
3554
|
-
|
3555
|
-
|
3556
|
-
|
3557
|
-
|
3558
|
-
varnames = np.asarray(varnames)
|
3559
|
-
randvars = ['c', 'd', 'e', 'f']
|
3560
|
-
correlation = ['e', 'f']
|
3561
|
-
if randvars:
|
3562
|
-
# Position of correlated variables within randvars
|
3563
|
-
correlationpos = [varnames.tolist().index(x)
|
3564
|
-
for x in varnames if x in randvars]
|
3565
|
-
if (isinstance(correlation, list)):
|
3566
|
-
self.correlationpos = [varnames.tolist().index(x) for x in
|
3567
|
-
varnames if x in correlation]
|
3568
|
-
self.uncorrelatedpos = [varnames.tolist().index(x) for x in
|
3569
|
-
varnames if x not in correlation]
|
3570
|
-
# if correlation = True correlation pos is randpos, if list get correct pos
|
3571
|
-
correlationpos = []
|
3572
|
-
else:
|
3573
|
-
varnames = self.none_handler(
|
3565
|
+
|
3566
|
+
|
3567
|
+
|
3568
|
+
varnames = self.none_handler(
|
3574
3569
|
self.rdm_fit) + self.none_handler(self.rdm_cor_fit)
|
3575
3570
|
|
3576
|
-
|
3571
|
+
|
3577
3572
|
# Kchol, permutations of specified params in correlation list
|
3578
|
-
|
3573
|
+
Kchol = int((len(correlation) *
|
3579
3574
|
(len(correlation) + 1)) / 2)
|
3580
|
-
|
3581
|
-
# i.e. correlation = True, Kchol permutations of random paramaters
|
3582
|
-
Kchol = int((len(br) * (len(br) + 1)) / 2)
|
3575
|
+
|
3583
3576
|
|
3584
3577
|
# creating cholesky matrix for the variance-covariance matrix
|
3585
3578
|
# all random variables not included in correlation will only
|
@@ -3608,7 +3601,18 @@ class ObjectiveFunction(object):
|
|
3608
3601
|
is_correlated = True
|
3609
3602
|
else:
|
3610
3603
|
is_correlated = False
|
3611
|
-
|
3604
|
+
try:
|
3605
|
+
rv_val = chol[chol_count] if is_correlated else br_w[rv_count]
|
3606
|
+
except:
|
3607
|
+
print('exception here start')
|
3608
|
+
print(self.rdm_cor_fit, 'rdm_cor_fit')
|
3609
|
+
print(self.rdm_fit, 'rdm_fit')
|
3610
|
+
print('varnames', varnames)
|
3611
|
+
print('br', br, 'br')
|
3612
|
+
print(Br_w, 'Br_w')
|
3613
|
+
print(chol, 'chol')
|
3614
|
+
print(br_w, 'br_w')
|
3615
|
+
print('exception here end')
|
3612
3616
|
chol_mat_temp[rv_count_all, rv_count_all] = rv_val
|
3613
3617
|
rv_count_all += 1
|
3614
3618
|
if is_correlated:
|
@@ -4870,10 +4874,10 @@ class ObjectiveFunction(object):
|
|
4870
4874
|
n_coeff = self.get_param_num(dispersion)
|
4871
4875
|
Kf_a, Kr_a, Kr_c, Kr_b_a, Kchol_a, Kh = self.get_num_params()
|
4872
4876
|
if Kchol_a != Kchol:
|
4873
|
-
print('
|
4877
|
+
print('this should not hh qhy')
|
4874
4878
|
|
4875
|
-
if Kr_b !=
|
4876
|
-
print('hold qhy')
|
4879
|
+
if Kr_b != Kr_a:
|
4880
|
+
print('hold qhy this should never happen')
|
4877
4881
|
|
4878
4882
|
|
4879
4883
|
|
@@ -4887,13 +4891,14 @@ class ObjectiveFunction(object):
|
|
4887
4891
|
|
4888
4892
|
)
|
4889
4893
|
Bf = betas[0:Kf] # Fixed betas
|
4890
|
-
|
4891
|
-
|
4892
|
-
|
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)
|
4893
4897
|
|
4894
4898
|
|
4895
4899
|
Vdf = dev.np.einsum('njk,k -> nj', Xdf, Bf, dtype=np.float64) # (N, P)
|
4896
|
-
|
4900
|
+
if TEST_ME:
|
4901
|
+
br = betas[Kf:Kf + Kr]
|
4897
4902
|
|
4898
4903
|
|
4899
4904
|
|
@@ -4911,9 +4916,9 @@ class ObjectiveFunction(object):
|
|
4911
4916
|
# Kchol_a + Krb_a
|
4912
4917
|
#its grabbing from the
|
4913
4918
|
|
4919
|
+
if TEST_ME:
|
4914
4920
|
|
4915
|
-
|
4916
|
-
brstd = betas[Kf + Kr:Kf + Kr + Kr_b + Kchol]
|
4921
|
+
brstd = betas[Kf + Kr:Kf + Kr + Kr_b + Kchol]
|
4917
4922
|
|
4918
4923
|
# initialises size matrix
|
4919
4924
|
proba = [] # Temp batching storage
|
@@ -7210,6 +7215,20 @@ class ObjectiveFunction(object):
|
|
7210
7215
|
indices = [i for i, name in enumerate(self._characteristics_names) if name in names and isinstance(name, str)]
|
7211
7216
|
return indices
|
7212
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
|
+
|
7213
7232
|
"""
|
7214
7233
|
This function is named 'makeRegression'. It takes several parameters; 'self', 'model_nature', 'layout', '*args', and '**kwargs'.
|
7215
7234
|
The purpose of this function is to execute a regression based on the training and testing datasets.
|
@@ -7316,7 +7335,7 @@ class ObjectiveFunction(object):
|
|
7316
7335
|
Xr_cor = df_tf[:, :, indices3]
|
7317
7336
|
# FIXME not sure if this is the right way orientatied
|
7318
7337
|
Xr = np.concatenate((Xr, Xr_cor), axis=2)
|
7319
|
-
|
7338
|
+
self.sanity_check(Xr)
|
7320
7339
|
model_nature['Xr'] = Xr
|
7321
7340
|
if self.is_multi:
|
7322
7341
|
Xr_test = df_test[:, :, indices2]
|
@@ -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=
|
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=
|
14
|
+
metacountregressor/solution.py,sha256=biAgfV5X4EXhzw1vGkNec53C-6ph02WpUWPtCQJfHKc,320016
|
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.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,,
|
File without changes
|
{metacountregressor-0.1.311.dist-info → metacountregressor-0.1.313.dist-info}/licenses/LICENSE.txt
RENAMED
File without changes
|
File without changes
|