Metadata-Version: 2.4
Name: trustra
Version: 1.0.0
Summary: Trust-first AutoML: Automated ML with built-in fairness, drift, and reliability.
Home-page: https://github.com/Devansh-567/Trustra---Trust-First-AutoML-Framework
Author: Devansh Singh
Author-email: devansh.jay.singh@gmail.com
Project-URL: Documentation, https://github.com/Devansh-567/Trustra---Trust-First-AutoML-Framework#readme
Project-URL: Source, https://github.com/Devansh-567/Trustra---Trust-First-AutoML-Framework
Project-URL: Tracker, https://github.com/Devansh-567/Trustra---Trust-First-AutoML-Framework/issues
Keywords: automl,fairness,bias,drift,explainability,machine-learning,responsible-ai
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: pandas>=1.5
Requires-Dist: numpy>=1.21
Requires-Dist: scikit-learn>=1.3
Requires-Dist: optuna>=3.0
Requires-Dist: plotly>=5.10
Requires-Dist: jinja2>=3.1
Requires-Dist: fairlearn>=0.10
Requires-Dist: xgboost>=1.7
Dynamic: author
Dynamic: author-email
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: keywords
Dynamic: license-file
Dynamic: project-url
Dynamic: requires-dist
Dynamic: requires-python
Dynamic: summary

# 🛡️ Trustra — Trust-First AutoML Framework

> **"One `fit()`. Full trust."**

Trustra is a **next-generation, open-source AutoML framework** that doesn’t just maximize accuracy — it **ensures model integrity** by automatically detecting **data leakage, bias, drift, and instability** — and generating **auditable trust reports**.

Unlike traditional AutoML tools that optimize only for performance, **Trustra enforces responsibility by design**.

---

## 🚀 Why Trustra?

Most AutoML tools (like H2O, AutoGluon, or SageMaker) focus on **"How accurate is the model?"**  
Trustra asks:  
> ❓ **"Can we trust this model?"**  
> ❓ **"Is it fair?"**  
> ❓ **"Is it safe for production?"**

We built Trustra because:
- Real-world models fail due to **hidden data issues**, not poor algorithms.
- Bias goes undetected until it harms users.
- Drift creeps in silently.
- Teams waste weeks on manual validation.

👉 **Trustra automates trust.**

---

## ✨ Key Features

| Feature | Description |
|-------|-------------|
| 🔍 **Data Quality Checks** | Detects missing values, duplicates, class imbalance, and **data leakage** (e.g., target leakage) |
| ⚖️ **Fairness Audit** | Automatically audits bias across sensitive features (e.g., gender, race) using **Demographic Parity & Equalized Odds** |
| 📉 **Drift Detection** | Flags feature drift between train/validation using KS test & PSI |
| 🧠 **Auto Model Selection** | Uses **Optuna** to find the best model (Logistic Regression, Random Forest, Gradient Boosting) and hyperparameters |
| 📊 **Trust Report** | Generates a **self-contained HTML report** with model performance, fairness metrics, and detected issues |
| 🚀 **Simple API** | Just `model.fit(X_train, y_train)` — no complex pipelines |
| 💡 **Explainability Ready** | Designed for integration with SHAP/LIME (coming soon) |

---

## 🏆 Results on Synthetic Data

| Metric | Result |
|-------|--------|
| **CV AUC** | 0.960 |
| **Bias (DPD)** | 0.051 (Low) |
| **Data Issues Found** | 0 |
| **Training Time** | < 10 seconds |
| **Fairness Audit** | ✅ Passed |

> ✅ Generated fully automatic, no manual checks.

---

## 🌟 What Makes Trustra Unique?

| Trustra | Traditional AutoML |
|--------|-------------------|
| Built-in **fairness** | Fairness? You code it. |
| Auto **data leakage** detection | Silent failure risk |
| **Trust report** generated | Just predictions |
| **Drift & imbalance** checks | Ignored |
| One `fit()` → full audit | Manual validation needed |
| **Open, transparent, auditable** | Black-box models |

> Trustra is **not just AutoML — it’s Responsible AI automation**.

---

## 🧩 How It Works

```python
from trustra import TrustRA

# Initialize with target and sensitive features
model = TrustRA(target="income", sensitive_features=["gender"])

# Run full trust-first pipeline
model.fit(X_train, y_train, X_val, y_val)

# Get predictions
preds = model.predict(X_val)

# Report saved as: trustra_report.html
```
---
## Pipeline Stages:
> Data Validation → Check quality, leakage, duplicates
> Fairness Audit → Measure DPD/EOD
> Model Training → Optuna + Cross-validation
> Report Generation → Interactive HTML with Plotly
---

## 📦 Installation
```bash
# Clone the repo
git clone https://github.com/Devansh-567/Trustra---Trust-First-AutoML-Framework.git
cd Trustra---Trust-First-AutoML-Framework

# Install in editable mode
pip install -e .

# Optional: Install dependencies
pip install -r requirements.txt
```
---

## 🧪 Example Usage
```bash
python examples/binary_classification.py
```

### Generates: 
> ✅ ```bash trustra_report.html```
> ✅ Console metrics (AUC, fairness, issues)
---

## 📄 License
MIT License
Copyright © 2025 Devansh

---

## 👤 Author
> Devansh Singh
> devansh.jay.singh@gmail.com
> "Built Trustra to make AI trustworthy, one model at a time."
