metacountregressor 0.1.204__tar.gz → 0.1.206__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 (27) hide show
  1. {metacountregressor-0.1.204 → metacountregressor-0.1.206}/PKG-INFO +1 -1
  2. {metacountregressor-0.1.204 → metacountregressor-0.1.206}/metacountregressor/helperprocess.py +1 -1
  3. {metacountregressor-0.1.204 → metacountregressor-0.1.206}/metacountregressor/metaheuristics.py +7 -0
  4. {metacountregressor-0.1.204 → metacountregressor-0.1.206}/metacountregressor/solution.py +16 -12
  5. {metacountregressor-0.1.204 → metacountregressor-0.1.206}/metacountregressor.egg-info/PKG-INFO +1 -1
  6. {metacountregressor-0.1.204 → metacountregressor-0.1.206}/LICENSE.txt +0 -0
  7. {metacountregressor-0.1.204 → metacountregressor-0.1.206}/README.rst +0 -0
  8. {metacountregressor-0.1.204 → metacountregressor-0.1.206}/metacountregressor/__init__.py +0 -0
  9. {metacountregressor-0.1.204 → metacountregressor-0.1.206}/metacountregressor/_device_cust.py +0 -0
  10. {metacountregressor-0.1.204 → metacountregressor-0.1.206}/metacountregressor/app_main.py +0 -0
  11. {metacountregressor-0.1.204 → metacountregressor-0.1.206}/metacountregressor/data_split_helper.py +0 -0
  12. {metacountregressor-0.1.204 → metacountregressor-0.1.206}/metacountregressor/halton.py +0 -0
  13. {metacountregressor-0.1.204 → metacountregressor-0.1.206}/metacountregressor/main.py +0 -0
  14. {metacountregressor-0.1.204 → metacountregressor-0.1.206}/metacountregressor/main_old.py +0 -0
  15. {metacountregressor-0.1.204 → metacountregressor-0.1.206}/metacountregressor/pareto_file.py +0 -0
  16. {metacountregressor-0.1.204 → metacountregressor-0.1.206}/metacountregressor/pareto_logger__plot.py +0 -0
  17. {metacountregressor-0.1.204 → metacountregressor-0.1.206}/metacountregressor/setup.py +0 -0
  18. {metacountregressor-0.1.204 → metacountregressor-0.1.206}/metacountregressor/single_objective_finder.py +0 -0
  19. {metacountregressor-0.1.204 → metacountregressor-0.1.206}/metacountregressor/test_generated_paper2.py +0 -0
  20. {metacountregressor-0.1.204 → metacountregressor-0.1.206}/metacountregressor.egg-info/SOURCES.txt +0 -0
  21. {metacountregressor-0.1.204 → metacountregressor-0.1.206}/metacountregressor.egg-info/dependency_links.txt +0 -0
  22. {metacountregressor-0.1.204 → metacountregressor-0.1.206}/metacountregressor.egg-info/not-zip-safe +0 -0
  23. {metacountregressor-0.1.204 → metacountregressor-0.1.206}/metacountregressor.egg-info/requires.txt +0 -0
  24. {metacountregressor-0.1.204 → metacountregressor-0.1.206}/metacountregressor.egg-info/top_level.txt +0 -0
  25. {metacountregressor-0.1.204 → metacountregressor-0.1.206}/setup.cfg +0 -0
  26. {metacountregressor-0.1.204 → metacountregressor-0.1.206}/setup.py +0 -0
  27. {metacountregressor-0.1.204 → metacountregressor-0.1.206}/tests/test.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: metacountregressor
3
- Version: 0.1.204
3
+ Version: 0.1.206
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
@@ -415,7 +415,7 @@ def PCA_code(X, n_components=5):
415
415
  return principalComponents
416
416
 
417
417
 
418
- def interactions(df, keep=None, drop_this_perc=0.6, interact = False):
418
+ def interactions(df, keep=None, drop_this_perc=0.5, interact = False):
419
419
  full_columns = df.columns
420
420
  if interact:
421
421
  interactions_list = []
@@ -275,6 +275,13 @@ def harmony_search(objective_function, initial_harmonies=None, hyperparameters=N
275
275
  Returns:
276
276
  _type_: results for the harmony search algorithm in single or multi objective
277
277
  """
278
+ #set up objective function hyper
279
+ if kwargs.get('_hms') is not None:
280
+ objective_function._hms = kwargs.get('_hms')
281
+ if kwargs.get('_hmcr') is not None:
282
+ objective_function._hmcr = kwargs.get('_hmcr')
283
+
284
+
278
285
  man = None
279
286
  if 'Manual_Fit' in kwargs:
280
287
  if kwargs['Manual_Fit'] is not None:
@@ -150,7 +150,7 @@ class ObjectiveFunction(object):
150
150
  self.rdm_fit = None
151
151
  self.rdm_cor_fit = None
152
152
  self.dist_fit = None
153
-
153
+ self.rounding_point = kwargs.get('decimals_in_coeff', 2)
154
154
  self.MAE = None
155
155
  self.best_obj_1 = 1000000.0
156
156
  self._obj_1 = kwargs.get('_obj_1', 'bic')
@@ -160,18 +160,18 @@ class ObjectiveFunction(object):
160
160
  self.GP_parameter = 0
161
161
  self.is_multi = kwargs.get('is_multi', False)
162
162
  self.complexity_level = kwargs.get('complexity_level', 6)
163
- self._max_iterations_improvement = 10000
163
+ self._max_iterations_improvement = kwargs.get("WIC",10000)
164
164
  self.generated_sln = set()
165
165
  self.ave_mae = 0
166
166
  # defalt paramaters for hs #TODO unpack into harmony search class
167
167
  self.algorithm = 'hs' # 'sa' 'de' also avialable
168
168
  self._hms = 20
169
- self._max_time = 60 * 60 * 24
170
- self._hmcr = .5
169
+ self._max_time = kwargs.get('_max_time',.60 * 60 * 24)
170
+ self._hmcr = kwargs.get('_hmcr',.5)
171
171
  self._par = 0.3 #dont think this gets useted
172
172
  self._mpai = 1
173
173
  self._max_imp = 100000
174
- self._WIC = 1000 # Number of Iterations without Multiobjective Improvement #tod chuck into solution
174
+ self._WIC = kwargs.get("WIC",10000) # Number of Iterations without Multiobjective Improvement #tod chuck into solution
175
175
  self._panels = None
176
176
  self.is_multi = True
177
177
  self.method_ll = 'Nelder-Mead-BFGS'
@@ -1146,7 +1146,8 @@ class ObjectiveFunction(object):
1146
1146
  print(np.exp(self.coeff_[-1]))
1147
1147
  #self.coeff_[-1] = np.exp(self.coeff_[-1]) # min possible value for negbinom
1148
1148
 
1149
- self.coeff_ = [self.round_with_padding(x, 2) for x in self.coeff_]
1149
+
1150
+ self.coeff_ = [self.round_with_padding(x, self.rounding_point) for x in self.coeff_]
1150
1151
 
1151
1152
  self.stderr = [self.round_with_padding(x, 2) for x in self.stderr]
1152
1153
  self.zvalues = [self.round_with_padding(
@@ -1945,11 +1946,11 @@ class ObjectiveFunction(object):
1945
1946
 
1946
1947
  else:
1947
1948
  slice_this_amount = self.num_dispersion_params(dispersion)
1948
- slice_this_amount = 1 #TODO handle this
1949
+ slice_this_amount = 0 #TODO handle this
1949
1950
  if pvalues[-1] > sig_value:
1950
1951
  vio_counts += 1
1951
1952
  subpvalues = pvalues[:-slice_this_amount].copy()
1952
-
1953
+
1953
1954
  if Kh > 1:
1954
1955
  if subpvalues[-1] < sig_value:
1955
1956
  subpvalues[-Kh] = 0
@@ -6436,10 +6437,13 @@ class ObjectiveFunction(object):
6436
6437
  if not is_delete and is_halton:
6437
6438
  if obj_1[self._obj_1] <= self.best_obj_1:
6438
6439
  self.pvalue_sig_value = .1
6439
-
6440
- st, self.pvalue_exceed = self.get_pvalue_info_alt(
6441
- pvalues, self.coeff_names, self.pvalue_sig_value, dispersion, is_halton, 0, 1)
6442
-
6440
+ try:
6441
+ st, self.pvalue_exceed = self.get_pvalue_info_alt(
6442
+ pvalues, self.coeff_names, self.pvalue_sig_value, dispersion, is_halton, 0, 1)
6443
+ except Exception as pval_exe:
6444
+ print(pval_exe)
6445
+ self.pvalue_exceed = sum(
6446
+ a > self.pvalue_sig_value for a in pvalues)
6443
6447
  else:
6444
6448
  self.pvalue_exceed = sum(
6445
6449
  a > self.pvalue_sig_value for a in pvalues)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: metacountregressor
3
- Version: 0.1.204
3
+ Version: 0.1.206
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