semvec/pypi-packages huggingface dataset:
gibbs-reconstructor 1.2.3
Gibbs Reconstruction for linear data reconstruction
Requires Python: >=3.8

# 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

1. **Model Fitting**: The `fit()` method takes in a complete dataset and learns the underlying relationships between the features using a regularized least squares approach.
2. **Prediction**: The `predict()` method takes in data with missing values (represented as `NaN`s) 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 dataset `X`. The matrix `X` should 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 array `z`. The missing values should be represented as `NaN`, and the method will return the input array with the missing values reconstructed.

## Installation

To use `GibbsReconstructor`, ensure you have the required dependencies installed:

```bash
pip install numpy tqdm
safemx 0.1.7
A tool to check domain's SPF, DMARC, and DKIM records.
Requires Python: >=3.6

![Usage Example](/assets/banner.png)

---

![Python](https://img.shields.io/badge/python-3.x-blue)
![License](https://img.shields.io/badge/license-MIT-green)

SafeMX is your **first line of defense** against email spoofing and phishing attacks. Effortlessly check your domain's **SPF**, **DKIM**, and **DMARC** records to ensure your emails are authenticated and secure.

![Usage Example](/assets/example.png)

## Features

- 🛡 **SPF**, **DKIM**, and **DMARC** record validation
- ⚡ Fast, reliable, and easy to use
- 🌐 **JSON** and **console** output formats for flexibility
- 🚀 Cool modern design with easy setup and execution

## 🚀 Getting Started

Follow these simple steps to install and use **SafeMX**:

### Prerequisites
- Python 3.x
- `pip` package manager

### Installation

1. Clone the repository:
    ```bash
    git clone https://github.com/MarkoGordic/SafeMX.git
    ```

2. Navigate to the project directory:
    ```bash
    cd safemx
    ```

3. Install the required dependencies:
    ```bash
    pip install -r requirements.txt
    ```

---

## 🛠️ Usage

Run **SafeMX** to check SPF, DMARC, and DKIM records for a domain. You can specify the output format (console or JSON).

### Checking SPF, DMARC, and DKIM

- To check **SPF**:
    ```bash
    python3 main.py example.com -spf
    ```

- To check **DMARC**:
    ```bash
    python3 main.py example.com -dmarc
    ```

- To check **DKIM**:
    ```bash
    python3 main.py example.com -dkim -selector default
    ```

### Output Formats

- **Console Output** (default):
    ```bash
    python3 main.py example.com -spf -dmarc
    ```

- **JSON Output**:
    ```bash
    python3 main.py example.com -spf -dmarc --output json --outfile result.json
    ```

---

## Example Output

### Console Output:
```text
[+] SPF record for example.com found!
    spf: "v=spf1 ip4:192.0.2.0/24 -all"
[+] DMARC record for example.com found!
    dmarc: "v=DMARC1; p=quarantine; adkim=s; aspf=s;"
```

### JSON Output:
```json
{
  "spf": {
    "record": "v=spf1 ip4:192.0.2.0/24 -all",
    "version": "v=spf1",
    "mechanisms": [
      {
        "type": "ip",
        "value": "ip4:192.0.2.0/24"
      },
      {
        "type": "all",
        "value": "-all"
      }
    ]
  },
  "dmarc": {
    "record": "v=DMARC1; p=quarantine; adkim=s; aspf=s;",
    "fields": {
      "v": "DMARC1",
      "p": "quarantine",
      "adkim": "s",
      "aspf": "s"
    }
  }
}
```

---

## 📜 License

**SafeMX** is open-source software licensed under the MIT License.