Create log_reg.py

This is the one that was eventually used, maybe with some tweaks.