Spaces:
Sleeping
Sleeping
SF Crime Prediction App
This is a Streamlit application for predicting crime categories in San Francisco using an XGBoost model.
Setup
Install Dependencies:
pip install -r requirements.txtRun the App:
streamlit run streamlit_app.pyOr simply double-click
run_app.bat.
Model Info
The app uses crime_xgb_artifacts.pkl which contains:
- XGBoost Model
- LabelEncoder for Target (Crime Category)
- FeatureHashers for Address and Description
Note: The model expects specific features including hashed Address and Description. Ensure you provide these inputs in the UI for accurate predictions. Note: The District encoder was missing from the provided files, so a default alphabetical mapping is used.
Deployment
To deploy on the web (e.g., Streamlit Cloud):
- Push this code to a GitHub repository.
- Sign up for Streamlit Cloud.
- Connect your GitHub and deploy the app.