Skip to main content

GPNAM - an interpretable Gaussian Process NAM model.

Project description

GPNAM: Gaussian Process Neural Additive Models

The framework of GPNAM The framework of GPNAM. $z_s, c_s$ and the sinusoidal function are predefined from the paper and do not require training. The only trainable parameter is W that maps to the output of each shape function.

This repository contains the source code for the paper Gaussian Process Neural Additive Models that appears at AAAI 2024.

Basically, the GPNAM constructs a Neural Additive Model (NAM) by a GP with Random Fourier Features as the shape function for each input feature, which leads to a convex optimization with a significant reduction in trainable parameters.

Sklearn interface

You can install the package by:

pip install gpnam

Then, you can run the model simply by:

from gpnam.sklearn import GPNAM

"""
input_dim: the dimensions of input data
problem: type of the model, 'classification' or 'regression'
"""
gpnam = GPNAM(input_dim, problem)
gpnam.fit(X, y)

y_pred = gpnam.predict(X_test)

Build on your own

Data sets preparation

You can download the data sets locally:

python ./gpnam/download_datasets.py LCD GMSC CAHousing

Setup

Experiments

Then, you can run the experiment:

python main.py --dataset LCD --optimizer Adam --n_epochs 200

Matlab

Note: Statistics and Machine Learning Toolbox is required.

Citation

If you find this repo useful, please consider citing our paper:

@inproceedings{,
  title={Gaussian Process Neural Additive Models},
  author={Wei Zhang and Brian Barr and John Paisley},
  booktitle={AAAI Conference on Artificial Intelligence},
  year={2024}
}

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

gpnam-0.0.19.tar.gz (10.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gpnam-0.0.19-py3-none-any.whl (11.5 kB view details)

Uploaded Python 3

File details

Details for the file gpnam-0.0.19.tar.gz.

File metadata

  • Download URL: gpnam-0.0.19.tar.gz
  • Upload date:
  • Size: 10.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.7.0

File hashes

Hashes for gpnam-0.0.19.tar.gz
Algorithm Hash digest
SHA256 8f33e1906bacb901a965d5c9f4af3d97f2f1cf2d64f4704a78425f40fccb7c6e
MD5 00089a484312bdc2b8e2b7b1fb645f27
BLAKE2b-256 7fab723ffec5389dc9fa321a32a9e215c5c12aa45c92781c0dc7f081490a1e8a

See more details on using hashes here.

File details

Details for the file gpnam-0.0.19-py3-none-any.whl.

File metadata

  • Download URL: gpnam-0.0.19-py3-none-any.whl
  • Upload date:
  • Size: 11.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.7.0

File hashes

Hashes for gpnam-0.0.19-py3-none-any.whl
Algorithm Hash digest
SHA256 caedc080241e1d5dd084ab718985b8d6982b8d4de07f03c8cdd976572f8755a4
MD5 e3d68bec0fdcd63c912de085f4742843
BLAKE2b-256 b1a8de41a51d08c9676ba3388f38caeae08f0fcedab983daefac4755801d68ea

See more details on using hashes here.

Supported by

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