metacountregressor 0.1.120__tar.gz → 0.1.121__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.120 → metacountregressor-0.1.121}/PKG-INFO +1 -1
  2. {metacountregressor-0.1.120 → metacountregressor-0.1.121}/metacountregressor/helperprocess.py +26 -1
  3. {metacountregressor-0.1.120 → metacountregressor-0.1.121}/metacountregressor/main.py +1 -1
  4. {metacountregressor-0.1.120 → metacountregressor-0.1.121}/metacountregressor.egg-info/PKG-INFO +1 -1
  5. {metacountregressor-0.1.120 → metacountregressor-0.1.121}/LICENSE.txt +0 -0
  6. {metacountregressor-0.1.120 → metacountregressor-0.1.121}/README.rst +0 -0
  7. {metacountregressor-0.1.120 → metacountregressor-0.1.121}/metacountregressor/__init__.py +0 -0
  8. {metacountregressor-0.1.120 → metacountregressor-0.1.121}/metacountregressor/_device_cust.py +0 -0
  9. {metacountregressor-0.1.120 → metacountregressor-0.1.121}/metacountregressor/app_main.py +0 -0
  10. {metacountregressor-0.1.120 → metacountregressor-0.1.121}/metacountregressor/data_split_helper.py +0 -0
  11. {metacountregressor-0.1.120 → metacountregressor-0.1.121}/metacountregressor/halton.py +0 -0
  12. {metacountregressor-0.1.120 → metacountregressor-0.1.121}/metacountregressor/main_old.py +0 -0
  13. {metacountregressor-0.1.120 → metacountregressor-0.1.121}/metacountregressor/metaheuristics.py +0 -0
  14. {metacountregressor-0.1.120 → metacountregressor-0.1.121}/metacountregressor/pareto_file.py +0 -0
  15. {metacountregressor-0.1.120 → metacountregressor-0.1.121}/metacountregressor/pareto_logger__plot.py +0 -0
  16. {metacountregressor-0.1.120 → metacountregressor-0.1.121}/metacountregressor/setup.py +0 -0
  17. {metacountregressor-0.1.120 → metacountregressor-0.1.121}/metacountregressor/single_objective_finder.py +0 -0
  18. {metacountregressor-0.1.120 → metacountregressor-0.1.121}/metacountregressor/solution.py +0 -0
  19. {metacountregressor-0.1.120 → metacountregressor-0.1.121}/metacountregressor/test_generated_paper2.py +0 -0
  20. {metacountregressor-0.1.120 → metacountregressor-0.1.121}/metacountregressor.egg-info/SOURCES.txt +0 -0
  21. {metacountregressor-0.1.120 → metacountregressor-0.1.121}/metacountregressor.egg-info/dependency_links.txt +0 -0
  22. {metacountregressor-0.1.120 → metacountregressor-0.1.121}/metacountregressor.egg-info/not-zip-safe +0 -0
  23. {metacountregressor-0.1.120 → metacountregressor-0.1.121}/metacountregressor.egg-info/requires.txt +0 -0
  24. {metacountregressor-0.1.120 → metacountregressor-0.1.121}/metacountregressor.egg-info/top_level.txt +0 -0
  25. {metacountregressor-0.1.120 → metacountregressor-0.1.121}/setup.cfg +0 -0
  26. {metacountregressor-0.1.120 → metacountregressor-0.1.121}/setup.py +0 -0
  27. {metacountregressor-0.1.120 → metacountregressor-0.1.121}/tests/test.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: metacountregressor
3
- Version: 0.1.120
3
+ Version: 0.1.121
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
@@ -2,7 +2,7 @@ import numpy as np
2
2
  import pandas as pd
3
3
  import csv
4
4
  import matplotlib.pyplot as plt
5
-
5
+ from sklearn.preprocessing import StandardScaler
6
6
 
7
7
  plt.style.use('https://github.com/dhaitz/matplotlib-stylesheets/raw/master/pitayasmoothie-dark.mplstyle')
8
8
 
@@ -219,6 +219,31 @@ def transform_dataframe(df, config):
219
219
 
220
220
  return output_df
221
221
 
222
+ # Helper function to guess column type and update `config`
223
+ def guess_column_type(column_name, series):
224
+ if series.dtype == 'object' or series.dtype.name == 'category':
225
+ # If the column is categorical (e.g., strings), assume one-hot encoding
226
+ return {'type': 'one-hot', 'prefix': column_name}
227
+ elif pd.api.types.is_numeric_dtype(series):
228
+ unique_values = series.nunique()
229
+ if unique_values < 10:
230
+ # If there are few unique values, assume binning with default bins
231
+ min_val, max_val = series.min(), series.max()
232
+ bins = np.linspace(min_val, max_val, num=unique_values + 1)
233
+ labels = [f'Bin_{i}' for i in range(1, len(bins))]
234
+ return {'type': 'bin', 'bins': bins, 'labels': labels, 'prefix': f'{column_name}_Binned'}
235
+ else:
236
+ # # Otherwise, assume continuous data with normalization
237
+ # Otherwise, fallback to continuous standardization
238
+ return {
239
+ 'type': 'continuous',
240
+ 'apply_func': (lambda x: (x - series.mean()) / series.std()) # Z-Score Standardization
241
+ }
242
+ else:
243
+ # Default fallback (leave the column unchanged)
244
+ return {'type': 'none'}
245
+
246
+
222
247
 
223
248
  def as_wide_factor(x_df, yes=1, min_factor=2, max_factor=8, keep_original=0, exclude=[]):
224
249
  if not yes:
@@ -389,7 +389,7 @@ def main(args, **kwargs):
389
389
  print('test') #FIXME
390
390
  else:
391
391
  print('PROCESS THE PACKAGE ARGUMENTS SIMULIAR TO HOW ONE WOULD DEFINE THE ENVIRONMENT')
392
- data_info =process_package_argumemnts()
392
+ data_info =process_package_arguments()
393
393
 
394
394
 
395
395
  if args['Keep_Fit'] == str(2) or args['Keep_Fit'] == 2:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: metacountregressor
3
- Version: 0.1.120
3
+ Version: 0.1.121
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