This repository contains Python-based models designed to predict outcomes of U.S. Supreme Court cases and justices' decisions using the Segal and Spaeth dataset. The project leverages machine learning techniques to analyze historical data and generate predictive insights.
Features
- Data processing pipelines for Supreme Court cases and justice datasets.
- Machine learning models implemented with TensorFlow to predict case outcomes and justice votes.
- Integration of SHAP (SHapley Additive exPlanations) for model interpretability.
- Utilities for data loading, preprocessing, and dataset splitting.
Tech Stack
- Python 3
- TensorFlow
- Pandas
- Scikit-learn
- SHAP
- Matplotlib & Seaborn for visualization
Getting Started
Prerequisites
Ensure Python 3 is installed. It is recommended to use a virtual environment.
Installation
git clone https://github.com/justin-napolitano/Supreme-Court-Predictions.git
cd Supreme-Court-Predictions
python -m venv venv
source venv/bin/activate # On Windows use `venv\Scripts\activate`
pip install -r requirements.txt # Assumed to exist or install packages manually
Running
Run the prediction scripts located in the case and justice directories:
python case/SupremeCourtPredictionsCase.py
python justice/SupremeCourtPredictionsJustice.py
Note: The scripts expect data files under a data directory in the root, including CSV files and feature configuration files.
Project Structure
Supreme-Court-Predictions/
βββ case/
β βββ SupremeCourtPredictionsCase.py # Case outcome prediction model
βββ justice/
β βββ SupremeCourtPredictionsJustice.py # Justice vote prediction model
βββ README.md
βββ data/ # Expected directory for datasets and feature files (not included)
case/: Contains code related to case-level outcome predictions.justice/: Contains code related to justice-level vote predictions.
Future Work / Roadmap
- Add comprehensive documentation and usage examples.
- Include scripts or notebooks for training and evaluation.
- Automate data preprocessing and feature engineering.
- Expand model interpretability and visualization capabilities.
- Package models for easier deployment or integration.
- Add unit tests and continuous integration setup.
Note: This README assumes the presence of a data directory with appropriate CSV files and feature configuration files based on the code context.