Closed antoinecarme closed 1 year ago
Polynomial trend, before
Polynomial trend, after
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.
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
The impact on the model equation is not always noticeable. Exact models are improved (when the signal is an almost linear trend).