metacountregressor 0.1.125__py3-none-any.whl → 0.1.127__py3-none-any.whl

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.
@@ -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.125
3
+ Version: 0.1.127
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
@@ -3,7 +3,7 @@ metacountregressor/_device_cust.py,sha256=759fnKmTYccJm4Lpi9_1reurh6OB9d6q9soPR0
3
3
  metacountregressor/app_main.py,sha256=vY3GczTbGbBRalbzMkl_9jVW7RMgEOc6z2Dr1IZJv9c,10014
4
4
  metacountregressor/data_split_helper.py,sha256=M2fIMdIO8znUaYhx5wlacRyNWdQjNYu1z1wkE-kFUYU,3373
5
5
  metacountregressor/halton.py,sha256=jhovA45UBoZYU9g-hl6Lb2sBIx_ZBTNdPrpgkzR9fng,9463
6
- metacountregressor/helperprocess.py,sha256=D5KMFk_OFHvYxFzjQhbwypxks32J7atKpa4J5DThYPE,16661
6
+ metacountregressor/helperprocess.py,sha256=gzZ6g_uzctQeuyzqj3mV1n1Y4Kw8CLYK02Dkoz_fV9w,17041
7
7
  metacountregressor/main.py,sha256=A3XGwbwhhKVgMxnEgbAmMpgYaWkS8Rk30-cYs3FxvEk,22713
8
8
  metacountregressor/main_old.py,sha256=eTS4ygq27MnU-dZ_j983Ucb-D5XfbVF8OJQK2hVVLZc,24123
9
9
  metacountregressor/metaheuristics.py,sha256=Kkx1Jfox6NBlm5zVrI26Vc_NI7NFQSS9dinrZU9SpV8,105871
@@ -11,10 +11,10 @@ metacountregressor/pareto_file.py,sha256=whySaoPAUWYjyI8zo0hwAOa3rFk6SIUlHSpqZiL
11
11
  metacountregressor/pareto_logger__plot.py,sha256=mEU2QN4wmsM7t39GJ_XhJ_jjsdl09JOmG0U2jICrAkI,30037
12
12
  metacountregressor/setup.py,sha256=5UcQCCLR8Fm5odA3MX78WwahavxFq4mVD6oq0IuQvAY,936
13
13
  metacountregressor/single_objective_finder.py,sha256=jVG7GJBqzSP4_riYr-kMMKy_LE3SlGmKMunNhHYxgRg,8011
14
- metacountregressor/solution.py,sha256=uAwYNfyVbFIpYg23J7Rn6jfDokRYwWsrllIqtS2qeso,277587
14
+ metacountregressor/solution.py,sha256=_InL6f_DHPuP518NfYXhQJQwDejR5CVEXdWyU1kKY7E,277562
15
15
  metacountregressor/test_generated_paper2.py,sha256=pwOoRzl1jJIIOUAAvbkT6HmmTQ81mwpsshn9SLdKOg8,3927
16
- metacountregressor-0.1.125.dist-info/LICENSE.txt,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
17
- metacountregressor-0.1.125.dist-info/METADATA,sha256=YT5DEXf9O5CasvuoVesen96osnDRIxZA8a04_yLVYMs,23434
18
- metacountregressor-0.1.125.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
19
- metacountregressor-0.1.125.dist-info/top_level.txt,sha256=zGG7UC5WIpr76gsFUpwJ4En2aCcoNTONBaS3OewwjR0,19
20
- metacountregressor-0.1.125.dist-info/RECORD,,
16
+ metacountregressor-0.1.127.dist-info/LICENSE.txt,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
17
+ metacountregressor-0.1.127.dist-info/METADATA,sha256=oQWg23dV1Dww0iSx684RxlhJyAKwn0Ud6PVNcdKt6LQ,23434
18
+ metacountregressor-0.1.127.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
19
+ metacountregressor-0.1.127.dist-info/top_level.txt,sha256=zGG7UC5WIpr76gsFUpwJ4En2aCcoNTONBaS3OewwjR0,19
20
+ metacountregressor-0.1.127.dist-info/RECORD,,