Metadata-Version: 2.4
Name: redpandas-ml
Version: 0.3.2
Summary: Enterprise-grade ML data-preparation pipeline with integrated visual health reporting
Author-email: Kuldeep Gade <your-actual-email@gmail.com>
License: MIT
Project-URL: Homepage, https://github.com/GadeKuldeep/redPandas
Project-URL: Repository, https://github.com/GadeKuldeep/redPandas.git
Project-URL: Issues, https://github.com/GadeKuldeep/redPandas/issues
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.9
Description-Content-Type: text/markdown
Requires-Dist: pandas>=1.5
Requires-Dist: numpy>=1.23
Requires-Dist: matplotlib>=3.6
Requires-Dist: seaborn>=0.12
Requires-Dist: scipy>=1.10
Requires-Dist: scikit-learn>=1.2

# redpandas-prep

![PyPI - Version](https://img.shields.io/pypi/v/redpandas-prep)
![Python Version](https://img.shields.io/pypi/pyversions/redpandas-prep)

Enterprise-grade ML data-preparation pipeline with integrated visual health reporting.

## Installation

```bash
# Core only
pip install redpandas-prep

# With visualization support (recommended)
pip install "redpandas-prep[viz]"

# With all optional dependencies (seaborn, scipy, scikit-learn)
pip install "redpandas-prep[all]"
```

**Note:** The package name on PyPI is `redpandas-prep`, but you import it as `redpandas` using the alias `rp`:
```python
import redpandas as rp
```

## Quick Start (Chain Usage)

```python
import redpandas as rp

# Full automated pipeline
X, y = (
    rp.Prep("messy_data.csv")
      .clean()
      .transform()
      .plot_report(target_column="label", save_path="report.html")
      .split_target("label")
)
```

## Configuration (`PrepConfig`)

You can fully customize the pipeline behavior using the new `PrepConfig` class:

```python
from redpandas.config import PrepConfig

config = PrepConfig(
    missing_threshold=0.80,
    outlier_method="iqr",
    scaling_method="robust",
    categorical_imputation="mode",
    auto_encode=True
)

prep = rp.Prep("messy_data.csv", config=config)
```

## Diagnostics & Health Scoring

`redpandas` automatically diagnoses datasets upon initialization:
```python
print(prep.diagnostics["health_score"])
print(prep.diagnostics["issues"])
print(prep.diagnostics["recommendations"])
```

## Data Cleaning (`.clean()`)

| Step | Action | Config Reference |
|------|--------|------------------|
| 1 | Remove exact duplicate rows | `remove_duplicates` |
| 2 | Drop empty/sparse columns | `missing_threshold` |
| 3 | Drop zero-variance columns | `remove_constant_columns` |
| 4 | Remove statistical outliers | `outlier_method` |

## Data Transformation (`.transform()`)

| Step | Action | Config Reference |
|------|--------|------------------|
| 1 | Impute numeric columns | `numerical_imputation` |
| 2 | Impute categorical columns | `categorical_imputation` |
| 3 | Scale numeric columns | `scaling_method` |
| 4 | One-hot encode categories | `auto_encode` |

## Pipeline Persistence

Save and load the entire pipeline state:
```python
prep.save_pipeline("pipeline.pkl")
loaded_prep = rp.Prep.load_pipeline("pipeline.pkl")
```

## Scikit-Learn Integration

Export the exact configuration of `redpandas` to a scikit-learn `ColumnTransformer`:
```python
sklearn_pipeline = prep.to_sklearn_pipeline()
# Use directly in GridSearchCV or other scikit-learn tools
```

## Visualization

The `.plot_report()` method generates a single self-contained HTML report with zero external dependencies. The report contains:
- Dataset Overview & Data Health Score
- Memory Usage & Recommendations
- Missing Value Analysis
- Feature Distributions
- Outliers (Box-Whisker)
- Correlation Matrix
- Class Balance

## Publishing a New Version

To publish to PyPI using GitHub Actions:
1. Update `version` in `pyproject.toml`
2. Create and push a new tag:
   ```bash
   git tag v0.3.0
   git push origin v0.3.0
   ```
3. GitHub Actions handles the build and trusted PyPI publishing automatically.
