Learning Machines: Compression

Posted on
learning_machines itpnyu machine_learning

I’m beginning a machine learning course and our first task is to write an implementation of run-length encoding, a basic compression algorithm.

I chose to use a list of tuples as my data structure. Tuples for immutability and a list to maintain the sequence of characters and counts.

I am also coercing all the characters to lower case to increase the compression. This makes my compression algorithm slightly lossy.

Code and usage