metacountregressor 0.1.206__tar.gz → 0.1.209__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.
- {metacountregressor-0.1.206 → metacountregressor-0.1.209}/PKG-INFO +1 -1
- {metacountregressor-0.1.206 → metacountregressor-0.1.209}/metacountregressor/solution.py +36 -5
- {metacountregressor-0.1.206 → metacountregressor-0.1.209}/metacountregressor.egg-info/PKG-INFO +1 -1
- {metacountregressor-0.1.206 → metacountregressor-0.1.209}/LICENSE.txt +0 -0
- {metacountregressor-0.1.206 → metacountregressor-0.1.209}/README.rst +0 -0
- {metacountregressor-0.1.206 → metacountregressor-0.1.209}/metacountregressor/__init__.py +0 -0
- {metacountregressor-0.1.206 → metacountregressor-0.1.209}/metacountregressor/_device_cust.py +0 -0
- {metacountregressor-0.1.206 → metacountregressor-0.1.209}/metacountregressor/app_main.py +0 -0
- {metacountregressor-0.1.206 → metacountregressor-0.1.209}/metacountregressor/data_split_helper.py +0 -0
- {metacountregressor-0.1.206 → metacountregressor-0.1.209}/metacountregressor/halton.py +0 -0
- {metacountregressor-0.1.206 → metacountregressor-0.1.209}/metacountregressor/helperprocess.py +0 -0
- {metacountregressor-0.1.206 → metacountregressor-0.1.209}/metacountregressor/main.py +0 -0
- {metacountregressor-0.1.206 → metacountregressor-0.1.209}/metacountregressor/main_old.py +0 -0
- {metacountregressor-0.1.206 → metacountregressor-0.1.209}/metacountregressor/metaheuristics.py +0 -0
- {metacountregressor-0.1.206 → metacountregressor-0.1.209}/metacountregressor/pareto_file.py +0 -0
- {metacountregressor-0.1.206 → metacountregressor-0.1.209}/metacountregressor/pareto_logger__plot.py +0 -0
- {metacountregressor-0.1.206 → metacountregressor-0.1.209}/metacountregressor/setup.py +0 -0
- {metacountregressor-0.1.206 → metacountregressor-0.1.209}/metacountregressor/single_objective_finder.py +0 -0
- {metacountregressor-0.1.206 → metacountregressor-0.1.209}/metacountregressor/test_generated_paper2.py +0 -0
- {metacountregressor-0.1.206 → metacountregressor-0.1.209}/metacountregressor.egg-info/SOURCES.txt +0 -0
- {metacountregressor-0.1.206 → metacountregressor-0.1.209}/metacountregressor.egg-info/dependency_links.txt +0 -0
- {metacountregressor-0.1.206 → metacountregressor-0.1.209}/metacountregressor.egg-info/not-zip-safe +0 -0
- {metacountregressor-0.1.206 → metacountregressor-0.1.209}/metacountregressor.egg-info/requires.txt +0 -0
- {metacountregressor-0.1.206 → metacountregressor-0.1.209}/metacountregressor.egg-info/top_level.txt +0 -0
- {metacountregressor-0.1.206 → metacountregressor-0.1.209}/setup.cfg +0 -0
- {metacountregressor-0.1.206 → metacountregressor-0.1.209}/setup.py +0 -0
- {metacountregressor-0.1.206 → metacountregressor-0.1.209}/tests/test.py +0 -0
|
@@ -501,7 +501,7 @@ class ObjectiveFunction(object):
|
|
|
501
501
|
# model specs
|
|
502
502
|
self.endog = None
|
|
503
503
|
# solution parameters
|
|
504
|
-
self._min_characteristics =
|
|
504
|
+
self._min_characteristics = kwargs.get('_min_vars', 3)
|
|
505
505
|
self._max_hurdle = 4
|
|
506
506
|
|
|
507
507
|
#Manually fit from analyst specification
|
|
@@ -1408,16 +1408,47 @@ class ObjectiveFunction(object):
|
|
|
1408
1408
|
|
|
1409
1409
|
return transform_set
|
|
1410
1410
|
|
|
1411
|
+
|
|
1411
1412
|
def poisson_mean_get_dispersion(self, betas, X, y):
|
|
1413
|
+
'''
|
|
1412
1414
|
eVy = self._loglik_gradient(betas, X, y, None, X, None, None, False, False, dispersion=0,
|
|
1413
1415
|
return_EV=True,
|
|
1414
1416
|
zi_list=None, draws_grouped=None, Xgroup=None)
|
|
1415
1417
|
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1418
|
+
print('trying thi instead')
|
|
1419
|
+
|
|
1420
|
+
'''
|
|
1421
|
+
|
|
1422
|
+
'''
|
|
1423
|
+
nb_model = sm.GLM(y_long, x_long, family=sm.families.NegativeBinomial()).fit()
|
|
1424
|
+
gamma = nb_model.scale
|
|
1425
|
+
|
|
1426
|
+
'''
|
|
1427
|
+
#poisson way
|
|
1428
|
+
try:
|
|
1429
|
+
num_panels, num_obs, num_features = X.shape # Dimensions of x
|
|
1430
|
+
x_long = X.reshape(-1, num_features) # Reshape to (num_panels * num_obs, num_features)
|
|
1431
|
+
y_long = y.reshape(-1)
|
|
1432
|
+
poisson_model = sm.GLM(y_long, x_long, family=sm.families.Poisson()).fit()
|
|
1433
|
+
|
|
1434
|
+
# Get residual deviance and degrees of freedom
|
|
1435
|
+
residual_deviance = poisson_model.deviance
|
|
1436
|
+
degrees_of_freedom = poisson_model.df_resid
|
|
1437
|
+
|
|
1438
|
+
# Calculate dispersion
|
|
1439
|
+
dispersion = residual_deviance / degrees_of_freedom
|
|
1440
|
+
except:
|
|
1441
|
+
dispersion =1
|
|
1442
|
+
|
|
1443
|
+
#ab = np.abs(((y - eVy)**2 - eVy)/eVy)
|
|
1444
|
+
|
|
1445
|
+
#bb = eVy -1
|
|
1446
|
+
#disp = sm.OLS(ab.ravel(), bb.ravel()).fit()
|
|
1447
|
+
#gamma = disp.params[0]
|
|
1420
1448
|
#print(f'dispersion is {gamma}')
|
|
1449
|
+
gamma = np.min((dispersion,1))
|
|
1450
|
+
if gamma < 0.05:
|
|
1451
|
+
gamma = 0.05
|
|
1421
1452
|
return gamma
|
|
1422
1453
|
|
|
1423
1454
|
def validation(self, betas, y, X, Xr=None, dispersion=0, rdm_cor_fit=None, zi_list=None, exog_infl=None,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{metacountregressor-0.1.206 → metacountregressor-0.1.209}/metacountregressor/_device_cust.py
RENAMED
|
File without changes
|
|
File without changes
|
{metacountregressor-0.1.206 → metacountregressor-0.1.209}/metacountregressor/data_split_helper.py
RENAMED
|
File without changes
|
|
File without changes
|
{metacountregressor-0.1.206 → metacountregressor-0.1.209}/metacountregressor/helperprocess.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{metacountregressor-0.1.206 → metacountregressor-0.1.209}/metacountregressor/metaheuristics.py
RENAMED
|
File without changes
|
|
File without changes
|
{metacountregressor-0.1.206 → metacountregressor-0.1.209}/metacountregressor/pareto_logger__plot.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{metacountregressor-0.1.206 → metacountregressor-0.1.209}/metacountregressor.egg-info/SOURCES.txt
RENAMED
|
File without changes
|
|
File without changes
|
{metacountregressor-0.1.206 → metacountregressor-0.1.209}/metacountregressor.egg-info/not-zip-safe
RENAMED
|
File without changes
|
{metacountregressor-0.1.206 → metacountregressor-0.1.209}/metacountregressor.egg-info/requires.txt
RENAMED
|
File without changes
|
{metacountregressor-0.1.206 → metacountregressor-0.1.209}/metacountregressor.egg-info/top_level.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|