metacountregressor 0.1.123__tar.gz → 0.1.125__tar.gz

Sign up to get free protection for your applications and to get access to all the features.
Files changed (27) hide show
  1. {metacountregressor-0.1.123 → metacountregressor-0.1.125}/PKG-INFO +1 -1
  2. {metacountregressor-0.1.123 → metacountregressor-0.1.125}/metacountregressor/helperprocess.py +15 -3
  3. {metacountregressor-0.1.123 → metacountregressor-0.1.125}/metacountregressor/solution.py +3 -3
  4. {metacountregressor-0.1.123 → metacountregressor-0.1.125}/metacountregressor.egg-info/PKG-INFO +1 -1
  5. {metacountregressor-0.1.123 → metacountregressor-0.1.125}/LICENSE.txt +0 -0
  6. {metacountregressor-0.1.123 → metacountregressor-0.1.125}/README.rst +0 -0
  7. {metacountregressor-0.1.123 → metacountregressor-0.1.125}/metacountregressor/__init__.py +0 -0
  8. {metacountregressor-0.1.123 → metacountregressor-0.1.125}/metacountregressor/_device_cust.py +0 -0
  9. {metacountregressor-0.1.123 → metacountregressor-0.1.125}/metacountregressor/app_main.py +0 -0
  10. {metacountregressor-0.1.123 → metacountregressor-0.1.125}/metacountregressor/data_split_helper.py +0 -0
  11. {metacountregressor-0.1.123 → metacountregressor-0.1.125}/metacountregressor/halton.py +0 -0
  12. {metacountregressor-0.1.123 → metacountregressor-0.1.125}/metacountregressor/main.py +0 -0
  13. {metacountregressor-0.1.123 → metacountregressor-0.1.125}/metacountregressor/main_old.py +0 -0
  14. {metacountregressor-0.1.123 → metacountregressor-0.1.125}/metacountregressor/metaheuristics.py +0 -0
  15. {metacountregressor-0.1.123 → metacountregressor-0.1.125}/metacountregressor/pareto_file.py +0 -0
  16. {metacountregressor-0.1.123 → metacountregressor-0.1.125}/metacountregressor/pareto_logger__plot.py +0 -0
  17. {metacountregressor-0.1.123 → metacountregressor-0.1.125}/metacountregressor/setup.py +0 -0
  18. {metacountregressor-0.1.123 → metacountregressor-0.1.125}/metacountregressor/single_objective_finder.py +0 -0
  19. {metacountregressor-0.1.123 → metacountregressor-0.1.125}/metacountregressor/test_generated_paper2.py +0 -0
  20. {metacountregressor-0.1.123 → metacountregressor-0.1.125}/metacountregressor.egg-info/SOURCES.txt +0 -0
  21. {metacountregressor-0.1.123 → metacountregressor-0.1.125}/metacountregressor.egg-info/dependency_links.txt +0 -0
  22. {metacountregressor-0.1.123 → metacountregressor-0.1.125}/metacountregressor.egg-info/not-zip-safe +0 -0
  23. {metacountregressor-0.1.123 → metacountregressor-0.1.125}/metacountregressor.egg-info/requires.txt +0 -0
  24. {metacountregressor-0.1.123 → metacountregressor-0.1.125}/metacountregressor.egg-info/top_level.txt +0 -0
  25. {metacountregressor-0.1.123 → metacountregressor-0.1.125}/setup.cfg +0 -0
  26. {metacountregressor-0.1.123 → metacountregressor-0.1.125}/setup.py +0 -0
  27. {metacountregressor-0.1.123 → metacountregressor-0.1.125}/tests/test.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: metacountregressor
3
- Version: 0.1.123
3
+ Version: 0.1.125
4
4
  Summary: Extensions for a Python package for estimation of count models.
5
5
  Home-page: https://github.com/zahern/CountDataEstimation
6
6
  Author: Zeke Ahern
@@ -311,14 +311,26 @@ def interactions(df, keep=None, drop_this_perc=0.6, interact = False):
311
311
  df = pd.concat([df, df_interactions], axis=1, sort=False)
312
312
 
313
313
  # second
314
- corr_matrix = df.corr().abs()
314
+ # Remove `keep` columns from the correlation matrix
315
+ if keep is not None:
316
+ df_corr = df.drop(columns=keep, errors='ignore') # Exclude `keep` columns
317
+ else:
318
+ df_corr = df
319
+
320
+ # Compute the absolute correlation matrix
321
+ corr_matrix = df_corr.corr().abs()
322
+
323
+ # Keep only the upper triangle of the correlation matrix
315
324
  upper = corr_matrix.where(np.triu(np.ones(corr_matrix.shape), k=1).astype(bool))
316
325
 
317
- # Find features with correlation greater than 0.6
326
+ # Find features with correlation greater than the threshold
318
327
  to_drop = [column for column in upper.columns if any(upper[column] > drop_this_perc)]
328
+
329
+ # Ensure `keep` columns are not dropped
319
330
  if keep is not None:
320
331
  to_drop = [column for column in to_drop if column not in keep]
321
- # Drop features
332
+
333
+ # Drop the identified features
322
334
  df.drop(to_drop, axis=1, inplace=True)
323
335
 
324
336
  return df
@@ -2983,7 +2983,7 @@ class ObjectiveFunction(object):
2983
2983
  argument = prob.mean(axis=1)
2984
2984
  # if less than 0 penalise
2985
2985
  if np.min(argument) < 0:
2986
- print('what the fuck')
2986
+ print('Error with args..')
2987
2987
  if np.min(argument) < limit:
2988
2988
  # add a penalty for too small argument of log
2989
2989
  log_lik += -np.sum(np.minimum(0.0, argument - limit)) / limit
@@ -3634,7 +3634,7 @@ class ObjectiveFunction(object):
3634
3634
  #print("Custom functieon time:", end_time - start_time)
3635
3635
 
3636
3636
  except Exception as e:
3637
- print(e)
3637
+ print("Neg Binom error.")
3638
3638
  return gg_alt
3639
3639
 
3640
3640
  def lindley_pmf(self, x, r, theta, k=50):
@@ -3968,7 +3968,7 @@ class ObjectiveFunction(object):
3968
3968
 
3969
3969
 
3970
3970
  # proba_d = self.dnegbimonli(y, eVd, b_gam )
3971
- # print('fuck if this actually works')
3971
+
3972
3972
 
3973
3973
  elif dispersion == 2:
3974
3974
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: metacountregressor
3
- Version: 0.1.123
3
+ Version: 0.1.125
4
4
  Summary: Extensions for a Python package for estimation of count models.
5
5
  Home-page: https://github.com/zahern/CountDataEstimation
6
6
  Author: Zeke Ahern