A data science project that cleans and integrates 10 years of U.S. Department of Education fine records, analyzes enforcement trends, and builds predictive models for fine magnitude and fine-risk classification.
- Domain: Higher-education compliance enforcement
- Time span: Fiscal Year 2010 to 2019
- Primary target (regression): Fine amount (log-transformed and raw)
- Secondary target (classification): High fine vs low fine (median split)
- Core methods: Trend statistics, Linear Regression, SVR, Tweedie GLM, Logistic Regression
main.py: End-to-end pipeline (load, clean, analyze, model, visualize)FY10.csv...FY19.csv: Annual enforcement datasetsschool-fine-report.xls/school-fine-report.xlsx: Source report files- Generated figures:
trend_analysis.pngreason_analysis.pngmodel_comparison.pngresiduals_vs_fitted.pngqq_plot.pngconfusion_matrix.png
- Loads yearly CSV files and standardizes schema across format differences.
- Converts Excel serial dates into calendar dates.
- Cleans currency values into numeric fine amounts.
- Harmonizes school type categories.
- Maps raw referral text into grouped reasons:
- Clery/Safety
- IPEDS
- Drug Prevention
- Qui Tam (Fraud)
- Other
- Aggregates annual totals and counts.
- Runs a linear trend test over fiscal years.
- Tests school-type fine differences with Kruskal-Wallis.
- Regression (fine amount):
- Linear Regression (log fine)
- SVR with RBF kernel (log fine)
- Tweedie/Gamma-style GLM with log link (raw fine, compared on log scale)
- Classification (risk):
- Logistic Regression for high-vs-low fine prediction
- Residuals vs fitted plot
- Q-Q plot for residual normality
- Confusion matrix for classifier behavior
| Residual Behavior | Normality Check |
|---|---|
![]() |
![]() |
python3 -m venv .venv
source .venv/bin/activatepython -m venv .venv
.venv\Scripts\Activate.ps1pip install pandas numpy matplotlib seaborn scikit-learn scipypython main.pyThe script will print metrics and regenerate all plots in the project root.
After execution, you should have the following generated visual artifacts:
trend_analysis.pngreason_analysis.pngmodel_comparison.pngresiduals_vs_fitted.pngqq_plot.pngconfusion_matrix.png
- The script is designed to tolerate minor schema differences across yearly files.
- Missing or malformed fine values are coerced to zero before filtering/modeling.
- Predictive models are trained on non-zero fines where fiscal year is available.





