Metadata-Version: 2.4
Name: syntex-automl
Version: 0.3.1
Summary: Ultra-lightweight (<150MB) autonomous machine learning engine with automated hygiene, hybrid stacking, FastAPI interactive UI export, and drift monitoring.
Author: Badri Vishal
License: MIT
Project-URL: Homepage, https://github.com/Syntex34x/AutoML
Project-URL: Bug Tracker, https://github.com/Syntex34x/AutoML/issues
Classifier: Programming Language :: Python :: 3
Classifier: Operating System :: OS Independent
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: numpy>=1.22.0
Requires-Dist: pandas>=1.4.0
Requires-Dist: scipy>=1.8.0
Requires-Dist: scikit-learn>=1.1.0
Requires-Dist: xgboost>=1.6.0
Requires-Dist: optuna>=3.0.0
Requires-Dist: requests>=2.28.0
Requires-Dist: beautifulsoup4>=4.11.0
Requires-Dist: lxml>=4.9.0
Requires-Dist: joblib>=1.2.0
Dynamic: license-file

<div align="center">

# ⚡ AutoPilotML Engine

**Autonomous, Lightweight, Zero-Config AutoML & Micro-Deployment Suite**

[![PyPI Version](https://img.shields.io/badge/pypi-v0.1.0-blue.svg)](https://pypi.org/)
[![Python Versions](https://img.shields.io/badge/python-3.8%20%7C%203.9%20%7C%203.10%20%7C%203.11-brightgreen.svg)](https://www.python.org/downloads/)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![GitHub Repo](https://img.shields.io/badge/GitHub-Syntex34x%2FAutoML-181717.svg?logo=github)](https://github.com/Syntex34x/AutoML)
[![Package Size](https://img.shields.io/badge/size-%3C150MB-informational.svg)](#)

<p align="center">
  <a href="#-overview">Overview</a> •
  <a href="#-architecture--pipeline-flow">Architecture</a> •
  <a href="#-features">Features</a> •
  <a href="#-installation">Installation</a> •
  <a href="#-quickstart">Quickstart</a> •
  <a href="#-production-bundle--cross-verification">Export & Verification</a> •
  <a href="#-advanced-usage--custom-ingestion">Advanced Usage</a> •
  <a href="#-ecosystem-positioning">Benchmark</a> •
  <a href="#-api-reference">API Reference</a>
</p>

</div>

---

## 📌 Overview

**AutoPilotML** is a zero-bloat, production-ready AutoML engine built for developers who need end-to-end model training without multi-gigabyte frameworks.

From direct HTML web table extraction and deterministic mathematical feature synthesis to Bayesian optimization across classical models, gradient boosters, and neural networks, AutoPilotML executes the entire pipeline in **3 lines of Python** and exports an immediately verifiable deployment package.

---

## 🏗️ Architecture & Pipeline Flow

The engine orchestrates data ingestion, feature synthesis, Bayesian optimization, holdout auditing, and artifact packaging autonomously:

```text
[Input: Raw CSV / Web URL / HTML Table]
                   │
                   ▼
  ┌─────────────────────────────────┐
  │         AutoWebIngest           │  ◄── Ingests Local Files, Live Endpoints, or HTML Tables
  └────────────────┬────────────────┘
                   ▼
  ┌─────────────────────────────────┐
  │     Preprocessing & Synthesis   │  ◄── Imputation, One-Hot Encoding, Robust Scaling
  │  (SymbolicFeatureSynthesizer)   │  ◄── Discovers Cross-Products & Non-Linear Ratios
  └────────────────┬────────────────┘
                   ▼
  ┌─────────────────────────────────┐
  │      Bayesian Search Loop       │  ◄── Optuna TPE Hyperparameter Tuning + CV
  │     (Multi-Model Benchmark)     │  ◄── XGBoost, Random Forest, ExtraTrees, KNN, MLP, Ridge
  └────────────────┬────────────────┘
                   ▼
  ┌─────────────────────────────────┐
  │      Holdout Audit Engine       │  ◄── Strict 80/20 Test Holdout Evaluation
  │   (Accuracy, F1, ROC / RMSE)    │
  └────────────────┬────────────────┘
                   ▼
  ┌─────────────────────────────────┐
  │        Production Bundle        │  ◄── Exports: model.pkl, test_holdout.csv,
  │       (One-Click Deploy)        │       audit_metrics.json, verify.py
  └─────────────────────────────────┘
```

---

## ✨ Features

- 🌐 **Autonomous Ingestion (`AutoWebIngest`)** — Point directly to local CSV files, remote JSON/CSV endpoints, or live HTML tables on any webpage.
- 📐 **Deterministic Feature Synthesis** — Automatic discovery of non-linear interaction terms, cross-products, and safe ratios without compute-heavy LLMs.
- 🧠 **Multi-Paradigm Algorithm Search** — Evaluates XGBoost, Random Forest, ExtraTrees, K-Nearest Neighbors (KNN), Multi-Layer Perceptrons (ANN/MLP), Logistic Regression, and Regularized Ridge.
- 🎯 **Bayesian Hyperparameter Optimization** — Tree-structured Parzen Estimator (TPE) search with cross-validation across hyperparameter domains.
- 🛡️ **Leakage-Free Validation** — Strict 80/20 train-test holdout partitioning with complete preprocessor state encapsulation.
- 📦 **One-Click Deployable Artifacts** — Auto-generates a clean production bundle containing `model.pkl`, `test_holdout.csv`, `audit_metrics.json`, and an executable `verify.py` sanity test.

---

## 🚀 Installation

### Option 1: Direct GitHub Installation

```bash
pip install git+https://github.com/Syntex34x/AutoML.git
```

### Option 2: Local Development Setup

```bash
git clone https://github.com/Syntex34x/AutoML.git
cd AutoML
pip install -e .
```

---

## ⚡ Quickstart

### 1. Train and Audit in 3 Lines

```python
import autopilot_ml as apm

# 1. Initialize engine with local file or direct live Web URL
engine = apm.AutoEngine(
    data="https://raw.githubusercontent.com/datasciencedojo/datasets/master/titanic.csv",
    target="Survived",
    max_trials=20
)

# 2. Run autonomous selection & tuning
engine.fit()

# 3. View diagnostics scorecard & export bundle
engine.print_diagnostics()
engine.download_bundle("./my_model_v1")
```

### 2. Sample Terminal Output

```text
[AutoPilotML] Task: CLASSIFICATION | Samples: 712 | Features: 11

================================================
📊 AUTONOMOUS AUDIT SCORECARD (CLASSIFICATION)
================================================
 ▸ Accuracy                 : 0.8268
 ▸ Precision                : 0.8264
 ▸ Recall                   : 0.8268
 ▸ F1-Score                 : 0.8253
================================================
📦 Production package generated in './my_model_v1/'
```

---

## 📦 Production Bundle & Cross-Verification

The exported bundle is completely self-contained and ready for deployment:

```text
my_model_v1/
├── model.pkl            # Complete encapsulated pipeline (preprocessor + model)
├── test_holdout.csv     # 20% unseen test split for manual auditing
├── audit_metrics.json   # Machine-readable evaluation scores
└── verify.py            # Runnable sanity check script
```

### Step 1: Run Instant Verification Test

Verify that the exported model pipeline loads and predicts properly on held-out test records:

```bash
cd my_model_v1
python verify.py
```

### Step 2: Serve Real-World Predictions

Load the pipeline directly in FastAPI, Flask, or backend microservices:

```python
import joblib
import pandas as pd

# Load encapsulated pipeline
pipeline = joblib.load("./my_model_v1/model.pkl")

# Pass raw, uncleaned incoming data directly
new_data = pd.DataFrame({
    "Pclass": [3, 1],
    "Sex": ["female", "male"],
    "Age": [22.0, 38.0],
    "SibSp": [1, 1],
    "Parch": [0, 0],
    "Fare": [7.25, 71.28],
    "Embarked": ["S", "C"]
})

predictions = pipeline.predict(new_data)
print("Predictions:", predictions)
```

---

## 🛠️ Advanced Usage & Custom Ingestion

### Autonomous Web Scraping

Extract and train directly from HTML tables on live webpages:

```python
from autopilot_ml import AutoWebIngest, AutoEngine

# Ingest table directly from a webpage
df = AutoWebIngest.fetch(
    "https://en.wikipedia.org/wiki/List_of_countries_by_GDP_(nominal)",
    table_idx=2
)

# Pass directly to the engine
engine = AutoEngine(data=df, target="Nominal GDP", max_trials=15)
engine.fit()
```

---

## 📊 Ecosystem Positioning

| Dimension | AutoPilotML | PyCaret | AutoGluon | FLAML |
|---|---|---|---|---|
| **API Philosophy** | Zero-Config 3-Line API | Low-Code Interactive | Multi-Layer Stacking | Cost-Frugal Search |
| **Install Size** | Lightweight (<150 MB) | Medium (~800 MB) | Heavy (~1.5 GB+) | Lightweight (<200 MB) |
| **Web Ingestion** | Native Built-in | Manual | Manual | Manual |
| **Deployment Package** | Pipeline + Data + `verify.py` | Raw `.pkl` | Model Folder | Raw Object |
| **Edge / Lambda Ready** | Yes (<100ms startup) | No | No | Yes |

---

## 📖 API Reference

### `AutoEngine(data, target, max_trials=20)`

- **`data`** (`str` | `pd.DataFrame`): Filepath, live web URL, or Pandas DataFrame.
- **`target`** (`str`): Target column name.
- **`max_trials`** (`int`, default=`20`): Number of Optuna optimization iterations.

### Methods

- **`.fit()`** — Runs ingestion, feature synthesis, cross-validation search, and holdout auditing.
- **`.print_diagnostics()`** — Prints holdout test scorecard.
- **`.download_bundle(folder)`** — Exports the deployable production bundle.

---

## 📄 License

This project is licensed under the MIT License — see the [LICENSE](LICENSE) file for details.

---

## 👤 Author

**Badri Vishal**

- GitHub: [@Syntex34x](https://github.com/Syntex34x)
- Repository: [AutoML](https://github.com/Syntex34x/AutoML)

---

<div align="center">

Licensed under the [MIT License](https://opensource.org/licenses/MIT)

</div>
