metacountregressor 0.1.234__tar.gz → 0.1.236__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.234/metacountregressor.egg-info → metacountregressor-0.1.236}/PKG-INFO +1 -1
- {metacountregressor-0.1.234 → metacountregressor-0.1.236}/metacountregressor/helperprocess.py +26 -2
- {metacountregressor-0.1.234 → metacountregressor-0.1.236}/metacountregressor/solution.py +23 -12
- {metacountregressor-0.1.234 → metacountregressor-0.1.236/metacountregressor.egg-info}/PKG-INFO +1 -1
- metacountregressor-0.1.236/version.txt +1 -0
- metacountregressor-0.1.234/version.txt +0 -1
- {metacountregressor-0.1.234 → metacountregressor-0.1.236}/LICENSE.txt +0 -0
- {metacountregressor-0.1.234 → metacountregressor-0.1.236}/MANIFEST.in +0 -0
- {metacountregressor-0.1.234 → metacountregressor-0.1.236}/README.md +0 -0
- {metacountregressor-0.1.234 → metacountregressor-0.1.236}/README.rst +0 -0
- {metacountregressor-0.1.234 → metacountregressor-0.1.236}/metacountregressor/__init__.py +0 -0
- {metacountregressor-0.1.234 → metacountregressor-0.1.236}/metacountregressor/_device_cust.py +0 -0
- {metacountregressor-0.1.234 → metacountregressor-0.1.236}/metacountregressor/app_main.py +0 -0
- {metacountregressor-0.1.234 → metacountregressor-0.1.236}/metacountregressor/data_split_helper.py +0 -0
- {metacountregressor-0.1.234 → metacountregressor-0.1.236}/metacountregressor/halton.py +0 -0
- {metacountregressor-0.1.234 → metacountregressor-0.1.236}/metacountregressor/main.py +0 -0
- {metacountregressor-0.1.234 → metacountregressor-0.1.236}/metacountregressor/main_old.py +0 -0
- {metacountregressor-0.1.234 → metacountregressor-0.1.236}/metacountregressor/metaheuristics.py +0 -0
- {metacountregressor-0.1.234 → metacountregressor-0.1.236}/metacountregressor/pareto_file.py +0 -0
- {metacountregressor-0.1.234 → metacountregressor-0.1.236}/metacountregressor/pareto_logger__plot.py +0 -0
- {metacountregressor-0.1.234 → metacountregressor-0.1.236}/metacountregressor/setup.py +0 -0
- {metacountregressor-0.1.234 → metacountregressor-0.1.236}/metacountregressor/single_objective_finder.py +0 -0
- {metacountregressor-0.1.234 → metacountregressor-0.1.236}/metacountregressor/test_generated_paper2.py +0 -0
- {metacountregressor-0.1.234 → metacountregressor-0.1.236}/metacountregressor.egg-info/SOURCES.txt +0 -0
- {metacountregressor-0.1.234 → metacountregressor-0.1.236}/metacountregressor.egg-info/dependency_links.txt +0 -0
- {metacountregressor-0.1.234 → metacountregressor-0.1.236}/metacountregressor.egg-info/not-zip-safe +0 -0
- {metacountregressor-0.1.234 → metacountregressor-0.1.236}/metacountregressor.egg-info/requires.txt +0 -0
- {metacountregressor-0.1.234 → metacountregressor-0.1.236}/metacountregressor.egg-info/top_level.txt +0 -0
- {metacountregressor-0.1.234 → metacountregressor-0.1.236}/setup.cfg +0 -0
- {metacountregressor-0.1.234 → metacountregressor-0.1.236}/setup.py +0 -0
- {metacountregressor-0.1.234 → metacountregressor-0.1.236}/tests/test.py +0 -0
{metacountregressor-0.1.234 → metacountregressor-0.1.236}/metacountregressor/helperprocess.py
RENAMED
|
@@ -5,8 +5,8 @@ import csv
|
|
|
5
5
|
import matplotlib.pyplot as plt
|
|
6
6
|
from scipy import stats as st
|
|
7
7
|
from sklearn.preprocessing import StandardScaler
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
import os
|
|
9
|
+
import shutil
|
|
10
10
|
plt.style.use('https://github.com/dhaitz/matplotlib-stylesheets/raw/master/pitayasmoothie-dark.mplstyle')
|
|
11
11
|
|
|
12
12
|
|
|
@@ -22,6 +22,30 @@ def generate_param_combinations(param_grid):
|
|
|
22
22
|
combinations = [dict(zip(keys, v)) for v in product(*values)]
|
|
23
23
|
return combinations
|
|
24
24
|
|
|
25
|
+
def delete_all_folders(directory_path):
|
|
26
|
+
try:
|
|
27
|
+
# Check if the directory exists
|
|
28
|
+
if not os.path.exists(directory_path):
|
|
29
|
+
print(f"The directory '{directory_path}' does not exist.")
|
|
30
|
+
return
|
|
31
|
+
|
|
32
|
+
# Iterate through items in the directory
|
|
33
|
+
for item in os.listdir(directory_path):
|
|
34
|
+
item_path = os.path.join(directory_path, item)
|
|
35
|
+
|
|
36
|
+
# Check if the item is a folder
|
|
37
|
+
if os.path.isdir(item_path):
|
|
38
|
+
# Use shutil.rmtree to delete the folder and its contents
|
|
39
|
+
shutil.rmtree(item_path)
|
|
40
|
+
print(f"Deleted folder: {item_path}")
|
|
41
|
+
else:
|
|
42
|
+
print(f"Skipped non-folder item: {item_path}")
|
|
43
|
+
|
|
44
|
+
print("All folders deleted successfully.")
|
|
45
|
+
except Exception as e:
|
|
46
|
+
print(f"An error occurred: {e}")
|
|
47
|
+
|
|
48
|
+
|
|
25
49
|
|
|
26
50
|
##Select the best Features Based on RF
|
|
27
51
|
def select_features(X_train, y_train, n_f=16):
|
|
@@ -215,11 +215,14 @@ class ObjectiveFunction(object):
|
|
|
215
215
|
print('no name set, setting name as 0')
|
|
216
216
|
self.instance_number = str(0) # set an arbitrary instance number
|
|
217
217
|
|
|
218
|
-
if
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
218
|
+
if kwargs.get('save_directory', True):
|
|
219
|
+
self.save_state = True
|
|
220
|
+
if not os.path.exists(self.instance_number):
|
|
221
|
+
if kwargs.get('make_directory', True):
|
|
222
|
+
print('Making a Directory, if you want to stop from storing the files to this directory set argumet: make_directory:False')
|
|
223
|
+
os.makedirs(self.instance_number)
|
|
224
|
+
else:
|
|
225
|
+
self.save_state = False
|
|
223
226
|
if not hasattr(self, '_obj_1'):
|
|
224
227
|
print('_obj_1 required, define as bic, aic, ll')
|
|
225
228
|
raise Exception
|
|
@@ -481,7 +484,14 @@ class ObjectiveFunction(object):
|
|
|
481
484
|
|
|
482
485
|
model_types = [[0, 1]] # add 2 for Generalized Poisson
|
|
483
486
|
#model_types = [[0]]
|
|
484
|
-
|
|
487
|
+
|
|
488
|
+
if self:
|
|
489
|
+
model_types = [[0]]
|
|
490
|
+
self.grad_yes = False
|
|
491
|
+
|
|
492
|
+
print(f'Linear Model Selected: turning off gradient calculation')
|
|
493
|
+
|
|
494
|
+
|
|
485
495
|
model_t_dict = {'Poisson':0,
|
|
486
496
|
"NB":1}
|
|
487
497
|
# Retrieve the keys (model names) corresponding to the values in model_types
|
|
@@ -1221,8 +1231,9 @@ class ObjectiveFunction(object):
|
|
|
1221
1231
|
|
|
1222
1232
|
if save_state:
|
|
1223
1233
|
# print(file_name)
|
|
1224
|
-
self.
|
|
1225
|
-
|
|
1234
|
+
if self.save_state:
|
|
1235
|
+
self.save_to_file(latextable.draw_latex(
|
|
1236
|
+
table, caption=caption, caption_above=True), file_name)
|
|
1226
1237
|
|
|
1227
1238
|
|
|
1228
1239
|
|
|
@@ -4624,7 +4635,7 @@ class ObjectiveFunction(object):
|
|
|
4624
4635
|
betas, dispersion)
|
|
4625
4636
|
|
|
4626
4637
|
|
|
4627
|
-
eVd = self.eXB_calc(Bf, Xd, offset, main_disper,
|
|
4638
|
+
eVd = self.eXB_calc(Bf, Xd, offset, main_disper, self.linear_regression)
|
|
4628
4639
|
|
|
4629
4640
|
if return_EV is True:
|
|
4630
4641
|
return eVd
|
|
@@ -4637,7 +4648,7 @@ class ObjectiveFunction(object):
|
|
|
4637
4648
|
|
|
4638
4649
|
betas[-1] = main_disper
|
|
4639
4650
|
|
|
4640
|
-
if
|
|
4651
|
+
if self.linear_regression:
|
|
4641
4652
|
# LINEAR MODEL PROCESS
|
|
4642
4653
|
mse = np.mean((y - eVd) ** 2)
|
|
4643
4654
|
return mse
|
|
@@ -4873,10 +4884,10 @@ class ObjectiveFunction(object):
|
|
|
4873
4884
|
betas_hetro_sd = None
|
|
4874
4885
|
|
|
4875
4886
|
Vdr = dev.cust_einsum("njk,nkr -> njr", Xdr, Br) # (N,P,R)
|
|
4876
|
-
if
|
|
4887
|
+
if self:
|
|
4877
4888
|
### LINEAR MODEL WAY #######
|
|
4878
4889
|
eVd = np.clip(
|
|
4879
|
-
Vdf[:, :, None] + Vdr + Vdh + dev.np.array(offset), None,
|
|
4890
|
+
Vdf[:, :, None] + Vdr + Vdh + dev.np.array(offset), None, None)
|
|
4880
4891
|
mse = np.mean((y - eVd) ** 2)
|
|
4881
4892
|
return mse
|
|
4882
4893
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
0.1.236
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
0.1.234
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{metacountregressor-0.1.234 → metacountregressor-0.1.236}/metacountregressor/_device_cust.py
RENAMED
|
File without changes
|
|
File without changes
|
{metacountregressor-0.1.234 → metacountregressor-0.1.236}/metacountregressor/data_split_helper.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{metacountregressor-0.1.234 → metacountregressor-0.1.236}/metacountregressor/metaheuristics.py
RENAMED
|
File without changes
|
|
File without changes
|
{metacountregressor-0.1.234 → metacountregressor-0.1.236}/metacountregressor/pareto_logger__plot.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{metacountregressor-0.1.234 → metacountregressor-0.1.236}/metacountregressor.egg-info/SOURCES.txt
RENAMED
|
File without changes
|
|
File without changes
|
{metacountregressor-0.1.234 → metacountregressor-0.1.236}/metacountregressor.egg-info/not-zip-safe
RENAMED
|
File without changes
|
{metacountregressor-0.1.234 → metacountregressor-0.1.236}/metacountregressor.egg-info/requires.txt
RENAMED
|
File without changes
|
{metacountregressor-0.1.234 → metacountregressor-0.1.236}/metacountregressor.egg-info/top_level.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|