metacountregressor 0.1.33__py3-none-any.whl → 0.1.35__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/main.py +11 -11
- metacountregressor/metaheuristics.py +25 -17
- metacountregressor/pareto_file.py +22 -10
- metacountregressor/set_data.csv +3780 -3780
- metacountregressor/solution.py +99 -82
- {metacountregressor-0.1.33.dist-info → metacountregressor-0.1.35.dist-info}/METADATA +1 -1
- {metacountregressor-0.1.33.dist-info → metacountregressor-0.1.35.dist-info}/RECORD +8 -8
- {metacountregressor-0.1.33.dist-info → metacountregressor-0.1.35.dist-info}/WHEEL +0 -0
    
        metacountregressor/solution.py
    CHANGED
    
    | @@ -144,7 +144,8 @@ class ObjectiveFunction(object): | |
| 144 144 | 
             
                    self.MAE = None
         | 
| 145 145 | 
             
                    self.best_obj_1 = 100000000
         | 
| 146 146 | 
             
                    self._obj_1 = 'bic'
         | 
| 147 | 
            -
                    self._obj_2 = ' | 
| 147 | 
            +
                    self._obj_2 = 'MSE'
         | 
| 148 | 
            +
                    self.numerical_hessian_calc = 1 # calculates hessian by statsmodels otherwise scipy
         | 
| 148 149 | 
             
                    self.full_model = None
         | 
| 149 150 | 
             
                    self.GP_pararameter = 0
         | 
| 150 151 | 
             
                    self.is_multi = 0
         | 
| @@ -276,7 +277,7 @@ class ObjectiveFunction(object): | |
| 276 277 |  | 
| 277 278 | 
             
                    self._characteristics_names = list(self._x_data.columns)
         | 
| 278 279 | 
             
                    #self._characteristics_names = [x for x in self._characteristics_names if not 'ID' in x]
         | 
| 279 | 
            -
                     | 
| 280 | 
            +
                    
         | 
| 280 281 |  | 
| 281 282 | 
             
                    self._max_group_all_means = 1
         | 
| 282 283 |  | 
| @@ -518,8 +519,8 @@ class ObjectiveFunction(object): | |
| 518 519 |  | 
| 519 520 | 
             
                    for_testing_purposes = 0
         | 
| 520 521 | 
             
                    if "Manual_Fit" in kwargs and  kwargs['Manual_Fit'] is not None:
         | 
| 521 | 
            -
                        for_testing_purposes =  | 
| 522 | 
            -
                         | 
| 522 | 
            +
                        for_testing_purposes = 1
         | 
| 523 | 
            +
                        
         | 
| 523 524 | 
             
                    if for_testing_purposes:
         | 
| 524 525 | 
             
                        self.initial_sig = 1  # pass the test of a single model
         | 
| 525 526 | 
             
                        self.pvalue_sig_value = 1
         | 
| @@ -907,6 +908,10 @@ class ObjectiveFunction(object): | |
| 907 908 | 
             
                def round_with_padding(self, value, round_digits):
         | 
| 908 909 | 
             
                    return(format(np.round(value, round_digits), "."+str(round_digits)+"f"))
         | 
| 909 910 |  | 
| 911 | 
            +
                def round_with_scientific(self, value, round_digits):
         | 
| 912 | 
            +
                    return(format(np.round(value, round_digits), "."+str(round_digits)+"f"))
         | 
| 913 | 
            +
                    
         | 
| 914 | 
            +
                
         | 
| 910 915 | 
             
                def get_dispersion_name(self, dispersion=0):
         | 
| 911 916 | 
             
                    if dispersion == 0:
         | 
| 912 917 | 
             
                        return []
         | 
| @@ -960,15 +965,20 @@ class ObjectiveFunction(object): | |
| 960 965 | 
             
                            big_hetro = [item for sublist in hetro_names_for for item in sublist]
         | 
| 961 966 | 
             
                            name_hetro = list(model_nature['hetro_hold'].keys())
         | 
| 962 967 | 
             
                            hetro_long= []
         | 
| 968 | 
            +
                            hetro_std = []
         | 
| 963 969 |  | 
| 964 | 
            -
                            for i in name_hetro:
         | 
| 965 | 
            -
                                hetro = [f"{j}: hetro" for j in  model_nature['hetro_hold'][i]]
         | 
| 966 | 
            -
                                hetro | 
| 970 | 
            +
                            for n, i in enumerate(name_hetro):
         | 
| 971 | 
            +
                                hetro = [f"{j}: hetro group {n}" for j in  model_nature['hetro_hold'][i]]
         | 
| 972 | 
            +
                                hetro = [f"main: {j}: hetro group {n}" if idx == 0 else f"{j}: hetro group {n}" for idx, j in enumerate(model_nature['hetro_hold'][i])]
         | 
| 973 | 
            +
                                hetro_std.append(f"{hetro[0]}:{i}:sd  hetro group {n}")
         | 
| 967 974 | 
             
                                hetro_long = hetro_long +hetro
         | 
| 968 975 |  | 
| 969 976 | 
             
                            abct = []
         | 
| 977 | 
            +
                            hetro_long = hetro_long + hetro_std
         | 
| 970 978 | 
             
                            for i in model_nature['transfrom_hetro']:
         | 
| 971 | 
            -
                                abct = abct + i  | 
| 979 | 
            +
                                abct = abct + i 
         | 
| 980 | 
            +
                            for i in model_nature['transfrom_hetro']:
         | 
| 981 | 
            +
                                abct = abct + ['']
         | 
| 972 982 | 
             
                        else:
         | 
| 973 983 | 
             
                            big_hetro = []
         | 
| 974 984 | 
             
                            hetro_long = []  
         | 
| @@ -1046,7 +1056,7 @@ class ObjectiveFunction(object): | |
| 1046 1056 | 
             
                        except Exception as e:
         | 
| 1047 1057 | 
             
                            print(e)
         | 
| 1048 1058 |  | 
| 1049 | 
            -
                def summary_alternative(self, long_print=0, model=0, solution=None):
         | 
| 1059 | 
            +
                def summary_alternative(self, long_print=0, model=0, solution=None, save_state = 0):
         | 
| 1050 1060 | 
             
                    fmt = "{:19} {:13} {:13.10f} {:13.10f}{:13.10f} {:13.3g} {:3}"
         | 
| 1051 1061 | 
             
                    coeff_name_str_length = 19
         | 
| 1052 1062 |  | 
| @@ -1065,19 +1075,26 @@ class ObjectiveFunction(object): | |
| 1065 1075 | 
             
                    if not isinstance(self.pvalues, np.ndarray):
         | 
| 1066 1076 | 
             
                        raise Exception
         | 
| 1067 1077 |  | 
| 1078 | 
            +
                    
         | 
| 1079 | 
            +
                    #self.pvalues= [self.round_with_padding(x, 2) for x in self.pvalues]
         | 
| 1080 | 
            +
                    #self.pvalues= [self.round_with_scientific(x, 2) for x in self.pvalues]
         | 
| 1081 | 
            +
                    
         | 
| 1068 1082 | 
             
                    for i in range(len(self.coeff_)):
         | 
| 1069 1083 | 
             
                        signif = ""
         | 
| 1070 | 
            -
             | 
| 1071 | 
            -
                        if self.pvalues[i] < 0.01:
         | 
| 1084 | 
            +
                    
         | 
| 1085 | 
            +
                        if float(self.pvalues[i]) < 0.01:
         | 
| 1072 1086 | 
             
                            signif = "***"
         | 
| 1073 | 
            -
                        elif self.pvalues[i] < 0.05:
         | 
| 1087 | 
            +
                        elif float(self.pvalues[i]) < 0.05:
         | 
| 1074 1088 | 
             
                            signif = "**"
         | 
| 1075 | 
            -
                        elif self.pvalues[i] < 0.1:
         | 
| 1089 | 
            +
                        elif float(self.pvalues[i]) < 0.1:
         | 
| 1076 1090 | 
             
                            signif = "*"
         | 
| 1091 | 
            +
                            
         | 
| 1092 | 
            +
                        ''' 
         | 
| 1077 1093 | 
             
                        print(fmt.format(self.coeff_names[i][:coeff_name_str_length], self.print_transform[i], self.coeff_[i],
         | 
| 1078 | 
            -
             | 
| 1079 | 
            -
             | 
| 1080 | 
            -
             | 
| 1094 | 
            +
                                        self.stderr[i], self.zvalues[i], self.pvalues[i],
         | 
| 1095 | 
            +
                                        signif
         | 
| 1096 | 
            +
                                        ))
         | 
| 1097 | 
            +
                                        '''
         | 
| 1081 1098 |  | 
| 1082 1099 | 
             
                    if not self.convergence:
         | 
| 1083 1100 | 
             
                        print("-" * 50)
         | 
| @@ -1156,7 +1173,7 @@ class ObjectiveFunction(object): | |
| 1156 1173 | 
             
                                caption_parts.append(f"MSPE: {self.round_with_padding(self.MAE, 2)}")
         | 
| 1157 1174 |  | 
| 1158 1175 | 
             
                            caption = " ".join(caption_parts)
         | 
| 1159 | 
            -
                            print(latextable.draw_latex(table, caption=caption, caption_above = True))
         | 
| 1176 | 
            +
                            #print(latextable.draw_latex(table, caption=caption, caption_above = True))
         | 
| 1160 1177 | 
             
                            if solution is None:
         | 
| 1161 1178 | 
             
                                file_name = self.instance_number + "/sln" + \
         | 
| 1162 1179 | 
             
                                    "_with_BIC_"+str(self.bic)+".tex"
         | 
| @@ -1164,8 +1181,10 @@ class ObjectiveFunction(object): | |
| 1164 1181 | 
             
                                file_name = self.instance_number + "/sln" + \
         | 
| 1165 1182 | 
             
                                    str(solution['sol_num']) + \
         | 
| 1166 1183 | 
             
                                    "_with_BIC_"+str(self.bic)+".tex"
         | 
| 1167 | 
            -
             | 
| 1168 | 
            -
             | 
| 1184 | 
            +
                                    
         | 
| 1185 | 
            +
                            if save_state:   
         | 
| 1186 | 
            +
                                self.save_to_file(latextable.draw_latex(
         | 
| 1187 | 
            +
                                    table, caption=caption, caption_above = True), file_name)
         | 
| 1169 1188 |  | 
| 1170 1189 |  | 
| 1171 1190 | 
             
                            #print('change this')
         | 
| @@ -1403,11 +1422,20 @@ class ObjectiveFunction(object): | |
| 1403 1422 | 
             
                    if np.size(y) != np.size(eVy):
         | 
| 1404 1423 | 
             
                        y = np.tile(y, self.Ndraws).ravel()
         | 
| 1405 1424 | 
             
                        eVy = eVy.ravel()
         | 
| 1425 | 
            +
                        
         | 
| 1426 | 
            +
                   # y_avg = np.mean(y, axis = (1,2))
         | 
| 1427 | 
            +
                   # eVy_avg = np.mean(eVy, axis = (1,2))
         | 
| 1428 | 
            +
                    #mspe1 = np.nan_to_num(MSPE(np.squeeze(y_avg), np.squeeze(eVy_avg)), nan=100000, posinf=100000)
         | 
| 1406 1429 | 
             
                    eVy = np.nan_to_num(eVy, nan=100000, posinf=100000)
         | 
| 1407 1430 | 
             
                    eVy = np.clip(eVy, None, 1000)
         | 
| 1408 1431 | 
             
                    mae = np.nan_to_num(MAE(np.squeeze(y), np.squeeze(eVy)), nan=100000, posinf=100000)
         | 
| 1409 1432 | 
             
                    mspe = np.nan_to_num(MSPE(np.squeeze(y), np.squeeze(eVy)), nan=100000, posinf=100000)
         | 
| 1410 | 
            -
                    
         | 
| 1433 | 
            +
                    if self._obj_2 == 'MAE':
         | 
| 1434 | 
            +
                        return mae
         | 
| 1435 | 
            +
                    elif self._obj_2 == 'MSE':
         | 
| 1436 | 
            +
                        return mspe
         | 
| 1437 | 
            +
                    elif self._obj_2 == "MAD":
         | 
| 1438 | 
            +
                        raise Exception
         | 
| 1411 1439 | 
             
                    return mspe
         | 
| 1412 1440 |  | 
| 1413 1441 | 
             
                def get_solution_vector(self, fixed_vars, random_vars, random_var_cor, distribution_vars, dispersion=None):
         | 
| @@ -1587,7 +1615,7 @@ class ObjectiveFunction(object): | |
| 1587 1615 |  | 
| 1588 1616 | 
             
                            if (self.get_num_discrete_values(get_rdm_i) - 1) == 0:
         | 
| 1589 1617 | 
             
                                # TODO: must be a better way to avoid selecting this
         | 
| 1590 | 
            -
                                print(' | 
| 1618 | 
            +
                                print('repair constraint violated, skipping over..')
         | 
| 1591 1619 |  | 
| 1592 1620 |  | 
| 1593 1621 | 
             
                            else:
         | 
| @@ -3439,15 +3467,22 @@ class ObjectiveFunction(object): | |
| 3439 3467 | 
             
                    return covariance
         | 
| 3440 3468 |  | 
| 3441 3469 | 
             
                def _numerical_hessian(self, betas, args, jac):
         | 
| 3442 | 
            -
                    Xd, y, draws, Xf, Xr, corr_list, dispersion = args
         | 
| 3470 | 
            +
                    #Xd, y, draws, Xf, Xr, corr_list, dispersion = args
         | 
| 3443 3471 | 
             
                    def loglike(p): return self._loglik_gradient(
         | 
| 3444 | 
            -
                        p,  | 
| 3472 | 
            +
                        p, *args)
         | 
| 3473 | 
            +
                    robust = False
         | 
| 3445 3474 | 
             
                    hess = approx_hess(betas, loglike)
         | 
| 3475 | 
            +
                    hess /= self.N
         | 
| 3446 3476 | 
             
                    hess_inv1 = np.linalg.pinv(hess)
         | 
| 3447 | 
            -
                     | 
| 3448 | 
            -
             | 
| 3449 | 
            -
             | 
| 3450 | 
            -
             | 
| 3477 | 
            +
                    if robust:
         | 
| 3478 | 
            +
                       
         | 
| 3479 | 
            +
                        scores = approx_fprime(betas, loglike)
         | 
| 3480 | 
            +
                        score_cov = np.cov(scores.T)
         | 
| 3481 | 
            +
                        inv_hess =  hess_inv1.dot(score_cov).dot(hess_inv1) / self.N
         | 
| 3482 | 
            +
                    else:
         | 
| 3483 | 
            +
                        inv_hess =  hess_inv1 / self.N
         | 
| 3484 | 
            +
                    
         | 
| 3485 | 
            +
                    return inv_hess
         | 
| 3451 3486 |  | 
| 3452 3487 | 
             
                def _chol_mat(self, correlationLength, br, Br_w, correlation):
         | 
| 3453 3488 | 
             
                    # if correlation = True correlation pos is randpos, if list get correct pos
         | 
| @@ -5770,12 +5805,20 @@ class ObjectiveFunction(object): | |
| 5770 5805 | 
             
                                            bounds = bounds + [(i-5, i+5)]            
         | 
| 5771 5806 | 
             
                                    '''           
         | 
| 5772 5807 | 
             
                                    Kf_a, Kr_a, Kr_c, Kr_b_a, Kchol_a, Kh, zi_terms_a = self.get_num_params()
         | 
| 5773 | 
            -
             | 
| 5808 | 
            +
                                    if Kh > 0:
         | 
| 5809 | 
            +
                                        Kh_e = mod.get('XH').shape[-1]
         | 
| 5810 | 
            +
                                        Kh_range = Kh-Kh_e
         | 
| 5811 | 
            +
                                    else:
         | 
| 5812 | 
            +
                                        Kh_e = 0
         | 
| 5813 | 
            +
                                        Kh_rannge = 0
         | 
| 5774 5814 | 
             
                                    sum1 = Kf_a + Kr_a + Kr_c
         | 
| 5775 | 
            -
                                     | 
| 5815 | 
            +
                                    sumk = sum1 +Kh_e
         | 
| 5816 | 
            +
                                    sum2 = sumk + Kr_b_a
         | 
| 5776 5817 | 
             
                                    sum3 = sum2 + Kchol_a
         | 
| 5818 | 
            +
                                    sum4 = sum3 +Kh
         | 
| 5777 5819 |  | 
| 5778 5820 | 
             
                                    bounds = []
         | 
| 5821 | 
            +
                                    bounds_k = []
         | 
| 5779 5822 | 
             
                                    bob = b[0:sum2]
         | 
| 5780 5823 | 
             
                                    bob2 = b[sum2:sum3]
         | 
| 5781 5824 | 
             
                                    if dispersion ==1 or dispersion ==2:
         | 
| @@ -5786,6 +5829,9 @@ class ObjectiveFunction(object): | |
| 5786 5829 | 
             
                                    for j, i in enumerate(bob):
         | 
| 5787 5830 | 
             
                                        if j < sum1:
         | 
| 5788 5831 | 
             
                                            bounds.append((i-15, i+15))
         | 
| 5832 | 
            +
                                        elif j < sumk:
         | 
| 5833 | 
            +
                                            bounds_k.append(i)
         | 
| 5834 | 
            +
                                            
         | 
| 5789 5835 | 
             
                                        elif j < sum2:
         | 
| 5790 5836 | 
             
                                            bounds.append((0.1, i+7))
         | 
| 5791 5837 |  | 
| @@ -5811,6 +5857,12 @@ class ObjectiveFunction(object): | |
| 5811 5857 | 
             
                                        count = 0
         | 
| 5812 5858 | 
             
                                        bounds.append((0.1,bob2[count]+5))
         | 
| 5813 5859 |  | 
| 5860 | 
            +
                                    if Kh > 0:
         | 
| 5861 | 
            +
                                        for bbb in bounds_k:
         | 
| 5862 | 
            +
                                            bounds.append((bbb-15, bbb+15))
         | 
| 5863 | 
            +
                                        for bbb in range(Kh_range):
         | 
| 5864 | 
            +
                                            bounds.append((.1, 5))    
         | 
| 5865 | 
            +
                                        
         | 
| 5814 5866 |  | 
| 5815 5867 |  | 
| 5816 5868 |  | 
| @@ -5907,65 +5959,26 @@ class ObjectiveFunction(object): | |
| 5907 5959 |  | 
| 5908 5960 | 
             
                                if dispersion ==1:
         | 
| 5909 5961 | 
             
                                    mod['dispersion_penalty'] = abs(b[-1])
         | 
| 5910 | 
            -
                                
         | 
| 5911 | 
            -
                                betas_est = self._minimize(self._loglik_gradient, b,  args=(X, y, draws, X, Xr, self.batch_size, | 
| 5962 | 
            +
                                grad_args = (X, y, draws, X, Xr, self.batch_size,False, False, dispersion, 0, False, 0, self.rdm_cor_fit, self.zi_fit, exog_infl, draws_grouped, XG, mod)
         | 
| 5963 | 
            +
                                betas_est = self._minimize(self._loglik_gradient, b,  args=(X, y, draws, X, Xr, self.batch_size,False, False, dispersion, 0, False, 0, self.rdm_cor_fit, self.zi_fit, exog_infl, draws_grouped, XG, mod),
         | 
| 5912 5964 | 
             
                                                           method=method2, tol=tol['ftol'],
         | 
| 5913 5965 | 
             
                                                           options={'gtol': tol['gtol']}, bounds = bounds)
         | 
| 5966 | 
            +
                                
         | 
| 5967 | 
            +
                                if self.numerical_hessian_calc:
         | 
| 5968 | 
            +
                                    try:
         | 
| 5969 | 
            +
                                        bb_hess = self._numerical_hessian(betas_est.x, grad_args, False)
         | 
| 5970 | 
            +
                                    except Exception as e:
         | 
| 5971 | 
            +
                                        bb_hess = None
         | 
| 5972 | 
            +
                                else:
         | 
| 5973 | 
            +
                                    bb_hess = None        
         | 
| 5914 5974 | 
             
                               # betas_est = self._minimize(self._loglik_gradient, b,  args=(X, y, draws, X, Xr, self.batch_size, True, True, dispersion, 0, False, 0, self.rdm_cor_fit, self.zi_fit, exog_infl,  draws_grouped, XG, mod),
         | 
| 5915 5975 | 
             
                                                         #          method=method2, tol=tol['ftol'], options={'gtol': tol['gtol']})
         | 
| 5916 5976 | 
             
                              #  betas_est = self._minimize(self._loglik_gradient, b,  args=(X, y, draws, X, Xr, self.batch_size, False, False, dispersion, 0, False, 0, self.rdm_cor_fit, self.zi_fit, exog_infl,  draws_grouped, XG, mod),
         | 
| 5917 5977 | 
             
                                                         #          method=method2, tol=tol['ftol'], options={'gtol': tol['gtol']})
         | 
| 5918 5978 |  | 
| 5919 | 
            -
             | 
| 5920 | 
            -
                                
         | 
| 5921 | 
            -
                                print('detlet the fuck out of this ...')
         | 
| 5922 | 
            -
                                
         | 
| 5923 | 
            -
                                if dispersion:
         | 
| 5924 | 
            -
                                    bb = b[0:-1]
         | 
| 5925 | 
            -
                                    dispersion_coef = b[-1]
         | 
| 5926 | 
            -
                                    constant_coef = None
         | 
| 5927 | 
            -
                                else:
         | 
| 5928 | 
            -
                                    bb = b[1:]
         | 
| 5929 | 
            -
                                    dispersion_coef = None
         | 
| 5930 | 
            -
                                    constant_coef = b[0]
         | 
| 5931 | 
            -
                                        
         | 
| 5932 | 
            -
                                    
         | 
| 5979 | 
            +
                              
         | 
| 5933 5980 |  | 
| 5934 | 
            -
                                beta_est_alt = self._minimize(self._loglik_gradient_wrapper, bb,  args=(constant_coef, dispersion_coef, X, y, draws, X, Xr, self.batch_size, True, True, dispersion, 0, False, 0, self.rdm_cor_fit, self.zi_fit, exog_infl, draws_grouped, XG, mod),
         | 
| 5935 | 
            -
                                                            method=method, tol=tol['ftol'],
         | 
| 5936 | 
            -
                                                            options={'gtol': tol['gtol']})
         | 
| 5937 | 
            -
                                print(beta_est_alt)
         | 
| 5938 | 
            -
                                '''
         | 
| 5939 5981 |  | 
| 5940 | 
            -
                                old_code = 0
         | 
| 5941 | 
            -
                                if old_code:
         | 
| 5942 | 
            -
                                    gb_best = betas_est.copy()
         | 
| 5943 | 
            -
                                    if betas_est['success'] == False:
         | 
| 5944 | 
            -
                                        #b[0] += b[0] -len(b)/5
         | 
| 5945 | 
            -
                                        # for i in range(1, len(bb) -self.is_dispersion(dispersion)):
         | 
| 5946 | 
            -
                                        #    b[i] += b[i]/5 +.5
         | 
| 5947 | 
            -
                                        # for i, j in enumerate(b):
         | 
| 5948 | 
            -
                                        #    b[i] = 0
         | 
| 5949 | 
            -
                                        start_time = time.time()
         | 
| 5950 | 
            -
                                        #print('starint slow')
         | 
| 5951 | 
            -
                                        betas_est = self._minimize(self._loglik_gradient, b,  args=(X, y, draws, X, Xr, self.batch_size, True, True, dispersion, 0, False, 0, self.rdm_cor_fit, self.zi_fit, exog_infl),
         | 
| 5952 | 
            -
                                                                   method=method2, tol=tol['ftol'], options={'gtol': tol['gtol']})
         | 
| 5953 | 
            -
                                        print("--- %s seconds ---" %
         | 
| 5954 | 
            -
                                              (time.time() - start_time))
         | 
| 5955 | 
            -
                                        #ll, grad, hess = self._loglik_gradient(betas_est['x'] , X, y, draws, X, Xr, self.batch_size, True, True, dispersion, 0, False, 0, self.rdm_cor_fit, self.zi_fit, exog_infl)
         | 
| 5956 | 
            -
                                        #hess_inv = np.linalg.pinv(np.dot(hess.T, hess))
         | 
| 5957 | 
            -
                                        #betas_est['hess_inv'] = hess_inv
         | 
| 5958 | 
            -
                                        if betas_est['fun'] <= gb_best['fun']:
         | 
| 5959 | 
            -
                                            gb_best = betas_est.copy()
         | 
| 5960 | 
            -
                                            bb = gb_best['x'].copy()
         | 
| 5961 | 
            -
             | 
| 5962 | 
            -
                                        betas_est = gb_best.copy()
         | 
| 5963 | 
            -
             | 
| 5964 | 
            -
                                        ll, grad, hess = self._loglik_gradient(
         | 
| 5965 | 
            -
                                            betas_est['x'], X, y, draws, X, Xr, self.batch_size, True, True, dispersion, 0, False, 0, self.rdm_cor_fit, self.zi_fit, exog_infl)
         | 
| 5966 | 
            -
                                        hess_inv = np.linalg.pinv(np.dot(hess.T, hess))
         | 
| 5967 | 
            -
                                        betas_est['hess_inv'] = hess_inv
         | 
| 5968 | 
            -
                                # this is causing more problems, lets reconsider
         | 
| 5969 5982 |  | 
| 5970 5983 | 
             
                                if betas_est['message'] == 'NaN result encountered.':
         | 
| 5971 5984 |  | 
| @@ -5982,7 +5995,8 @@ class ObjectiveFunction(object): | |
| 5982 5995 | 
             
                                    betas_est['x'], 0, dispersion, zi_fit=sub_zi, model_nature = mod)
         | 
| 5983 5996 | 
             
                            if hasattr(betas_est.hess_inv, 'todense'):
         | 
| 5984 5997 | 
             
                                betas_est['hess_inv'] = betas_est.hess_inv.todense() if hasattr(betas_est.hess_inv, 'todense') else np.array([betas_est.hess_inv(np.eye(len(b))[i]) for i in range(len(b))])
         | 
| 5985 | 
            -
             | 
| 5998 | 
            +
                                if bb_hess is not None:
         | 
| 5999 | 
            +
                                    betas_est['hess_inv'] = bb_hess
         | 
| 5986 6000 | 
             
                            if betas_est['hess_inv'] is None:
         | 
| 5987 6001 |  | 
| 5988 6002 | 
             
                                self.convergance = 1
         | 
| @@ -6507,11 +6521,14 @@ class ObjectiveFunction(object): | |
| 6507 6521 | 
             
                                if self.is_multi:
         | 
| 6508 6522 |  | 
| 6509 6523 | 
             
                                    if self.pareto_printer.check_if_dominance(self._pareto_population, obj_1):
         | 
| 6524 | 
            +
                                        print('dominate soltuion')
         | 
| 6510 6525 | 
             
                                        try:
         | 
| 6511 6526 | 
             
                                            self.summary_alternative(
         | 
| 6512 6527 | 
             
                                            long_print=1, model=dispersion, solution=obj_1)
         | 
| 6513 6528 | 
             
                                        except Exception as e:
         | 
| 6514 6529 | 
             
                                            print('e', obj_1)    
         | 
| 6530 | 
            +
                                    else:
         | 
| 6531 | 
            +
                                        print('non_dominant solution.')        
         | 
| 6515 6532 | 
             
                                    if obj_1['layout'] is None:
         | 
| 6516 6533 | 
             
                                        print('no layout??')
         | 
| 6517 6534 | 
             
                                else:
         | 
| @@ -6572,11 +6589,11 @@ class ObjectiveFunction(object): | |
| 6572 6589 |  | 
| 6573 6590 |  | 
| 6574 6591 | 
             
                    alpha_cor_rdm = np.isin(select_data, [item.split(':')[0] for item in data.get('rdm_cor_terms', [])]).astype(int).tolist()
         | 
| 6575 | 
            -
             | 
| 6592 | 
            +
                   
         | 
| 6576 6593 | 
             
                    alpha_group_rdm = np.isin(select_data, data.get('group_rdm', [])).astype(int).tolist()
         | 
| 6577 6594 | 
             
                    alpha_hetro = np.isin(select_data, [item.split(':')[0] for item in data.get('hetro_in_means', [])]).astype(int).tolist()
         | 
| 6578 6595 | 
             
                    for i in range(len(alpha_rdm)):
         | 
| 6579 | 
            -
                         | 
| 6596 | 
            +
                        
         | 
| 6580 6597 | 
             
                        if alpha[i]:
         | 
| 6581 6598 | 
             
                            fixed_transforms.append(data['transformations'][jc+ja+jb+j])
         | 
| 6582 6599 | 
             
                            fixed_terms_subset.append('normal')
         | 
| @@ -16,12 +16,12 @@ metacountregressor/halton.py,sha256=0PleInroxmQNhSTPzYT_Yst5nPGF2DiWJppS6mT9cEg, | |
| 16 16 | 
             
            metacountregressor/helperprocess.py,sha256=5zl2Z4KO27wt7w52r38URvgW0FeN5VIWnD4Q3iRwpBs,8894
         | 
| 17 17 | 
             
            metacountregressor/HV_DATES.csv,sha256=kOWYcfRD9oGVm0HTr1uVQyWczw2mBZRNbCK9dlVsQrw,7022961
         | 
| 18 18 | 
             
            metacountregressor/Indiana_data.csv,sha256=oSL3hTMAocbUzD0HeV-mNEJ1xvH6fiEFaFxdCESgdpQ,14452
         | 
| 19 | 
            -
            metacountregressor/main.py,sha256= | 
| 20 | 
            -
            metacountregressor/metaheuristics.py,sha256= | 
| 19 | 
            +
            metacountregressor/main.py,sha256=lXjsMu7AsfuI2cvXrmOoEuAOEPXMvASnm4ui9lvgMdw,20703
         | 
| 20 | 
            +
            metacountregressor/metaheuristics.py,sha256=_GbaJ8I-YAWv-dZTZD2x4TpcjzlJLA95rXysiQ9itsk,92490
         | 
| 21 21 | 
             
            metacountregressor/MichiganData.csv,sha256=qeqfZng1IhPxPizR-lTxODUO1jFVLUYZXg3ySIHOuBM,1317927
         | 
| 22 22 | 
             
            metacountregressor/nbl.R,sha256=ErWPzxn6CFtrOunolFSf7DwVkUOKhsvfOm4t6FmbByk,1917
         | 
| 23 23 | 
             
            metacountregressor/panel_synth.csv,sha256=w8GBj586DzDfKOn8hwHDNkLeBz5si0qopht1JjAWaTU,3713176
         | 
| 24 | 
            -
            metacountregressor/pareto_file.py,sha256= | 
| 24 | 
            +
            metacountregressor/pareto_file.py,sha256=5QG-Sv1vRItyVtGavzHQUKZBDY2zjIKfIzMTAfCYxpE,21479
         | 
| 25 25 | 
             
            metacountregressor/pareto_logger__plot.py,sha256=C5f0Qz_Ai4LCrOrgoaJze8qPDqm-RgVcE5cbTTSgk5Q,26253
         | 
| 26 26 | 
             
            metacountregressor/PB_HS.pbs,sha256=QII67_u5ASD9Dbv4__mRJXDCpW5tXgdYexbg4hvIB-8,293
         | 
| 27 27 | 
             
            metacountregressor/PB_HS_short.pbs,sha256=WJTmNzXMNmfh8vitpmMLlvN82-RrA_nzuSlKhu6RXF4,292
         | 
| @@ -34,11 +34,11 @@ metacountregressor/RPNBHM.R,sha256=vhaQEsYkG7dZmx3kFAm6OofvWzbo5McwJPpjGOPRcmQ,4 | |
| 34 34 | 
             
            metacountregressor/RPNBHM_APA.R,sha256=DBkKizyQW7GV-XNwiKCDeFQAVaJ-mUnltnHj3vLw2vg,4016
         | 
| 35 35 | 
             
            metacountregressor/rural_int.csv,sha256=r4g6ykwZ_0halh3UYHR0GAZsS2sbEBPwU89Eii2RX7A,6959117
         | 
| 36 36 | 
             
            metacountregressor/rural_int2019.csv,sha256=jCBAM5RGDCU_XYTSOV8BJvpb_2NxKzwSjbjH9SX0cKg,1394779
         | 
| 37 | 
            -
            metacountregressor/set_data.csv,sha256= | 
| 37 | 
            +
            metacountregressor/set_data.csv,sha256=68iJkW4O4HVM8GyNlO0drwp8ZMXkccXCUc7jnA8xnl0,206827
         | 
| 38 38 | 
             
            metacountregressor/set_data_s.csv,sha256=hELwnv6RjpmXcMheFafwrYbLbyYE21hFKyqJhA8L05o,11111
         | 
| 39 39 | 
             
            metacountregressor/setup.py,sha256=CpbdBScFhvStc6WByFiAlP7T5wGdWetsLI8X5JRRpP4,268
         | 
| 40 40 | 
             
            metacountregressor/single_objective_finder.py,sha256=QYXUpxJp7-ul5ZiIKGgYGaH_yFFGUbI7X3yKu5asogE,1960
         | 
| 41 | 
            -
            metacountregressor/solution.py,sha256= | 
| 41 | 
            +
            metacountregressor/solution.py,sha256=eq83FPyydYc_VPmBjdQs1AqUjeEWbcIEn5OnXNshVh0,290278
         | 
| 42 42 | 
             
            metacountregressor/Stage5A_1848_All_Initial_Columns.csv,sha256=uwsadEyupgIH1w5f8vnlwlo13ryww3VCGYlOnN0dEL0,188769
         | 
| 43 43 | 
             
            metacountregressor/Stage5A_1848_All_Initial_Columns.xlsx,sha256=5U5Ab1jjGi5qoKp06Bw2tpdPjGaDGoyt5976AAFdEbs,699231
         | 
| 44 44 | 
             
            metacountregressor/synth_dataset_generator.ipynb,sha256=caBMQJOaeINPZJw5aTsSOXhmenSqrpS7GycINAzUUxs,27153
         | 
| @@ -48,6 +48,6 @@ metacountregressor/testML.R,sha256=UbTsLFUhoJG9bJnU2rbUKlfcprAkROnhREK41qKzbvQ,2 | |
| 48 48 | 
             
            metacountregressor/TestSetFake.csv,sha256=JPYAWYLAw7rgQHdGTz0rltMfapX8QYt3BVSyK_D-Lzg,1640
         | 
| 49 49 | 
             
            metacountregressor/ThaiAccident.csv,sha256=NIi_uPyo5u-B6Hj0Ln9xuJ8fnvGbWK9GLdTWdpG5uug,418202
         | 
| 50 50 | 
             
            metacountregressor/tk_app.py,sha256=0UM76hpQ-ha96ma_Z5ryxYQUSdF4PJBCsLuI1EGu6_E,59490
         | 
| 51 | 
            -
            metacountregressor-0.1. | 
| 52 | 
            -
            metacountregressor-0.1. | 
| 53 | 
            -
            metacountregressor-0.1. | 
| 51 | 
            +
            metacountregressor-0.1.35.dist-info/METADATA,sha256=zj0-X0Rt7Ns07wjqXX6DQUI2dShDyScnJEDIetmFFEM,3391
         | 
| 52 | 
            +
            metacountregressor-0.1.35.dist-info/WHEEL,sha256=Zb28QaM1gQi8f4VCBhsUklF61CTlNYfs9YAZn-TOGFk,88
         | 
| 53 | 
            +
            metacountregressor-0.1.35.dist-info/RECORD,,
         | 
| 
            File without changes
         |