fix(Reporting): identify primary models correctly with the new column names

This commit is contained in:
Mark Aron Szulyovszky
2022-01-11 19:44:01 +01:00
parent 55f083638f
commit 5db2a3b935
2 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -110,7 +110,7 @@ def get_lightweight_ensemble_config() -> tuple[dict, dict, dict]:
forecasting_horizon = 1,
own_features = ['level_2' ],
other_features = ['level_2'],
exogenous_features = ['standard_scaling'],
exogenous_features = ['z_score'],
index_column= 'int',
method= 'classification',
no_of_classes= 'two',
+2 -2
View File
@@ -5,7 +5,7 @@ from utils.helpers import weighted_average
def report_results(results:pd.DataFrame, all_predictions:pd.DataFrame, model_config:dict, wandb, sweep: bool, project_name:str):
primary_results = results[[column for column in results.columns if 'primary' in column]]
primary_results = results[[column for column in results.columns if 'ensemble' not in column]]
ensemble_results = results[[column for column in results.columns if 'ensemble' in column]]
# Only send the results of the final model to wandb
@@ -13,7 +13,7 @@ def report_results(results:pd.DataFrame, all_predictions:pd.DataFrame, model_con
send_report_to_wandb(results_to_send, wandb, project_name, get_model_name(model_config))
results.to_csv('output/results.csv')
primary_weights = all_predictions[[column for column in all_predictions.columns if 'primary' in column]]
primary_weights = all_predictions[[column for column in all_predictions.columns if 'ensemble' not in column]]
ensemble_weights = all_predictions[[column for column in all_predictions.columns if 'ensemble' in column]]
predictions_to_save = ensemble_weights if ensemble_weights.shape[1] > 0 else primary_weights
predictions_to_save.to_csv('output/predictions.csv')