File size: 2,871 Bytes
e665510
 
 
 
 
 
c9aa749
e665510
 
 
 
a48d292
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
---
title: Business Intelligence Dashboard
emoji: πŸ“Š
colorFrom: blue
colorTo: indigo
sdk: gradio
sdk_version: 4.44.1
app_file: app.py
pinned: false
---

## Business Intelligence Dashboard

Interactive Gradio application for exploring business datasets, generating insights, and exporting filtered results.

### Features
- Upload CSV or Excel files with automated validation and previews.
- Comprehensive statistics: numeric and categorical summaries, missing value report, correlation matrix.
- Dynamic filtering by numeric ranges, categorical selections, and date ranges with live row counts.
- Visualizations: time series, distribution, category comparisons, scatter plots, correlation heatmap.
- Automated insights: top/bottom performers, trend detection, anomaly identification.
- Export filtered data as CSV and download charts as PNG (requires `kaleido`).

### Project Structure
```
BID/
β”œβ”€β”€ app.py                  # Gradio UI wiring
β”œβ”€β”€ data_processor.py       # Data loading, cleaning, filtering utilities
β”œβ”€β”€ visualizations.py       # Plotly chart generators
β”œβ”€β”€ insights.py             # Insight extraction helpers
β”œβ”€β”€ utils.py                # Shared helpers/constants
β”œβ”€β”€ data/                   # Curated datasets from Kaggle & UCI
β”‚   β”œβ”€β”€ sales_train.csv
β”‚   β”œβ”€β”€ items.csv
β”‚   β”œβ”€β”€ item_categories.csv
β”‚   β”œβ”€β”€ shops.csv
β”‚   β”œβ”€β”€ test.csv
β”‚   └── online_retail.csv   # add this file from the UCI dataset
β”œβ”€β”€ requirements.txt        # Python dependencies
└── README.md               # Project overview (this file)
```

### Sample Datasets
- Kaggle *Predict Future Sales* (`sales_train.csv` plus lookup tables `items.csv`, `item_categories.csv`, `shops.csv`).
- UCI *Online Retail* (`online_retail.csv` β€” place the downloaded CSV in `data/`).

Use the **Load Sample** controls on the *Data Upload* tab to bootstrap analysis with these datasets. The app augments the Kaggle sales data by joining the lookup tables automatically.

### Getting Started
1. **Install dependencies**
   ```bash
   pip install -r requirements.txt
   ```
   PNG exports require the optional `kaleido` dependency included above.

2. **Launch the dashboard**
   ```bash
   python app.py
   ```

3. **Load data**
   - Upload your own CSV/Excel file **or** pick one of the bundled datasets via the *Load Sample* dropdown.
   - Ensure the raw Kaggle/UCI CSV files reside in `data/` so the sample loader can detect them.

4. **Explore**
   - Apply filters, switch between visualizations, inspect automated insights, and download filtered results or charts.

### Notes
- The app infers column types automatically; ensure date columns are parseable for time-series plots and trend insights.
- Large datasets may need additional preprocessing before upload to stay within local resource limits.