Skip to content

Conversation

prasankh
Copy link
Member

@prasankh prasankh commented Nov 8, 2024

ODSC-63260
Improved auto-select robustness by selecting the best among successful models.

@oracle-contributor-agreement oracle-contributor-agreement bot added the OCA Verified All contributors have signed the Oracle Contributor Agreement. label Nov 8, 2024
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 good! Couple quick questions

except:
from sklearn.metrics import r2_score

from scipy.stats import linregress
Copy link
Member

Choose a reason for hiding this comment

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

Is scipy in the pyproject.toml?

Copy link
Member Author

Choose a reason for hiding this comment

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

Not explicitly, statsmodels is there and it is dependent on scipy.

nonempty_metrics = {model: metric for model, metric in metrics.items() if metric != {}}
avg_backtests_metric = {model: sum(value.values()) / len(value.values())
for model, value in nonempty_metrics.items()}
best_model = min(avg_backtests_metric, key=avg_backtests_metric.get)
Copy link
Member

Choose a reason for hiding this comment

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

What if the metric is set to accuracy "r-squared"? Do we prevent this?

Copy link
Member Author

Choose a reason for hiding this comment

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

The r-squared metric is not present in forecast/schema.yaml file as an allowed optimization metric, so it is not used for selecting the best model. Although it gets calculated when test data is provided only for reporting purpose.

@ahosler ahosler merged commit b15138c into main Nov 11, 2024
10 checks passed
@ahosler ahosler deleted the fix/ODSC-63260 branch November 11, 2024 12:38
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.

3 participants