No project description provided
Project description
kolesky
Python code for the paper Sparse Cholesky Factorization by Kullback-Leibler Minimization
Gaussian process (GP) regression can be approximated in two ways: a faster prediction points first and a more accurate prediction points last. Both methods accept the same hyperparameters: rho, lambda, and p for tuning accuracy. In general, the main parameter to tune is rho and accuracy will increase as rho increases until we reach the exact GP regression.
We will start by generating a synthetic dataset. The true equation is $f(x) = x\sin(x)$
import numpy as np
x_train = np.random.uniform(-5, 5, 15).reshape(-1, 1)
x_test = np.linspace(-5, 5, 50).reshape(-1, 1)
y_train = x_train * np.sin(x_train)
To fit a Gaussian process on this data, we choose to use an RBF kernel function for our covariance. We also choose rho = 10, lambda = 1.5, and p = 1.
import kolesky.gp_regresssion as kgp
import sklearn.gaussian_process.kernels as kernels
kernel = kernels.RBF(length_scale=1.0)
mu, var = gp.estimate(x_train, y_train.flatten(), x_test, kernel, 10.0, 1.5, p=1)
After fitting our model, we can create the following plot:
import matplotlib.pyplot as plt
plt.figure(figsize=(10, 5))
plt.plot(x_train[:, 0], y_train.flatten(), 'ro', label='Training Data')
plt.plot(x_test[:, 0], mu, 'b-', label='Predicted Mean')
plt.plot(x_test[:, 0], x_test[:, 0] * np.sin(x_test[:, 0]), 'g--', label='Unnoisy Function')
plt.fill_between(x_test[:, 0], mu - 1.96 * np.sqrt(var), mu + 1.96 * np.sqrt(var), color='lightblue', alpha=0.5, label='95% Confidence Interval')
plt.title('Gaussian Process Regression with Sparse Cholesky')
plt.xlabel('Input')
plt.ylabel('Output')
plt.legend()
plt.show()
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file kolesky-0.1.4a1.tar.gz.
File metadata
- Download URL: kolesky-0.1.4a1.tar.gz
- Upload date:
- Size: 856.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
df7acce3cc5e3020a193056728d581584dc33c1a4f0b6c4cbc44ba3863f9a2db
|
|
| MD5 |
9d7bc1381e27dd613d104d22b2a0e609
|
|
| BLAKE2b-256 |
a86fdfc3d4fabecdf97e0d974731f84da303dd30278ea8adccb92d8c26457cfe
|
Provenance
The following attestation bundles were made for kolesky-0.1.4a1.tar.gz:
Publisher:
build-wheels.yml on raymond-zeng/kolesky
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
kolesky-0.1.4a1.tar.gz -
Subject digest:
df7acce3cc5e3020a193056728d581584dc33c1a4f0b6c4cbc44ba3863f9a2db - Sigstore transparency entry: 1250810362
- Sigstore integration time:
-
Permalink:
raymond-zeng/kolesky@2ee85b75c014624cc5d7f3a7099ce5a74655375f -
Branch / Tag:
refs/tags/v0.1.4a5 - Owner: https://github.com/raymond-zeng
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
build-wheels.yml@2ee85b75c014624cc5d7f3a7099ce5a74655375f -
Trigger Event:
push
-
Statement type:
File details
Details for the file kolesky-0.1.4a1-cp313-cp313-manylinux_2_28_x86_64.whl.
File metadata
- Download URL: kolesky-0.1.4a1-cp313-cp313-manylinux_2_28_x86_64.whl
- Upload date:
- Size: 3.7 MB
- Tags: CPython 3.13, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
12e0c519702a4eb36923e5fe9c841ead4e0c7dc04b1b5e84e5364b941b79b5ec
|
|
| MD5 |
381ae3b6b55b91ff1ab3ee0e81a6daeb
|
|
| BLAKE2b-256 |
9621e0ca01a83349677ca87da83d0be008a3f37097297ddd17af2f8dbb4fb717
|
Provenance
The following attestation bundles were made for kolesky-0.1.4a1-cp313-cp313-manylinux_2_28_x86_64.whl:
Publisher:
build-wheels.yml on raymond-zeng/kolesky
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
kolesky-0.1.4a1-cp313-cp313-manylinux_2_28_x86_64.whl -
Subject digest:
12e0c519702a4eb36923e5fe9c841ead4e0c7dc04b1b5e84e5364b941b79b5ec - Sigstore transparency entry: 1250810374
- Sigstore integration time:
-
Permalink:
raymond-zeng/kolesky@2ee85b75c014624cc5d7f3a7099ce5a74655375f -
Branch / Tag:
refs/tags/v0.1.4a5 - Owner: https://github.com/raymond-zeng
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
build-wheels.yml@2ee85b75c014624cc5d7f3a7099ce5a74655375f -
Trigger Event:
push
-
Statement type:
File details
Details for the file kolesky-0.1.4a1-cp312-cp312-manylinux_2_28_x86_64.whl.
File metadata
- Download URL: kolesky-0.1.4a1-cp312-cp312-manylinux_2_28_x86_64.whl
- Upload date:
- Size: 3.7 MB
- Tags: CPython 3.12, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fda31b1e3ae098668671e329a94fadd7a8326b0e7b881f9661849ddf2280519f
|
|
| MD5 |
3ad87ab45781e4c811a9d58db7bf5709
|
|
| BLAKE2b-256 |
f3c7cde67c06f76358037930b23212476a283c6520765a019ae10f5b5eac1b53
|
Provenance
The following attestation bundles were made for kolesky-0.1.4a1-cp312-cp312-manylinux_2_28_x86_64.whl:
Publisher:
build-wheels.yml on raymond-zeng/kolesky
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
kolesky-0.1.4a1-cp312-cp312-manylinux_2_28_x86_64.whl -
Subject digest:
fda31b1e3ae098668671e329a94fadd7a8326b0e7b881f9661849ddf2280519f - Sigstore transparency entry: 1250810369
- Sigstore integration time:
-
Permalink:
raymond-zeng/kolesky@2ee85b75c014624cc5d7f3a7099ce5a74655375f -
Branch / Tag:
refs/tags/v0.1.4a5 - Owner: https://github.com/raymond-zeng
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
build-wheels.yml@2ee85b75c014624cc5d7f3a7099ce5a74655375f -
Trigger Event:
push
-
Statement type:
File details
Details for the file kolesky-0.1.4a1-cp311-cp311-manylinux_2_28_x86_64.whl.
File metadata
- Download URL: kolesky-0.1.4a1-cp311-cp311-manylinux_2_28_x86_64.whl
- Upload date:
- Size: 3.8 MB
- Tags: CPython 3.11, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b44d077af40fed391ef0dd620d2bd20e2f7d8aab123dcba7bf31e84b1a7ff245
|
|
| MD5 |
9065aef0df53af9306d7854cad0ba5c5
|
|
| BLAKE2b-256 |
9ea8cc5c3fbb0ba7712003393a71871055aee6068101548fcd053743a2c38e70
|
Provenance
The following attestation bundles were made for kolesky-0.1.4a1-cp311-cp311-manylinux_2_28_x86_64.whl:
Publisher:
build-wheels.yml on raymond-zeng/kolesky
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
kolesky-0.1.4a1-cp311-cp311-manylinux_2_28_x86_64.whl -
Subject digest:
b44d077af40fed391ef0dd620d2bd20e2f7d8aab123dcba7bf31e84b1a7ff245 - Sigstore transparency entry: 1250810371
- Sigstore integration time:
-
Permalink:
raymond-zeng/kolesky@2ee85b75c014624cc5d7f3a7099ce5a74655375f -
Branch / Tag:
refs/tags/v0.1.4a5 - Owner: https://github.com/raymond-zeng
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
build-wheels.yml@2ee85b75c014624cc5d7f3a7099ce5a74655375f -
Trigger Event:
push
-
Statement type:
File details
Details for the file kolesky-0.1.4a1-cp310-cp310-manylinux_2_28_x86_64.whl.
File metadata
- Download URL: kolesky-0.1.4a1-cp310-cp310-manylinux_2_28_x86_64.whl
- Upload date:
- Size: 3.6 MB
- Tags: CPython 3.10, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7c38e201ae4aa7d9f54fde4da85c3f0b4d432f81d823cb361a11ca7db4f486e9
|
|
| MD5 |
88677bb0954477c4df06272e5b40efc4
|
|
| BLAKE2b-256 |
06a5e2ffb2ffe6ad9a5add189aeb50ae4d5f1098ca7958485854f6dbbf961404
|
Provenance
The following attestation bundles were made for kolesky-0.1.4a1-cp310-cp310-manylinux_2_28_x86_64.whl:
Publisher:
build-wheels.yml on raymond-zeng/kolesky
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
kolesky-0.1.4a1-cp310-cp310-manylinux_2_28_x86_64.whl -
Subject digest:
7c38e201ae4aa7d9f54fde4da85c3f0b4d432f81d823cb361a11ca7db4f486e9 - Sigstore transparency entry: 1250810364
- Sigstore integration time:
-
Permalink:
raymond-zeng/kolesky@2ee85b75c014624cc5d7f3a7099ce5a74655375f -
Branch / Tag:
refs/tags/v0.1.4a5 - Owner: https://github.com/raymond-zeng
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
build-wheels.yml@2ee85b75c014624cc5d7f3a7099ce5a74655375f -
Trigger Event:
push
-
Statement type: