Home > Netflix, linux, math, programming > Netflix Entry 1: Test runs

Netflix Entry 1: Test runs

December 8th, 2008

I decided for my first 2 entries into the Netflix prize, I would see just how good/bad current scores are. For those who have never heard of the Netflix prize, see my post here.

First, I will predict a 3 for every rating just to see how much deviation there really is from that average ranking. And for my second submission, I just use a random number between 1 and 5 to see how well a random prediction fares with the rest of the leaderboard. After setting those two scripts up and submitting, I never got back a score. I’m not that dissappointed but maybe they saw that i was just sending them random/constant data and decided I was not worth their time. Made me feel kinda sad…

Also, I was having some difficulties initially writing my script in python, so I decided to just hurry up and do it in PHP and then port it python later. The first thing i noticed between the two scripts was just how much faster python is than php. I ran each script three times and calculated the averages. Below are the results:

Language Script Time
Python Constant 30.037 seconds
PHP Constant 40.388 seconds
Python Random 9.312 seconds
PHP Random 19.464 seconds

I know I’m probably beating a dead horse here but python is WAY faster. And nothing really intensive or complex is going on here: string concatenation, random number generation, and writing to a file. That is it. Python performs the constant value prediction ~50% faster and the random value prediction ~25% faster.

As I get more comfortable with python and its vast library of scripts, it will definitely become my goto scripting language. For all you Ruby enthusiasts, especially you, Travis, the ruby language is very well thought out, but until anybody can come close to NumPy/SciPy, I will stick to python for now.

Netflix, linux, math, programming

  1. No comments yet.
  1. No trackbacks yet.