This is my personal code stash, where I explore some of my favorite topics, including:
- Categorical feature embeddings and encodings
- Model explainaibilty methods and their limitations
- Testing processes to detect and mitigate bias in machine learning models
See also vcarey-circlestar
You're a Towards Data Science Reader? Get the code used for my articles here:
Pretty pictures illustrate how stochastic regularization impacts entity embeddings in neural network models.
Read the article at TDS or Medium.
Exploring how messing with data can increase model accuracy and robustness, when using entity embeddings in neural network models.
Read the article at TDS or Medium.
A comparison of several methods of encoding categorical features for XGBoost machine learning models. Over-engineering of features can be problematic for missing or unseen codes. Results suggest that simpler methods, in conjunction with data manipulation, may work better for changing business environments or code sets that update frequently.
Read the article at TDS or Medium.
In which I test a proposed method for encoding categorical features for machine learning models, e.g. XGBoost and neural networks, and discover tradeoffs between performance and robustness, which suggest alternative ways to approach these features.
Read the article at TDS or Medium.
A deep dive into why two popular model explainability methods, SHAP and ALE, show opposite results in a public dataset. This leads me to go on about how model "explainers" don't produce "explanations". Instead, these methods should be viewed as diagnostic tests which must be interpreted thoughtfully.
Read the article at TDS or Medium.
A demonstration that common model fairness metrics can differ by group when the groups have different age profiles, even if everything else is the same. I argue that metrics alone are not useful in assessing fairness, but it's necessary to understand reasons underlying the outcomes.
Read the article at TDS or Medium.
Part of a series presented at the ROC Data Science Meetup. The article argues that it's important to be extra careful with model bias / fairness when key information is missing from your models. Relying on a bunch of weak predictors increases bias risk.
Read the article at TDS or Medium.
Part of a talk presented at the ROC Data Science Meetup. Explores some ways to mitigate feature bias which leads to unfair outcomes in a machine learning model.
Read the article at TDS or Medium.
Part of a talk presented at the ROC Data Science Meetup. Argues that we can't assume that machine learning models will "automatically" incorporate interactions to compensate for feature bias.
Read the article at TDS or Medium.
Part of a talk presented at the ROC Data Science Meetup. Demonstrates that the same fairness metric results can be seen whether a model is basing its decision on a sensitive feature, or on a legitimate predictor correlated with that feature.
Read the article at TDS or Medium.
A few other miscellaneous repositories are also here.
Code for a talk presented at the ROC Data Science Meetup. After my kid was born, we tracked his sleep data for ~2 years. He was a tough baby and so I read all the official parenting guides, which described what we "should" expect from "normal" children. The data gave me an opportunity to quantify my child's abnormality, but I also got data sets from other parents with similar data, and found that no baby was really normal. Is this selection bias, or are these expert guidelines mostly nonsense? Who knows, but it was an interesting personal data project. I actually have even more data from another child now and may want to revisit this topic in the future...
I ran into bugs while training and deploying a machine learning model at scale with Azure. The best way to get support was to write short programs to reproduce issues. This is code for those, luckily most of these issues are fixed now.