metacountregressor 0.1.158__py3-none-any.whl → 0.1.159__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.
- metacountregressor/main.py +14 -5
- metacountregressor/solution.py +1 -1
- {metacountregressor-0.1.158.dist-info → metacountregressor-0.1.159.dist-info}/METADATA +1 -1
- {metacountregressor-0.1.158.dist-info → metacountregressor-0.1.159.dist-info}/RECORD +7 -7
- {metacountregressor-0.1.158.dist-info → metacountregressor-0.1.159.dist-info}/LICENSE.txt +0 -0
- {metacountregressor-0.1.158.dist-info → metacountregressor-0.1.159.dist-info}/WHEEL +0 -0
- {metacountregressor-0.1.158.dist-info → metacountregressor-0.1.159.dist-info}/top_level.txt +0 -0
metacountregressor/main.py
CHANGED
|
@@ -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 =
|
|
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')
|
metacountregressor/solution.py
CHANGED
|
@@ -4,17 +4,17 @@ metacountregressor/app_main.py,sha256=vY3GczTbGbBRalbzMkl_9jVW7RMgEOc6z2Dr1IZJv9
|
|
|
4
4
|
metacountregressor/data_split_helper.py,sha256=M2fIMdIO8znUaYhx5wlacRyNWdQjNYu1z1wkE-kFUYU,3373
|
|
5
5
|
metacountregressor/halton.py,sha256=jhovA45UBoZYU9g-hl6Lb2sBIx_ZBTNdPrpgkzR9fng,9463
|
|
6
6
|
metacountregressor/helperprocess.py,sha256=i2PkglSxBVZS-FhytCFOnIr50CdiMNe32DiIirxHMDo,21739
|
|
7
|
-
metacountregressor/main.py,sha256=
|
|
7
|
+
metacountregressor/main.py,sha256=xfpKN2w0kePHp_Q2HOPjtG15PLEN1L3sEnDw1PHBquw,23668
|
|
8
8
|
metacountregressor/main_old.py,sha256=eTS4ygq27MnU-dZ_j983Ucb-D5XfbVF8OJQK2hVVLZc,24123
|
|
9
9
|
metacountregressor/metaheuristics.py,sha256=1Tm_BS8HxumEo9fteIwTTkfiJXbfH6wlfSmY0tSt77A,106289
|
|
10
10
|
metacountregressor/pareto_file.py,sha256=whySaoPAUWYjyI8zo0hwAOa3rFk6SIUlHSpqZiLur0k,23096
|
|
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=
|
|
14
|
+
metacountregressor/solution.py,sha256=dP5m2i1wfcu4zGYPIfPzjfXbdnYSDhf05wlJCzvUmPw,278597
|
|
15
15
|
metacountregressor/test_generated_paper2.py,sha256=pwOoRzl1jJIIOUAAvbkT6HmmTQ81mwpsshn9SLdKOg8,3927
|
|
16
|
-
metacountregressor-0.1.
|
|
17
|
-
metacountregressor-0.1.
|
|
18
|
-
metacountregressor-0.1.
|
|
19
|
-
metacountregressor-0.1.
|
|
20
|
-
metacountregressor-0.1.
|
|
16
|
+
metacountregressor-0.1.159.dist-info/LICENSE.txt,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
|
|
17
|
+
metacountregressor-0.1.159.dist-info/METADATA,sha256=-Gt8oA5p_mqRSFF8DP_u_wtSoyaUIgzPpqQYdAje_mA,23434
|
|
18
|
+
metacountregressor-0.1.159.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
|
19
|
+
metacountregressor-0.1.159.dist-info/top_level.txt,sha256=zGG7UC5WIpr76gsFUpwJ4En2aCcoNTONBaS3OewwjR0,19
|
|
20
|
+
metacountregressor-0.1.159.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|