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

PyAF 5.0 Final Touch 2: Disable alpha in ridge regressions #231

Closed
antoinecarme opened this issue Mar 18, 2023 · 3 comments
Closed

PyAF 5.0 Final Touch 2: Disable alpha in ridge regressions #231

antoinecarme opened this issue Mar 18, 2023 · 3 comments

Comments

@antoinecarme
Copy link
Owner

antoinecarme commented Mar 18, 2023

To improve explainability, it is better to perform a real linear regression when estimating linear trends, polynomial and AR models.

PyAF uses sklearn.linear_model.Ridge model which uses a ridge parameter alpha = 1.0 by default which produces a non-zero residue mean error. Force alpha to be zero. This improves the detected cycles which are based on trend residues.

https://scikit-learn.org/stable/modules/generated/sklearn.linear_model.Ridge.html

image

The impact on the model equation is not always noticeable. Exact models are improved (when the signal is an almost linear trend).

@antoinecarme
Copy link
Owner Author

Polynomial trend, before

image

@antoinecarme
Copy link
Owner Author

Polynomial trend, after

image

@antoinecarme
Copy link
Owner Author

The use of alpha=1 is a default setting of scikit-learn and was not intended by PyAF specs. This default choice is OK for classification/regression models.

The same kind of checks needs to be performed for Xgboost, LightGBM , PyTorch and other third party modeling software used in PyAF models. The default parameter choices need to be double-checked.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant