Mildenberger, M., Marlon, J.R., Howe, P.D., & Leiserowitz, A. (2017) “The spatial distribution of Republican and Democratic climate opinions at state and local scales,” Climatic Change. https://doi.org/10.1007/s10584-017-2103-0.
- KNN
kNN_2020.py: Python code for the distance weighted k-Nearest Neighbors predictor, along with the local linear regression prediction for the margins of victory. - Decision Trees
DataParser.java: Java code for processing data to construct decision trees.
DecTree.java: Java code for building decision trees and performing n-fold cross-validation.
DecTreeNode.java: Java code to represent a single node in a tree.
Project.java: Java code to run various methods in DecTree.java. - Naive Bayes
NaiveBayes2019.py: Python code using the naive bayes classifier to predict party affiliation for the 2019 data.
NaiveBayes2020.py: Python code using the naive bayes classifier to make predictions for the 2020 US election.
Boxer (Interactive Comparison of Classification Results): https://graphics.cs.wisc.edu/Vis/Boxer/
States (Presidential): https://www.math.wisc.edu/~jenny/States/
Congressional Districts (House): https://www.math.wisc.edu/~jenny/CD
Counties (Presidential): https://www.math.wisc.edu/~jenny/County