Spaces:
Sleeping
Sleeping
| title: SF Crime Analytics | AI-Powered | |
| emoji: π | |
| colorFrom: red | |
| colorTo: blue | |
| sdk: docker | |
| app_port: 8501 | |
| tags: | |
| - streamlit | |
| - machine-learning | |
| - xgboost | |
| - crime-prediction | |
| pinned: true | |
| license: apache-2.0 | |
| # π San Francisco Crime Analytics & Prediction System | |
| ## Overview | |
| This project is a comprehensive AI-powered dashboard for analyzing and predicting crime in San Francisco. It leverages historical data and advanced machine learning models (XGBoost) to provide actionable insights and real-time risk assessments. | |
| ## Features | |
| - **π Historical Trends**: Visualize crime distribution by hour, district, and category. | |
| - **πΊοΈ Geospatial Intelligence**: Interactive heatmaps showing crime density and evolution over time. | |
| - **π¨ Tactical Simulation**: Simulate patrol strategies and assess risk levels for specific sectors. | |
| - **π¬ Chat with Data**: Natural language interface to query the dataset. | |
| - **π Advanced Prediction (99% Accuracy)**: High-precision crime categorization using an optimized XGBoost model. | |
| - **π€ AI Crime Safety Assistant**: Interactive chatbot for safety tips and model explanations. | |
| ## Installation | |
| 1. **Clone the repository**: | |
| ```bash | |
| git clone <repository-url> | |
| cd Hackathon | |
| ``` | |
| 2. **Install dependencies**: | |
| ```bash | |
| pip install -r requirements.txt | |
| ``` | |
| 3. **Run the application**: | |
| ```bash | |
| streamlit run app.py | |
| ``` | |
| ## Docker Support | |
| Build and run the container: | |
| ```bash | |
| docker build -t sf-crime-app . | |
| docker run -p 8501:8501 sf-crime-app | |
| ``` | |
| ## Technologies | |
| - **Frontend**: Streamlit | |
| - **Backend**: Python, Pandas, NumPy | |
| - **ML Models**: XGBoost, Scikit-Learn (KMeans) | |
| - **Visualization**: Plotly, Folium | |
| - **AI Integration**: Groq (Llama 3) | |
| --- | |
| *Developed for HEC Hackathon* | |