Lee Hodg

Category Archives: Python

A/B Testing

A/B Tests and Experiment Size

Let’s say you’re running an A/B test. Maybe you want to test how many conversions you will get if you change the design of the Signup page or the wording. You split users landing on your site into 2 groups – the control group and the experimental group. Those in the control group see the […]

NLP Pipelines with NLTK

Often with Natural Language Processing (NLP) applications a pipeline is useful to take the raw text and process it and extract relevant features before inputting it into a machine learning (ML) algorithm. Normalization From the standpoint of an ML algorithm, it may not make much sense to differentiate between different cases of a word – […]

Jupyter x AWS

Setting up Jupyterhub on AWS

This guide will be about setting up the fiddly bits when deploying a Jupyter Hub to an AWS instance. It won’t go into explicit detail about absolutely every step as the docs already do a great job of that. The purpose of this post is to discuss the things I found tricky after the install […]

Backprop: coding it up

In a previous post, I walked through the maths of back-propagation (“backprop”). Here I will go through the implementation in Python (heavily based on Andrew Ng’s course). I’m going to use the alternative form equations (in the last blog post I denoted those with a tilde, but now I will drop that tilde). This means […]

Django-Logo

Django database optimization

The Django ORM makes interacting with the database a breeze, but without due care can also lead to poor performance. Example models Let’s say we have 2 very simple models, an Artist and her Artwork: Fetching artworks for each artist Imagine we had a user listing endpoints (for example in a Django rest framework API), […]

Rover Mars

Deploying Imageproxy with AWS Fargate

imgproxy is a fast and secure standalone server for resizing and converting remote images. The main principles of imgproxy are simplicity, speed, and security. I wanted to use imgproxy with AWS to serve images up from an s3 bucket and have it also sit behind a Cloudfront distribution. At the time, I didn’t see any […]