jkbytecrafter's picture
Initial commit: Autonomous Data Analyst
6119e2a
|
Raw History Blame Contribute Delete
5.69 kB
---
title: Autonomous Data Analyst
emoji: πŸ€–
colorFrom: blue
colorTo: purple
sdk: docker
app_port: 7860
pinned: false
---
# πŸ€– Autonomous Data Analyst
An AI-Powered, End-to-End Data Science Platform that automates data cleaning, exploratory data analysis, machine learning, and business insight generation β€” powered by LLMs (Gemini, OpenAI, Anthropic).
[![Python](https://img.shields.io/badge/Python-3.10%2B-blue?logo=python)](https://python.org)
[![FastAPI](https://img.shields.io/badge/FastAPI-0.100%2B-009688?logo=fastapi)](https://fastapi.tiangolo.com)
[![Streamlit](https://img.shields.io/badge/Streamlit-1.x-FF4B4B?logo=streamlit)](https://streamlit.io)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
---
## 🌟 Features
| Feature | Description |
|---|---|
| πŸ“₯ **Data Ingestion** | Upload CSV, Excel, or JSON files via UI or API |
| 🧹 **Intelligent Cleaning** | Auto-handles missing values, outliers, encoding & scaling |
| πŸ“Š **Automated EDA** | Rich Plotly dashboards, correlation matrices, distribution plots |
| πŸ€– **AutoML Pipeline** | Auto-detects classification/regression, trains & compares multiple models |
| πŸ’‘ **AI Insights** | LLM-powered business insight generation (Gemini / OpenAI) |
| πŸ’¬ **Chat with Data** | Natural language querying via LangChain code-generation |
| πŸ“„ **Report Generation** | Auto-generated PDF/HTML analysis reports |
| πŸ”Œ **REST API** | Full FastAPI backend for programmatic access |
---
## πŸ—οΈ Architecture
```
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Streamlit Frontend (app.py) β”‚
β”‚ Upload β†’ EDA β†’ AutoML β†’ Insights β†’ Chat β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
β”‚ HTTP
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ FastAPI Backend (app/backend/) β”‚
β”‚ /upload /eda /automl /insights /chat β”‚
β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”˜
β”‚ β”‚ β”‚ β”‚
app/utils app/eda app/automl app/insights
(cleaning) (plots) (PyCaret) (LangChain)
(Gemini/GPT)
```
---
## πŸš€ Quickstart
### Prerequisites
- Python 3.10+
- A Gemini API Key (free at [aistudio.google.com](https://aistudio.google.com)) or OpenAI API Key
### 1. Clone the Repository
```bash
git clone https://github.com/<your-username>/autonomous-data-analyst.git
cd autonomous-data-analyst
```
### 2. Create a Virtual Environment
```bash
python -m venv venv
# Windows
.\venv\Scripts\activate
# macOS / Linux
source venv/bin/activate
```
### 3. Install Dependencies
```bash
pip install -r requirements.txt
```
### 4. Configure Environment Variables
```bash
cp .env.example .env
```
Edit `.env` and add your API key:
```env
GEMINI_API_KEY=your-gemini-api-key
# Or use OpenAI:
# OPENAI_API_KEY=your-openai-api-key
```
### 5. Run the Application
**Option A β€” Streamlit UI only:**
```bash
streamlit run app.py
```
Open [http://localhost:8501](http://localhost:8501)
**Option B β€” With FastAPI Backend:**
```bash
# Terminal 1
uvicorn app.backend.main:app --reload
# Terminal 2
streamlit run app.py
```
- UI: [http://localhost:8501](http://localhost:8501)
- API Docs: [http://localhost:8000/docs](http://localhost:8000/docs)
### 6. Run the Demo Pipeline
```bash
python demo_pipeline.py
```
---
## 🐳 Docker Compose
```bash
docker-compose up --build
```
- UI: `http://localhost:8501`
- API: `http://localhost:8000/docs`
---
## πŸ“ Project Structure
```
autonomous-data-analyst/
β”œβ”€β”€ app.py # Streamlit frontend entrypoint
β”œβ”€β”€ demo_pipeline.py # End-to-end demo script
β”œβ”€β”€ requirements.txt
β”œβ”€β”€ docker-compose.yml
β”œβ”€β”€ .env.example
β”‚
β”œβ”€β”€ app/
β”‚ β”œβ”€β”€ backend/ # FastAPI routes & API logic
β”‚ β”‚ └── api/ # Endpoint modules (automl, eda, etc.)
β”‚ β”œβ”€β”€ automl/ # AutoML engine (PyCaret wrapper)
β”‚ β”œβ”€β”€ eda/ # EDA report generation
β”‚ β”œβ”€β”€ insights/ # LLM insight generation (LangChain)
β”‚ β”œβ”€β”€ llm/ # LLM provider abstraction (Gemini/OpenAI)
β”‚ β”œβ”€β”€ models/ # Saved ML model artifacts
β”‚ β”œβ”€β”€ reports/ # Report generation logic
β”‚ β”œβ”€β”€ ui/ # Streamlit UI components
β”‚ β”œβ”€β”€ utils/ # Data ingestion, cleaning helpers
β”‚ └── visualization/ # Plotly chart builders
β”‚
β”œβ”€β”€ configs/ # YAML configuration files
β”œβ”€β”€ datasets/ # Sample datasets
β”œβ”€β”€ notebooks/ # Exploration notebooks
└── tests/ # Unit & integration tests
```
---
## πŸ› οΈ Tech Stack
| Layer | Technology |
|---|---|
| **Frontend** | Streamlit |
| **Backend** | FastAPI |
| **AutoML** | PyCaret, Scikit-learn |
| **LLM / AI** | LangChain, Google Gemini, OpenAI |
| **Visualizations** | Plotly, Matplotlib, Seaborn |
| **Data** | Pandas, NumPy |
| **Containerization** | Docker, Docker Compose |
---
## πŸ“ License
This project is licensed under the MIT License β€” see the [LICENSE](LICENSE) file for details.
"# Autonomous-Data-Analyst"