- Dataset:
Reddit_Data.csv - Training and Evaluation Scripts
- Model Prediction Tools:
manual_test.py - SHAP Explanation Tools
- Scripts for Generating Plots and Analysis:
plot_hyperparameter_effects.pyrank_best_models.py
git clone https://github.com/aonlo/redditsentimentanalysis
cd redditsentimentanalysis
Use a virtual environment and install the required packages (e.g., TensorFlow, pandas, matplotlib, scikit-learn, seaborn, SHAP):
pip install -r requirements.txt
Run the main training script to conduct the full grid search:
python sentiment_training.py
This will:
- Train all 54 model configurations
- Save each model
- Record evaluation metrics to
grid_search_results.csv
Once training is complete:
python plot_hyperparameter_effects.py
python rank_best_models.py
- Top 10 models will be saved in
top_10_models.csv - Metric comparison plots will appear in
plots/andtop_model_plots/ - Use
manual_test.pyto load any trained model and test predictions on manual input or a new CSV file.
If SHAP is enabled in manual_test.py, the script will generate SHAP visualizations for word-level attribution in sentiment predictions.