Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add new Path solution to ESCWA model #23

Open
wants to merge 17 commits into
base: production
Choose a base branch
from
Open

Conversation

sarakallis
Copy link
Collaborator

@sarakallis sarakallis commented Apr 12, 2024

Adapted src of model training, forecasting and evaluation for the new machine-agnostic path solution using common_utils/set_paths

IMPORTANT:

I configured common_utils/set_paths:
@xiaolong0728 In your generate_forecast.py script you'll have to change PATH_RAW, _, PATH_GENERATED = setup_data_paths(PATH) to PATH_MODEL, PATH_RAW, PATH_PROCESSED, PATH_GENERATED = setup_data_paths(PATH) since I added PATH_MODEL to the output of the function

If you agree with this, please merge the PR.
I'll be tackling refactoring the data partitions next.

@sarakallis sarakallis requested a review from xiaolong0728 April 12, 2024 15:36
@xiaolong0728
Copy link
Collaborator

xiaolong0728 commented Apr 15, 2024

This is great. Just some little ideas:

  1. Do we need to save the forecasts of calibration? I can't come up with a situation where we interpret that.
  2. The date in future_point_predict is hardcoded now. We can keep it for now but note down changing it in the future

Thanks to @xiaolong0728 for pointing out
@sarakallis
Copy link
Collaborator Author

@xiaolong0728 Not sure about 1, but imo doesn't hurt to keep it in, especially since we don't push them to git.
Changed the code for 2, thanks for pointing out!

@xiaolong0728
Copy link
Collaborator

I think Simon and Noorain should be notified since this change also affects their scripts. Here I only see myself as the reviewer.

@sarakallis
Copy link
Collaborator Author

FYI @Polichinel and @noorains

@sarakallis sarakallis requested a review from Polichinel May 24, 2024 11:41
@sarakallis sarakallis mentioned this pull request Jun 10, 2024
Copy link
Collaborator

@Polichinel Polichinel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In short, you should just merge from main as soon as I have merged the last purple_alien. Which, if no new bugs show up, will be Thursday the 13th early in the morning.

This will allow you to either get the model_path from a dedicated function or go directly to the setup_artifacts_path.

Once that is fixed we'll merge

PATH_GENERATED = PATH_DATA / "generated"

return PATH_RAW, PATH_PROCCEDS, PATH_GENERATED
return PATH_MODEL, PATH_RAW, PATH_PROCESSED, PATH_GENERATED
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have kept this as purely a data path thing. The PATH_MODEL can be defined using setup_model_paths().
But I think the way it is used below you might be better off just using setup_artifacts_path()

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, I'll push the latest changes to main tomorrow. Just running sweep to see that everything is as it should be after incorporating your last comments. After that you should merge from main to this

models/electric_relaxation/configs/config_model.py Outdated Show resolved Hide resolved
@@ -34,7 +37,10 @@ def evaluate_model(model_config):
"""
print("Evaluating...")

df_calib = pd.read_parquet(model_path/"data"/"generated"/"calibration_predictions.parquet")
PATH_MODEL, PATH_RAW, PATH_PROCESSED, PATH_GENERATED = setup_data_paths(PATH)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

with the new implementation, you should not get PATH_MODEL from here. You can get it from setup_model_path but given the use below I think you should just use setup_artifacts_path

@@ -61,7 +67,7 @@ def evaluate_model(model_config):
[row[col] for col in pred_cols]), axis=1)
mean_brier_score = df_calib["brier_score"].mean()

metrics_dict_path = model_path / "artifacts" / "evaluation_metrics.py"
metrics_dict_path = PATH_MODEL / "artifacts" / "evaluation_metrics.py"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

then you can also simplify this a bit

@sarakallis sarakallis added the improvement Refactoring, improving existing codebase label Jun 18, 2024
PATH_GENERATED = PATH_DATA / "generated"

return PATH_RAW, PATH_PROCCEDS, PATH_GENERATED # added in accordance with Sara's escwa branch
return PATH_RAW, PATH_PROCESSED, PATH_GENERATED # added in accordance with Sara's escwa branch
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed a typo FYI @Polichinel

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improvement Refactoring, improving existing codebase
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants