You’ve arrived in the right place! The best way to understand what Antelope does is probably just to give it a quick try. This project contains ships with demo code that works with the ACM SF Chapter’s Best Buy data set. Just follow the steps below.

Should you have any issues please reach out at our Google Group.

Download necessary files

Start out by creating a working directory in a location of your choice


Create additional directories you will need

export ANTELOPE_CACHE=/tmp/antelope

Grab the Antelope source code from Github

git clone antelope

Download data sets from Kaggle

You will need to create an account with Kaggle ahead of downloading the data sets. Then visit the data download page.

Use your browser to download the following files, placing them in $ANTELOPE_DATA:

Place the training data in the appropriate folder, e.g.,

mv ~/Downloads/train.csv $ANTELOPE_DATA
mkdir -p $ANTELOPE_DATA/product_data/products
mv ~/Downloads/small_product_data.xml $ANTELOPE_DATA/product_data/products

Sort the training data set so that events are ordered according to click time


head -n1 train.csv > train_sorted.csv
tail -n +2 train.csv | sort -t',' -k5 >> train_sorted.csv

Generate training data

You will now use Antelope to generate training data. To proceed you must first install Scala with sbt by following the sbt installation instructions for your platform. Then go ahead and start sbt.

cd $ANTELOPE_DEMO/antelope

Within sbt execute the following commands to generate training data

project demo-best-buy

Now you should have training data in a file. You can have a quick look at it

less $ANTELOPE_TRAINING/training_data.csv

Train a model

These instructions use R. You can also train your model using Vowpal Wabbit. Training a model is quick and easy but if you don’t have either of these tools installed you might want to skip ahead to the next section. This demo ships with effective model parameters.

r --no-save < $ANTELOPE_DEMO/antelope/scripts/r/train.r
cat r_logit_coef.txt

Your coefficients should look like the following


The coefficients you have generated will be read from this file when scoring the model.

Score the model

Now back in sbt execute the following

project demo-best-buy

You should see something like the following final output

Miss Analysis
Candidates for spelling correction
extra space: 144
missingSpace: 35
extraLetters: 5
missingLetters: 3
changeLetters: 4
transposeLetters: 0
total correctable: 191
total missed 2790
Overall success rate: 8605/10000 hits for 86.1%
[success] Total time: 12 s, completed Aug 10, 2015 5:31:13 PM

That’s it, you’ve successfully trained and scored a model! In this case the hit percentage represents the fraction of rankings that contain the product viewed by the user within the first top 5 results.

Creating your own model

The demo model is implemented in You might first try removing features and comparing performance. After that, try writing your own features.

The demo framework instantiates the model in If you want to swap out model classes, go ahead and modify this file. You may find it more intuitive to start out using the simpler, which uses nested classes to define features, which can make simple models simpler to follow.

What did you think?

Please join the Google Group to let us know.


You’re all set up to see product search results live in the web app. See the Best Buy demo web app.

< Back to Documentation Index