3

genrules: using a genetic algo to find high risk cases | Andrew Wheeler

 2 years ago
source link: https://andrewpwheeler.com/2021/12/13/genrules-using-a-genetic-algo-to-find-high-risk-cases/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

genrules: using a genetic algo to find high risk cases

So I recently participated in the Decoding Maternal Morbidity Data Challenge. I did not win, but will share my work anyway. I created a genetic algorithm in python to identify sets of association rules that result in high relative risks, genrules. Here I intentionally used a genetic algorithm, with the idea I wanted not just one final model, but a host of different potential rules with the goal of exploratory data analysis.

You can go see how it works by checking out the notebook using the nuMoM2b data (which you have to request, I cannot upload that to github). Here are rules I found to predict high relative risk for infections:

AM-JKLWHwMFq_XXjGnjuneNzOAIvGNEbWYiXmpNvc9BEYnFSLq3nfnLr2mrUUtsINtUaxKCi8aR4kRn9enX16aMVl_37vTPwcodUbAA0ZYzpNkITDqLZGjCVEbiPCgmZIegVfH8pb8b7fc7BhV7dQEtUIvCX=w781-h541-no?authuser=0

And I have other code to summarize these, it happens to govt insurance is very commonly in the set of rules found.

AM-JKLUHfwwkqhyeuTkDJP7ZSvgs5_q9niaWqnffA55Kf6lkCRSmDAG6AAGNVRkVCC5dFhX2S28N5uvfh6OTJ0r7InY7xDKv9VmpXA5KlT-Nr4mGBke6pv7bIMrzGd9llzng2gpuZBYuPI2UYO4p86M_P-If=w497-h658-no?authuser=0

I actually like it better just as a convenient tool (that can take weights), and go through every possible permutation of a set of categorical data. I uploaded a second notebook showing off NIBRS and predicting officer assaults (see my prior blog post on this).

AM-JKLVtYtpUnMfvSAAtgdfv-BPvlBNUpeyp8lGLibC7QgSP1Z2E8e8ZpIz4CvUjHMVSgfifmdLMiLHd3zK6PZzThDnH8iWuxUgFzSyt6utDdoh0dDvilPXY5dMLdL0F_iZby7RxywyJ8gOdJJJV_VkceBfF=w921-h557-no?authuser=0

So here one of the rules is stolen property, and the assailant using their motor vehicle as a weapon. So perhaps people running with stolen property in a vehicle? (While I built quite a bit of machinery to look through higher level rules, why bother with higher sets than 3 variables in the vast majority of circumstances.)

This shows the risk of competing in challenges, so a few weekends lost with no reward. This was a fuzzy competition, and something that appears I misread was in the various notes the challenge asked for the creation of novel algorithms. It appears from the titles of the winners people just used typical machine learning approaches and did a deep dive into the data. I did the opposite, created a general tool that could be used by many (who are better experts on the topical material than me).

Also note this approach is very data mining. While I use p-values as a mechanism to penalize too complicated of outcomes in the genetic algorithm, I wouldn’t take those at face value. With large datasets you will always mine some sets that are ultimately confounded.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK