Crime Rate Prediction: An Interactive Analysis

UCI Communities and Crime Dataset — Feature Selection & Model Comparison

1,994
Community Samples
101
Initial Features
37
Selected Features
7
Models Compared

Model Performance Comparison

Mean squared error across validation and test sets. RBF Kernel Ridge achieves the best generalization performance.

Feature Selection Consensus

Feature selection matrix showing which features are selected by OLS p-value, Stepwise, Lasso, and ElasticNet methods. Sorted by consensus count.

Coefficient Comparison Across Regularization

How coefficient values change as L1 ratio increases (sparsity effect). Ridge (L1=0) vs ElasticNet (L1=0.33, 0.66) vs Lasso (L1=1.0).

Hyperparameter Grid Search

Cross-validation MSE for RBF and Polynomial Kernel Ridge Regression across different hyperparameter combinations.

RBF Kernel Ridge: Gamma × Lambda (Best: γ=0.1, λ=0.1, MSE=0.01912)

Polynomial Kernel Ridge: Degree × Lambda (Best: d=1, λ=10, MSE=0.02046)

Key Findings

Summary of the most important insights from this multi-method feature selection and model comparison analysis.

Best Model

RBF Kernel Ridge achieved the lowest test MSE (0.01767), demonstrating that non-linear relationships in crime data significantly improve predictions over linear methods.

Core Features

15 features were consistently selected across all 4 methods (OLS, Stepwise, Lasso, ElasticNet), indicating strong agreement on the most predictive variables for crime rates.

Sparsity Effect

Increasing L1 ratio systematically drives coefficients to zero, with Lasso creating 66% sparsity. Ridge maintains non-zero coefficients across all features.

Feature Reduction

Successfully reduced 101 initial features to 37 selected features (63% reduction) while maintaining model performance, indicating strong feature engineering.

Model Stability

RBF Kernel Ridge showed strong generalization with minimal validation-test gap (0.01753 vs 0.01767), suggesting stable performance on unseen data.

Hyperparameter Sensitivity

RBF kernel performance is sensitive to gamma (width parameter), while polynomial kernels show more robustness, with degree=1 (linear) performing surprisingly well.

Interactive data visualization dashboard | Built with vanilla JavaScript | UCI Communities and Crime Dataset