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

Added boolean disables, generation of train (metrics.csv) and test metrics (test_metrics.csv) #397

Conversation

@govarsha govarsha self-assigned this Oct 30, 2023
@oracle-contributor-agreement oracle-contributor-agreement bot added the OCA Verified All contributors have signed the Oracle Contributor Agreement. label Oct 30, 2023
@github-actions
Copy link

⚠️ This PR changed pyproject.toml file. ⚠️

  • PR Creator must update 📃 THIRD_PARTY_LICENSES.txt, if any 📚 library added/removed in pyproject.toml.
  • PR Approver must confirm 📃 THIRD_PARTY_LICENSES.txt updated, if any 📚 library added/removed in pyproject.toml.

@govarsha govarsha changed the base branch from main to feature/forecasting October 30, 2023 10:47
@github-actions
Copy link

📌 Cov diff with main:

No success to gather report. 😿

📌 Overall coverage:

No success to gather report. 😿

@github-actions
Copy link

📌 Cov diff with main:

Coverage-2%

📌 Overall coverage:

Coverage-28.61%



class ArimaOperatorModel(ForecastOperatorBaseModel):
"""Class representing ARIMA operator model."""

def __init__(self, config: ForecastOperatorConfig):
super().__init__(config)
self.train_metrics = False
Copy link
Member

Choose a reason for hiding this comment

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

If the all models require these extra attributes, maybe we can add them to the base model class?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

These values were defined for each model inside _generate_report method. I have abstracted them out as attributes because I needed them outside of that method.
The train_metrics value is True/False according to the model so I am not sure if we can define them in base_model. cc: @ahosler

Copy link
Member

Choose a reason for hiding this comment

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

One thing you could do is add self.train_metrics = False to the base class, and then update it to True only in prophet and neuralprophet so that if we add model classes in the future train_metrics is disabled by default.

self.preprocessing = (
self.preprocessing if self.preprocessing is not None else True
)
self.explain = self.explain if self.explain is not None else False
self.generate_report = (
Copy link
Member

Choose a reason for hiding this comment

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

Not sure, that I understand this logic.

self.generate_report if self.generate_report is not None else True

Do we want to make True as default option for case when user didn't specify the value?
Could you add please a short comment there in this case.

Copy link
Contributor Author

@govarsha govarsha Oct 30, 2023

Choose a reason for hiding this comment

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

Yes we want the default to be True when user doesn't specify anything. I have added the comments.

@@ -168,7 +168,7 @@ spec:
type: dict
type: dict

report_file_name:
report_filename:
Copy link
Member

Choose a reason for hiding this comment

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

We need to be cautious with making such changes, if somebody uses old config, then they would start getting some errors. However the change looks good to me :)
cc: @ahosler

Copy link
Member

Choose a reason for hiding this comment

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

Yes! Varsha is using this ticket to go through and clean up all the names for GA. After we merge with main, we will not be changing without backward compatibility. Any other inconsistencies you notice please flag now! Thanks

self.generate_report = (
self.generate_report if self.generate_report is not None else True
)
self.generate_metrics = (
Copy link
Member

Choose a reason for hiding this comment

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

The both generate_report and generate_metrics need to be added to a schema?

Copy link
Contributor Author

@govarsha govarsha Oct 30, 2023

Choose a reason for hiding this comment

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

Yeah, they should be added. I made the changes.

Copy link
Member

@ahosler ahosler left a comment

Choose a reason for hiding this comment

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

This looks great! Ran the operator across several benchmark datasets to confirm. Thanks!

type: string
default: forecast.csv
meta:
description: "Placed into output_directory location. Defaults to forecast.csv"
Copy link
Member

Choose a reason for hiding this comment

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

This is a great idea! Thank you!



class ArimaOperatorModel(ForecastOperatorBaseModel):
"""Class representing ARIMA operator model."""

def __init__(self, config: ForecastOperatorConfig):
super().__init__(config)
self.train_metrics = False
Copy link
Member

Choose a reason for hiding this comment

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

One thing you could do is add self.train_metrics = False to the base class, and then update it to True only in prophet and neuralprophet so that if we add model classes in the future train_metrics is disabled by default.

@github-actions
Copy link

📌 Cov diff with main:

Coverage-2%

📌 Overall coverage:

No success to gather report. 😿

@github-actions
Copy link

📌 Cov diff with main:

No success to gather report. 😿

📌 Overall coverage:

No success to gather report. 😿

@github-actions
Copy link

📌 Cov diff with main:

Coverage-2%

📌 Overall coverage:

Coverage-28.58%

Copy link
Member

@ahosler ahosler left a comment

Choose a reason for hiding this comment

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

Looks great!

@ahosler ahosler merged commit 223f9c0 into feature/forecasting Nov 1, 2023
7 of 11 checks passed
Copy link

github-actions bot commented Nov 1, 2023

📌 Cov diff with main:

Coverage-2%

📌 Overall coverage:

Coverage-28.55%

@ahosler ahosler deleted the feature/add-boolean-disables-and-save-train-test-metrics-as-csvs branch March 18, 2024 15:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OCA Verified All contributors have signed the Oracle Contributor Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants