Amazon Aurora MySQL + Python

Ok, so this isn't the sexiest topic, but if you're completely stuck the way I was several times today, maybe you're happy you found this post.

Today I needed to spin up a database I want available to students at the Newmark Graduate School of Journalism and also colleagues at Quartz. I also want to connect to the database from my home and the school using Python.

Since we use Amazon's web services, and I wanted to show the students SQL, I decided to give the AWS Aurora system a whirl — specifically the MySQL-compatible version.

As with many things AWS, it was a bit of a slog to get set up ... and I've decided to jot it all down while it's fresh so I can remember how the heck I did it (and show my students).

After a few tries, here's how I finally got set up:

Heel, Rotson! My list of computer-generated dog names

Shadoopy. Dango. Ray-Bella. Figgie.

If I told you those were names of actual dogs in New York City, would you believe me?

They're not. They were generated by a machine-learning algorithm mimicking dog names after it "studied" a list of 81,542 dogs registered in NYC.

The experiment, which took just a few hours Saturday, was something I've wanted to try since I saw the playful, awesome work of Janelle Shane and her experiments using neural networks to generate paint colors, guinea pig names and Harry Potter fan fiction.

I happened to have some free time, and decided to give it a shot. Along the way I:

  • built, in mere minutes, a computer in the cloud powerful enough for machine learning
  • made and played with a recurrent neural network
  • learned a little more about machine learning
  • had a lot of fun

The program generated lots of names, including many that existed in the original data. Once I filtered those out, I had almost 400 computer-created, mostly plausible dog names. Here are some of my favorites:

Rotson
Dudly
Lenzy
Murta
Cookees
Geortie
Dewi
Chocobe
Sckrig
Booncy
Cramp
Dango
Ray-Bella
Santha
Coocoda
Satty
Bronz
Shadoopy
Mishtak
Figgie
Grimby
Phince
Bum-Charmo
Soma
Blant
Snowflatey

If you'd like to geek out about how I did this, read on. You can do it, too.