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
Release files for gibbs-reconstructor 1.2.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| gibbs_reconstructor-1.2.3.tar.gz | 4.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| gibbs_reconstructor-1.2.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 9.2 kB
Release files / gibbs_reconstructor-1.2.3.tar.gz
| Download URL | gibbs_reconstructor-1.2.3.tar.gz |
|---|---|
| Size | 4.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
66844792a3388ad01fdf928b8050d065cb2941e02781f7d15ab787bbdb6020d2
|
|
BLAKE2b-256 checksum How to use checksums |
e29d41835523dea2e1e555d984c9920283e1c578ad51c9950111a1a2f7a4d455
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.12.4
|
Release files / gibbs_reconstructor-1.2.3-py3-none-any.whl
| Download URL | gibbs_reconstructor-1.2.3-py3-none-any.whl |
|---|---|
| Size | 5.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
601d88bdc42e309c38b7f3065b506a70548d34f206ba19721e6759c8d527ae5e
|
|
BLAKE2b-256 checksum How to use checksums |
e4b4c525e70d9b7b74f4a4073d10848dfbb6a9fefac69d9d1d6aa6c73f37b63f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.12.4
|