dflemin3 / approxposterior

A Python package for approximate Bayesian inference and optimization using Gaussian processes
https://dflemin3.github.io/approxposterior/
MIT License
41 stars 9 forks source link

Cross-Validation to select GP hyperparameters #41

Closed dflemin3 closed 5 years ago

dflemin3 commented 5 years ago

Currently, approxposterior selects GP hyperparameters by optimizing the marginal loglikelihood. This can potentially lead to overfitting, so I should implemented the ability for users to use K-fold cross validation to optimize GP hyperparameters. This can get tricky as the dimensionality grows, however, so care should be taken when determined why hyperparameters to try during the cross-validation.

dflemin3 commented 5 years ago

Implemented on the dev branch. The user can now set a new parameter, gpCV, to any integer number to perform gpCV-fold cross-validation to select the best GP hyperparameters. In this case, we pick the GP hyperparameters, from the list of maximum likelihood solutions, that produces the lowest mean squared error during cross-validation.