Repository navigation
Replace pyGAM with TweedieRegressor in MachineLearningSetup - #329
Merged
RHammond2 merged 13 commits intoOct 30, 2026
Merged
Conversation
Collaborator
Author
|
Placing this on hold until the root of the wake loss discrepancies can be resolved. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR replaces the pyGAM
GAMusage inMachineLearningSetupwith scikit-learn'sTweedieRegressorto account for pyGAM's incompatibility with the scikit-learn ML pipeline tools. Because the TweedieRegressor does not perform well on the power curve generation workflow, pyGAM will continue to be used in that context where there is no scikit-learn infrastructure.To account for the performance differences, the TweedieRegressor's default hyperparameter settings are configured to sample from multiple distributions, learning rates, and use a higher
max_iterto converge on a better solution. To further account for the fact that Gamma distributions cannot handle non-positive values, theMonteCarloAEPmanually overrides the hyper parameter distribution setting when negative values are detected in the filtered energy generation column.It was also found that the
n_splinesinput toGAMwas no longer creating different fits asn_splinesnow must be defined on a per-term basis, not a general model input.On the whole these changes have a minor impact on the AEP results, but allow for newer versions of scikit-learn to be installed that are no longer set at a maximum Python of 3.13.