CrimeCast is a machine learning project developed as part of the Kaggle competition "Forecasting Crime Categories."
The objective was to predict crime categories from historical crime records by combining structured features, textual information, feature engineering, and ensemble machine learning techniques.
The project follows a complete end-to-end machine learning workflow, including:
- Exploratory Data Analysis (EDA)
- Missing Value Treatment
- Feature Engineering
- Text Processing using TF-IDF
- Model Development
- Cross Validation
- Hyperparameter Tuning
- Model Evaluation
- Kaggle Submission Generation
🏆 Kaggle Leaderboard Rank: 222
📈 Leaderboard Score: 0.9510
Accurately forecasting crime categories can help authorities understand crime patterns, improve resource allocation, and support data-driven public safety strategies.
The task was formulated as a multi-class classification problem, where the goal was to predict the correct crime category for each incident.
The dataset contains historical crime records with information such as:
- Location details
- Cross streets
- Area information
- Victim demographics
- Weapon information
- Premise details
- Crime occurrence date and time
- Textual descriptions
Several features contained significant missing values and required preprocessing before model training.
Performed detailed analysis of:
- Target class distribution
- Missing values
- Numerical feature distributions
- Categorical feature frequencies
- Crime occurrence trends
- Victim demographics
- Geographic attributes
Key observations included:
- Strong class imbalance in crime categories
- Large number of missing values in weapon-related fields
- Invalid values in victim age
- Location-based crime concentration patterns
Implemented preprocessing pipelines for:
- Missing value imputation
- Numerical feature scaling
- Categorical feature encoding
- Text feature transformation
- Feature consolidation
Created a reusable machine learning pipeline that combines:
- Numerical features
- Categorical features
- Text-based features using TF-IDF
- Feature selection using SelectKBest
This approach reduced dimensionality while preserving predictive information.
Evaluated multiple machine learning models:
- Ensemble tree-based model
- Strong baseline performance
- Gradient boosting framework
- Efficient training and strong predictive capability
- Gradient boosting algorithm
- Best overall performance across evaluation metrics
Used:
- Train/Validation Split
- Classification Reports
- Confusion Matrices
- Accuracy Comparison
- Macro-Average Metrics
Findings showed that XGBoost achieved the best balance between overall accuracy and minority-class performance.
Applied:
- 5-Fold Cross Validation
to improve model robustness and reduce overfitting risk.
Performed GridSearchCV optimization for:
- Random Forest
- LightGBM
- XGBoost
Optimized parameters included:
- Number of estimators
- Learning rate
- Tree depth
- Number of leaves
- Split criteria
The final tuned XGBoost model achieved the strongest validation performance.
The final production pipeline consisted of:
- Data Preprocessing Pipeline
- TF-IDF Feature Extraction
- SelectKBest Feature Selection
- XGBoost Classifier
This model was trained on the full dataset and used to generate competition submissions.
- Python
- Pandas
- NumPy
- Scikit-Learn
- XGBoost
- LightGBM
- Matplotlib
- Seaborn
- Multi-Class Classification
- Feature Engineering
- TF-IDF Vectorization
- SelectKBest Feature Selection
- Cross Validation
- Hyperparameter Tuning
- Ensemble Learning
CrimeCast-Forecasting-Crime-Categories/
│
├── crimecast_notebook.ipynb
├── README.md
│
└── images/
├── leaderboard_rank.png
└── model_pipeline.png
Leaderboard Score: 0.9510
Leaderboard Rank: 222
The project implements a complete machine learning workflow including preprocessing, feature engineering, model comparison, hyperparameter tuning, and final prediction generation.
Through this project, I gained practical experience in:
- End-to-end machine learning workflows
- Kaggle competition methodology
- Feature engineering techniques
- Text feature extraction using TF-IDF
- Ensemble learning methods
- Model evaluation and comparison
- Hyperparameter tuning with GridSearchCV
- Building reusable ML pipelines
Akula Geetha Maheswari
BSc in Data Science and Programming Indian Institute of Technology Madras

