Gibbs Reconstruction for linear data reconstruction
Project description
Gibbs Reconstructor
The GibbsReconstructor is a Python class designed to perform reconstruction of missing values in partially deleted signals, images, or sequences. It uses a regularized approach based on Gibbs sampling methods to estimate missing entries, making it ideal for scenarios where data might be incomplete or corrupted. This approach is particularly useful for tasks such as image inpainting, signal reconstruction, and sequence completion.
Features
- Reconstruction of Missing Data: Fills in missing values (NaNs) in partially observed data matrices.
- Gibbs Sampling: Uses an exact Gibbs sampling approach to estimate missing values based on the observed data.
- Ridge Regularization: Supports ridge regularization to avoid overfitting during reconstruction.
- Flexible Application: Can be used for signals, sequences, images, or any dataset where partial data is available.
Use Cases
- Signal Completion: Recover deleted or corrupted sections of time-series signals.
- Image Inpainting: Fill in missing pixels in images, making it useful for tasks like repairing damaged images or handling incomplete image data.
- Sequence Reconstruction: Complete sequences with missing or corrupted values, useful for various predictive modeling tasks in data science.
How It Works
- Model Fitting: The
fit()method takes in a complete dataset and learns the underlying relationships between the features using a regularized least squares approach. - Prediction: The
predict()method takes in data with missing values (represented asNaNs) and reconstructs those missing entries by leveraging the learned relationships. This method uses Gibbs sampling technique to estimate the missing values.
Attributes
alpha: A regularization parameter used for controlling the strength of ridge regression. It helps prevent overfitting during the reconstruction process.
Methods
-
fit(X): Fits the GibbsReconstructor model on the given datasetX. The matrixXshould be fully observed (i.e., no missing values) and is used to learn the underlying structure of the data. -
predict(z): Predicts the missing values in the input arrayz. The missing values should be represented asNaN, and the method will return the input array with the missing values reconstructed.
Installation
To use GibbsReconstructor, ensure you have the required dependencies installed:
pip install numpy tqdm
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 Distribution
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 gibbs_reconstructor-1.2.3.tar.gz.
File metadata
- Download URL: gibbs_reconstructor-1.2.3.tar.gz
- Upload date:
- Size: 4.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
66844792a3388ad01fdf928b8050d065cb2941e02781f7d15ab787bbdb6020d2
|
|
| MD5 |
bf14593b63d7c16096a7c5e687484c65
|
|
| BLAKE2b-256 |
e29d41835523dea2e1e555d984c9920283e1c578ad51c9950111a1a2f7a4d455
|
File details
Details for the file gibbs_reconstructor-1.2.3-py3-none-any.whl.
File metadata
- Download URL: gibbs_reconstructor-1.2.3-py3-none-any.whl
- Upload date:
- Size: 5.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
601d88bdc42e309c38b7f3065b506a70548d34f206ba19721e6759c8d527ae5e
|
|
| MD5 |
3d8d6136b13c6e3d49b167caded92d30
|
|
| BLAKE2b-256 |
e4b4c525e70d9b7b74f4a4073d10848dfbb6a9fefac69d9d1d6aa6c73f37b63f
|