Skip to main content

Basic implementation with GPy of an Automatic Bayesian Covariance Discovery (ABCD) system

Project description

Latest PyPI version Python Versions License

Basic implementation with GPy of an Automatic Bayesian Covariance Discovery (ABCD) system

(as in Lloyd, James Robert; Duvenaud, David Kristjanson; Grosse, Roger Baker; Tenenbaum, Joshua B.; Ghahramani, Zoubin (2014): Automatic construction and natural-language description of nonparametric regression models. In: National Conference on Artificial Intelligence, 7/27/2014, pp. 1242-1250. Available online at https://academic.microsoft.com/paper/1950803081.)

Usage

import GPy_ABCD

best_mods, all_mods, all_exprs = GPy_ABCD.find_best_model(X, Y,
    start_kernels = standard_start_kernels, p_rules = production_rules_all,
    restarts = 5, utility_function = 'BIC', rounds = 2, buffer = 4,
    verbose = False, parallel = True)


# Typical output printout

for mod_depth in all_mods: print(', '.join([str(mod.kernel_expression) for mod in mod_depth]) + f'\n{len(mod_depth)}')

from matplotlib import pyplot as plt
for bm in best_mods:
    print(bm.kernel_expression)
    print(bm.model.kern)
    print(bm.model.log_likelihood())
    print(bm.cached_utility_function)
    bm.model.plot()
    print(bm.interpret())

predict_X = np.linspace(FROM, TO, BY)[:, None]
preds = best_mods[0].predict(predict_X)
print(preds)

plt.show()

Note: if the parallel argument is True then the function should be called from within a if __name__ == '__main__':

Installation

pip install gpy_abcd

Requirements

Python 3.7

See requirements.txt

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

GPy-ABCD-0.1.3.tar.gz (33.5 kB view hashes)

Uploaded Source

Built Distribution

GPy_ABCD-0.1.3-py3-none-any.whl (44.5 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page