metacountregressor 0.1.156__tar.gz → 0.1.159__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.156 → metacountregressor-0.1.159}/PKG-INFO +1 -1
  2. {metacountregressor-0.1.156 → metacountregressor-0.1.159}/metacountregressor/helperprocess.py +1 -1
  3. {metacountregressor-0.1.156 → metacountregressor-0.1.159}/metacountregressor/main.py +14 -5
  4. {metacountregressor-0.1.156 → metacountregressor-0.1.159}/metacountregressor/solution.py +1 -1
  5. {metacountregressor-0.1.156 → metacountregressor-0.1.159}/metacountregressor.egg-info/PKG-INFO +1 -1
  6. {metacountregressor-0.1.156 → metacountregressor-0.1.159}/LICENSE.txt +0 -0
  7. {metacountregressor-0.1.156 → metacountregressor-0.1.159}/README.rst +0 -0
  8. {metacountregressor-0.1.156 → metacountregressor-0.1.159}/metacountregressor/__init__.py +0 -0
  9. {metacountregressor-0.1.156 → metacountregressor-0.1.159}/metacountregressor/_device_cust.py +0 -0
  10. {metacountregressor-0.1.156 → metacountregressor-0.1.159}/metacountregressor/app_main.py +0 -0
  11. {metacountregressor-0.1.156 → metacountregressor-0.1.159}/metacountregressor/data_split_helper.py +0 -0
  12. {metacountregressor-0.1.156 → metacountregressor-0.1.159}/metacountregressor/halton.py +0 -0
  13. {metacountregressor-0.1.156 → metacountregressor-0.1.159}/metacountregressor/main_old.py +0 -0
  14. {metacountregressor-0.1.156 → metacountregressor-0.1.159}/metacountregressor/metaheuristics.py +0 -0
  15. {metacountregressor-0.1.156 → metacountregressor-0.1.159}/metacountregressor/pareto_file.py +0 -0
  16. {metacountregressor-0.1.156 → metacountregressor-0.1.159}/metacountregressor/pareto_logger__plot.py +0 -0
  17. {metacountregressor-0.1.156 → metacountregressor-0.1.159}/metacountregressor/setup.py +0 -0
  18. {metacountregressor-0.1.156 → metacountregressor-0.1.159}/metacountregressor/single_objective_finder.py +0 -0
  19. {metacountregressor-0.1.156 → metacountregressor-0.1.159}/metacountregressor/test_generated_paper2.py +0 -0
  20. {metacountregressor-0.1.156 → metacountregressor-0.1.159}/metacountregressor.egg-info/SOURCES.txt +0 -0
  21. {metacountregressor-0.1.156 → metacountregressor-0.1.159}/metacountregressor.egg-info/dependency_links.txt +0 -0
  22. {metacountregressor-0.1.156 → metacountregressor-0.1.159}/metacountregressor.egg-info/not-zip-safe +0 -0
  23. {metacountregressor-0.1.156 → metacountregressor-0.1.159}/metacountregressor.egg-info/requires.txt +0 -0
  24. {metacountregressor-0.1.156 → metacountregressor-0.1.159}/metacountregressor.egg-info/top_level.txt +0 -0
  25. {metacountregressor-0.1.156 → metacountregressor-0.1.159}/setup.cfg +0 -0
  26. {metacountregressor-0.1.156 → metacountregressor-0.1.159}/setup.py +0 -0
  27. {metacountregressor-0.1.156 → metacountregressor-0.1.159}/tests/test.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: metacountregressor
3
- Version: 0.1.156
3
+ Version: 0.1.159
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
@@ -214,7 +214,7 @@ def set_up_analyst_constraints(data_characteristic, model_terms, variable_decis
214
214
  result = [item for item in name_data_characteristics if item not in non_none_terms]
215
215
  distu = ['normal', 'uniform', 'triangular']
216
216
  tra = ['no', 'sqrt', 'arcsinh']
217
- if model_terms.get('grouped') is None:
217
+ if model_terms.get('group') is None:
218
218
  print('cant have grouped rpm, removing level 4 from every item')
219
219
  MAKE_ALL_4_FALSE = True
220
220
  else:
@@ -174,16 +174,25 @@ def main(args, **kwargs):
174
174
  X = df
175
175
  y = df['FREQ'] # Frequency of crashes
176
176
  X['Offset'] = np.log(df['AADT']) # Explicitley define how to offset the data, no offset otherwise
177
+ df['Offset'] = np.log(df['AADT'])
177
178
  # Drop Y, selected offset term and ID as there are no panels
178
179
  X = df.drop(columns=['FREQ', 'ID', 'AADT'])
179
-
180
+ # Step 0: Process Data
181
+ model_terms = {
182
+ 'Y': 'FREQ', # Replace 'FREQ' with the name of your dependent variable
183
+ 'group': None, # Replace 'group_column' with the name of your grouping column (or None if not used)
184
+ 'panels': None, # Replace 'panel_column' with the name of your panel column (or None if not used)
185
+ 'Offset': 'Offset' # Replace None with the name of your offset column if using one
186
+ }
187
+ a_des, df = helperprocess.set_up_analyst_constraints(df, model_terms)
180
188
  # some example argument, these are defualt so the following line is just for claritity
181
189
  args = {'algorithm': 'hs', 'test_percentage': 0.15, 'test_complexity': 6, 'instance_number': 1,
182
- 'val_percentage': 0.15, 'obj_1': 'bic', '_obj_2': 'RMSE_TEST', "MAX_TIME": 6}
190
+ 'val_percentage': 0.15, 'obj_1': 'bic', '_obj_2': 'RMSE_TEST', "MAX_TIME": 6, 'desicions':a_des}
183
191
  # Fit the model with metacountregressor
184
192
  # Step 5: Transform the dataset based on the configuration
185
- data_new = helperprocess.transform_dataframe(dataset, config)
186
-
193
+ #data_new = helperprocess.transform_dataframe(dataset, config)
194
+ y = df[['Y']]
195
+ X = df.drop(columns=['Y'])
187
196
  obj_fun = ObjectiveFunction(X, y, **args)
188
197
  # replace with other metaheuristics if desired
189
198
  results = harmony_search(obj_fun)
@@ -507,7 +516,7 @@ if __name__ == '__main__':
507
516
  formatter_class=argparse.RawDescriptionHelpFormatter, conflict_handler='resolve')
508
517
 
509
518
 
510
- BATCH_JOB = True
519
+ BATCH_JOB = False
511
520
 
512
521
  if BATCH_JOB:
513
522
  parser.add_argument('-dataset_file', default='data/Ex-16-3.csv', help='supply the path to the dataset')
@@ -463,7 +463,7 @@ class ObjectiveFunction(object):
463
463
 
464
464
 
465
465
  model_types = [[0, 1]] # add 2 for Generalized Poisson
466
- model_types = [[0]]
466
+ #model_types = [[0]]
467
467
  #TODO change back and fix NB
468
468
  model_t_dict = {'Poisson':0,
469
469
  "NB":1}
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: metacountregressor
3
- Version: 0.1.156
3
+ Version: 0.1.159
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