Metadata-Version: 2.4
Name: autodataagent
Version: 1.0.0
Summary: Automated CSV Data Analysis & ML Diagnostics Agent for Jupyter Notebooks
Author: AutoDataAgent Team
Keywords: data-analysis,jupyter,visualization,machine-learning,eda,plotly,shap
Requires-Python: >=3.8
Description-Content-Type: text/markdown
Requires-Dist: pandas>=1.5.0
Requires-Dist: numpy>=1.20.0
Requires-Dist: plotly>=5.0.0
Requires-Dist: matplotlib>=3.5.0
Requires-Dist: seaborn>=0.12.0
Requires-Dist: scikit-learn>=1.0.0
Requires-Dist: shap>=0.40.0
Requires-Dist: ipywidgets>=8.0.0
Requires-Dist: kaleido>=0.2.0
Dynamic: requires-python

# 🤖 Automated Data Analysis & ML Diagnostics Agent for Jupyter Notebook

Jupyter Notebook ke andar **Exploratory Data Analysis (EDA)** aur **Machine Learning (ML) Model Diagnostics** ke liye ek all-in-one AI assistant.

Aapko bas CSV file provide karni hai — agent aapse **Step 1: First Column** select karwayega, fir **Step 2: Second Column**, fir **Step 3 mein 3 organized tabs** ke andar **23 different plot types** offer karega, aur ek click mein **Interactive Visualizations (Plotly)**, **Statistical & ML Insights**, aur **Python Code** generate karke dega!

---

## 🌟 Naye Features (Multi-Plot & Direct Download)

### 1. ➕ Ek Se Zyada Plots Banayein (Active Plots Gallery)
- Pehla plot banne ke baad purana plot delete ya overwrite nahi hoga.
- Plot ke theek niche **"➕ Create Another Plot (Naya Plot Banayein)"** button milta hai.
- Click karte hi aap naye columns aur naya plot choose kar sakte hain — aur naya plot neeche append ho jayega!
- Is tarah aap ek hi notebook session mein kitne bhi plots (Plot #1, Plot #2, Plot #3...) stack karke compare kar sakte hain.

### 2. 📥 1-Click Direct Download (PNG & HTML)
- Har generated plot ke theek upar dedicated download buttons milte hain:
  - 📥 **Download PNG (High-Res Image)** — Publication-ready high resolution 2x scale image directly download hoti hai.
  - 🌐 **Download Interactive HTML** — Standalone browser file jisme zoom, pan, hover tooltips sab preserved rehte hain.
- Files aapke local `exports/` folder mein bhi automatically save hoti hain.

---

## 🌟 Master Catalog of 23 Supported Plot Types

### 📊 Category A: Exploratory Data Analysis & Statistical Plots (16 Plots)
1. 📈 **Line Plot (`line_plot`)** — Trends, sequential progression, aur time-series.
2. 📊 **Bar Plot (`bar_plot`)** — Categories ka comparison (Mean / Sum aggregation ya counts).
3. 📋 **Horizontal Bar Plot (`horizontal_bar`)** — Categories ki clean horizontal ranking.
4. 📶 **Grouped Bar Plot (`grouped_bar`)** — Multiple categories ka side-by-side comparison.
5. 🧱 **Stacked Bar Plot (`stacked_bar`)** — Proportions aur percentage composition across groups.
6. 🥧 **Pie Chart (`pie_chart`)** — Circular percentage distribution.
7. 🍩 **Donut Chart (`donut_chart`)** — Modern center-hole donut chart.
8. 📊 **Histogram (`histogram`)** — Distribution spread, frequency bins aur KDE / box marginals.
9. ✨ **Scatter Plot (`scatter_plot`)** — Correlation, relationships, regression trendline aur $R^2$.
10. 🏔️ **Area Plot (`area_plot`)** — Cumulative filled volume under curve.
11. ⛰️ **Stacked Area Plot (`stacked_area_plot`)** — Multiple groups ka cumulative trend over sequence.
12. 🔥 **Heatmap (`heatmap`)** — 2D cross-tabulation frequency matrix aur 2D density heatmap.
13. 🌡️ **Correlation Heatmap (`correlation_heatmap`)** — Poore dataset ke numeric columns ka Pearson correlation matrix.
14. 📦 **Box Plot (`box_plot`)** — Quartiles (Q1, Median, Q3) aur IQR outlier markers.
15. 🎻 **Violin Plot (`violin_plot`)** — Kernel density estimation + embedded box plot.
16. 🔲 **Pair Plot (`pair_plot`)** — Multivariate pairwise scatter matrix across dataset features.

### 🤖 Category B: Machine Learning & Diagnostic Plots (7 Plots)
17. 🎯 **Residual Plot (`residual_plot`)** — Fitted values vs residuals ($y - \hat{y}$), homoscedasticity check, RMSE, MAE, $R^2$.
18. 🌲 **Feature Importance Plot (`feature_importance`)** — Random Forest model se top predictive features ki ranking.
19. 🔮 **SHAP Summary Plot (`shap_summary`)** — Explainable AI (SHAP) se features ka positive/negative impact.
20. 🧮 **Confusion Matrix Heatmap (`confusion_matrix`)** — Classification True vs Predicted labels, Accuracy, Precision, Recall, F1.
21. 📉 **ROC Curve (`roc_curve`)** — Receiver Operating Characteristic curve, False Positive vs True Positive rate, ROC-AUC score.
22. 🎯 **Precision-Recall Curve (`precision_recall_curve`)** — PR curve with Average Precision (AP) score, imbalanced classification ke liye best.
23. 📚 **Learning Curve (`learning_curve`)** — Sample size ke against Train vs Validation scores, Overfitting / Underfitting diagnosis.

---

## 📦 Python Library Installation

Yeh agent ab ek standard Python library (`data-agent`) ban chuka hai. 
Aap ise apne system environment mein install kar sakte hain taaki **kisi bhi folder ya notebook se seedha import ho sake**:

```bash
# Workspace folder mein jaakar install karein (editable mode):
pip install -e .
```

Ek baar install hone ke baad, aap **apne computer par kahin se bhi** bina kisi path setting ke seedha likh sakte hain:
```python
from data_agent import AutoDataAgent

agent = AutoDataAgent()
agent.analyze("path/to/any_data.csv")
```

---
```python
from data_agent import AutoDataAgent

# Agent initialize karein
agent = AutoDataAgent()

# CSV file provide karein
agent.analyze("sample_sales_data.csv")
```
- **Step 1**: 1-click se pehla column (X-axis / Target) select karein.
- **Step 2**: 1-click se doosra column (Y-axis / Feature) chunein ya **Single Column / Dataset Mode** click karein.
- **Step 3**: 3 Tabs mein se koi bhi plot select karein.
- **Plot Output**:
  - Upar **Download PNG** ya **Download HTML** par click karke save karein.
  - Niche **➕ Create Another Plot** dabakar naya plot add karein!

### 2. Programmatic Export (Direct Code):
```python
fig, code, insights = agent.quick_plot("Sales", "Profit", plot_id="scatter_plot")

# Save directly as PNG & HTML
png_path, _ = agent.export_plot(fig, filename="sales_vs_profit", format="png")
html_path, _ = agent.export_plot(fig, filename="sales_vs_profit", format="html")

print("Saved PNG:", png_path)
print("Saved HTML:", html_path)
fig.show()
```

---

## 🧪 Testing

Test suite ko run karein:
```bash
python3 test_agent.py
```
Sabhi 25 tests pass hote hain:
```text
.........................
Ran 25 tests in 15.967s (OK)
```
