metacountregressor 0.1.235__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.
Files changed (31) hide show
  1. {metacountregressor-0.1.235/metacountregressor.egg-info → metacountregressor-0.1.236}/PKG-INFO +1 -1
  2. {metacountregressor-0.1.235 → metacountregressor-0.1.236}/metacountregressor/helperprocess.py +26 -2
  3. {metacountregressor-0.1.235 → metacountregressor-0.1.236}/metacountregressor/solution.py +12 -8
  4. {metacountregressor-0.1.235 → metacountregressor-0.1.236/metacountregressor.egg-info}/PKG-INFO +1 -1
  5. metacountregressor-0.1.236/version.txt +1 -0
  6. metacountregressor-0.1.235/version.txt +0 -1
  7. {metacountregressor-0.1.235 → metacountregressor-0.1.236}/LICENSE.txt +0 -0
  8. {metacountregressor-0.1.235 → metacountregressor-0.1.236}/MANIFEST.in +0 -0
  9. {metacountregressor-0.1.235 → metacountregressor-0.1.236}/README.md +0 -0
  10. {metacountregressor-0.1.235 → metacountregressor-0.1.236}/README.rst +0 -0
  11. {metacountregressor-0.1.235 → metacountregressor-0.1.236}/metacountregressor/__init__.py +0 -0
  12. {metacountregressor-0.1.235 → metacountregressor-0.1.236}/metacountregressor/_device_cust.py +0 -0
  13. {metacountregressor-0.1.235 → metacountregressor-0.1.236}/metacountregressor/app_main.py +0 -0
  14. {metacountregressor-0.1.235 → metacountregressor-0.1.236}/metacountregressor/data_split_helper.py +0 -0
  15. {metacountregressor-0.1.235 → metacountregressor-0.1.236}/metacountregressor/halton.py +0 -0
  16. {metacountregressor-0.1.235 → metacountregressor-0.1.236}/metacountregressor/main.py +0 -0
  17. {metacountregressor-0.1.235 → metacountregressor-0.1.236}/metacountregressor/main_old.py +0 -0
  18. {metacountregressor-0.1.235 → metacountregressor-0.1.236}/metacountregressor/metaheuristics.py +0 -0
  19. {metacountregressor-0.1.235 → metacountregressor-0.1.236}/metacountregressor/pareto_file.py +0 -0
  20. {metacountregressor-0.1.235 → metacountregressor-0.1.236}/metacountregressor/pareto_logger__plot.py +0 -0
  21. {metacountregressor-0.1.235 → metacountregressor-0.1.236}/metacountregressor/setup.py +0 -0
  22. {metacountregressor-0.1.235 → metacountregressor-0.1.236}/metacountregressor/single_objective_finder.py +0 -0
  23. {metacountregressor-0.1.235 → metacountregressor-0.1.236}/metacountregressor/test_generated_paper2.py +0 -0
  24. {metacountregressor-0.1.235 → metacountregressor-0.1.236}/metacountregressor.egg-info/SOURCES.txt +0 -0
  25. {metacountregressor-0.1.235 → metacountregressor-0.1.236}/metacountregressor.egg-info/dependency_links.txt +0 -0
  26. {metacountregressor-0.1.235 → metacountregressor-0.1.236}/metacountregressor.egg-info/not-zip-safe +0 -0
  27. {metacountregressor-0.1.235 → metacountregressor-0.1.236}/metacountregressor.egg-info/requires.txt +0 -0
  28. {metacountregressor-0.1.235 → metacountregressor-0.1.236}/metacountregressor.egg-info/top_level.txt +0 -0
  29. {metacountregressor-0.1.235 → metacountregressor-0.1.236}/setup.cfg +0 -0
  30. {metacountregressor-0.1.235 → metacountregressor-0.1.236}/setup.py +0 -0
  31. {metacountregressor-0.1.235 → metacountregressor-0.1.236}/tests/test.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: metacountregressor
3
- Version: 0.1.235
3
+ Version: 0.1.236
4
4
  Summary: Extensive Testing for Estimation of Data Count Models
5
5
  Home-page: https://github.com/zahern/CountDataEstimation
6
6
  Author: Zeke Ahern
@@ -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 not os.path.exists(self.instance_number):
219
- if kwargs.get('make_directory', True):
220
- print('Making a Directory, if you want to stop from storing the files to this directory set argumet: make_directory:False')
221
- os.makedirs(self.instance_number)
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
@@ -482,7 +485,7 @@ class ObjectiveFunction(object):
482
485
  model_types = [[0, 1]] # add 2 for Generalized Poisson
483
486
  #model_types = [[0]]
484
487
 
485
- if kwargs.get('linear_model', None) is not None:
488
+ if self:
486
489
  model_types = [[0]]
487
490
  self.grad_yes = False
488
491
 
@@ -1228,8 +1231,9 @@ class ObjectiveFunction(object):
1228
1231
 
1229
1232
  if save_state:
1230
1233
  # print(file_name)
1231
- self.save_to_file(latextable.draw_latex(
1232
- table, caption=caption, caption_above=True), file_name)
1234
+ if self.save_state:
1235
+ self.save_to_file(latextable.draw_latex(
1236
+ table, caption=caption, caption_above=True), file_name)
1233
1237
 
1234
1238
 
1235
1239
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: metacountregressor
3
- Version: 0.1.235
3
+ Version: 0.1.236
4
4
  Summary: Extensive Testing for Estimation of Data Count Models
5
5
  Home-page: https://github.com/zahern/CountDataEstimation
6
6
  Author: Zeke Ahern
@@ -0,0 +1 @@
1
+ 0.1.236
@@ -1 +0,0 @@
1
- 0.1.235