Spaces:
Sleeping
Sleeping
Update README.md
Browse files
README.md
CHANGED
|
@@ -1,19 +1,91 @@
|
|
| 1 |
---
|
| 2 |
-
title: Data Analysis
|
| 3 |
-
emoji:
|
| 4 |
-
colorFrom:
|
| 5 |
-
colorTo:
|
| 6 |
-
sdk:
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
- streamlit
|
| 10 |
pinned: false
|
| 11 |
-
|
| 12 |
---
|
| 13 |
|
| 14 |
-
#
|
| 15 |
|
| 16 |
-
|
| 17 |
|
| 18 |
-
|
| 19 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
+
title: "Data Analysis App"
|
| 3 |
+
emoji: "π"
|
| 4 |
+
colorFrom: "indigo"
|
| 5 |
+
colorTo: "blue"
|
| 6 |
+
sdk: "streamlit"
|
| 7 |
+
sdk_version: "1.39.0"
|
| 8 |
+
app_file: "streamlit_data_analysis_app.py"
|
|
|
|
| 9 |
pinned: false
|
| 10 |
+
license: "mit"
|
| 11 |
---
|
| 12 |
|
| 13 |
+
# π Streamlit Data Analysis App (Gemini + Open-Source)
|
| 14 |
|
| 15 |
+
This Streamlit app lets you **upload CSV or Excel datasets**, automatically clean and preprocess them, create **quick visualizations**, and even get **AI-generated insights** powered by Gemini or open-source models.
|
| 16 |
|
| 17 |
+
---
|
| 18 |
+
|
| 19 |
+
## π Features
|
| 20 |
+
β
Upload `.csv` or `.xlsx` datasets
|
| 21 |
+
β
Automatic data cleaning & standardization
|
| 22 |
+
β
Preprocessing pipeline (imputation, encoding, scaling)
|
| 23 |
+
β
Quick visualizations (histogram, boxplot, correlation heatmap, etc.)
|
| 24 |
+
β
Smart dataset summary and preview
|
| 25 |
+
β
Optional **Gemini AI insights** for dataset interpretation
|
| 26 |
+
|
| 27 |
+
---
|
| 28 |
+
|
| 29 |
+
## π§ LLM Integration (Optional)
|
| 30 |
+
You can enable AI-generated insights with **Gemini 2.0 Flash** or your own Hugging Face model.
|
| 31 |
+
|
| 32 |
+
### π To configure:
|
| 33 |
+
1. Go to your Spaceβs **Settings β Secrets** tab.
|
| 34 |
+
2. Add the following: GEMINI_API_KEY = your_gemini_api_key
|
| 35 |
+
HF_TOKEN = your_huggingface_token # optional
|
| 36 |
+
3. Save, then **Restart your Space**.
|
| 37 |
+
|
| 38 |
+
If you donβt add an API key, the app will still work for data cleaning and visualization.
|
| 39 |
+
|
| 40 |
+
---
|
| 41 |
+
|
| 42 |
+
## π οΈ Deployment Notes
|
| 43 |
+
- **Runtime:** Python SDK
|
| 44 |
+
- **SDK:** Streamlit
|
| 45 |
+
- **File formats supported:** `.csv`, `.xlsx`
|
| 46 |
+
- **Maximum file size:** 100 MB
|
| 47 |
+
- **Recommended visibility:** Public (for full file upload support)
|
| 48 |
+
|
| 49 |
+
---
|
| 50 |
+
|
| 51 |
+
## βοΈ Troubleshooting
|
| 52 |
+
|
| 53 |
+
### β AxiosError: Request failed with status code 403
|
| 54 |
+
If you encounter this:
|
| 55 |
+
- Ensure your Space is **Public** (not Private).
|
| 56 |
+
- Ensure `sdk: streamlit` and `app_file:` are correctly declared in the YAML metadata above.
|
| 57 |
+
- Check that your **runtime** is βPython SDKβ.
|
| 58 |
+
- Recheck your **Gemini API Key** or token secrets.
|
| 59 |
+
|
| 60 |
+
### β
Fix Checklist
|
| 61 |
+
| Issue | Fix |
|
| 62 |
+
|-------|------|
|
| 63 |
+
| App fails to start | Verify `app_file` matches your actual Python filename |
|
| 64 |
+
| 403 Error | Make the Space public |
|
| 65 |
+
| API not found | Add key to **Settings β Secrets** |
|
| 66 |
+
| File upload broken | Ensure `sdk: streamlit` and `runtime: python` |
|
| 67 |
+
|
| 68 |
+
---
|
| 69 |
+
|
| 70 |
+
## π‘ Example Workflow
|
| 71 |
+
1. Upload your dataset (e.g., `global_freelancers_raw.csv`).
|
| 72 |
+
2. View the raw preview and cleaned data table.
|
| 73 |
+
3. Generate preprocessing pipelines (e.g., median imputation + one-hot encoding).
|
| 74 |
+
4. Visualize trends with histograms, boxplots, or heatmaps.
|
| 75 |
+
5. (Optional) Ask Gemini for AI insights about correlations, patterns, or recommendations.
|
| 76 |
+
|
| 77 |
+
---
|
| 78 |
+
|
| 79 |
+
## π§© Tech Stack
|
| 80 |
+
- **Frontend:** Streamlit
|
| 81 |
+
- **Backend:** Python (Pandas, NumPy, Scikit-learn)
|
| 82 |
+
- **AI Models:** Gemini 2.0 Flash / open-source LLMs (Qwen, Mistral, etc.)
|
| 83 |
+
- **Visualization:** Matplotlib, Seaborn
|
| 84 |
+
|
| 85 |
+
---
|
| 86 |
+
|
| 87 |
+
## π§Ύ License
|
| 88 |
+
MIT License Β© 2025
|
| 89 |
+
You are free to use, modify, and share this app with attribution.
|
| 90 |
+
|
| 91 |
+
---
|