Kaggle Telematics Competition Write-up March 25

Posted on Apr 2, 2015

This post is meant to showcase some of the work of the students of the first cohort of the NYC Data Science Academy Bootcamp. We competed in the AXA Driver Telematics Analysis Kaggle competition and this is a write-up done by a few of our team members.

Blog Post Authors(in order of appearance):

Julian Asano - Project Management Framework
Timothy Schmeier - Trip Animator
Sylvie Lardeux - Attribute Engineer
Alex Adler - Trip Matching Maestro
Jiayi Liu - Feature Creator and GBM Mechanic

Who might be interested in this blog post:
  • Other AXA Kaggle teams that wish to compare and contrast results and techniques of our team with their own.
  • Potential future Kagglers who want to hear the experiences of a first time competitor.
  • Potential employers looking for an introduction to the hard work and creative problem solving skills of my fellow students.

The Telematics Competition Set-up:

The goal of the competition was to develop an algorithm to create driver specific signatures based upon nothing but X-Y coordinates in a number of csv’s. We were given 2736 directories, corresponding to 2736 different drivers. In each directory were 200 csv’s, one for each trip assigned to that driver.

Each row of a csv corresponds to one second of a driver’s trip. To test our driver signature algorithm, the organizers substituted an unknown number of trips in each driver’s directory with false trips that were driven by another driver. We don’t know which trips are driven by the driver of interest, all we know is that the driver of interest has the majority of trips in that folder.

Our goal is to submit a file identifying the correct probability of whether each trip belongs to the driver associated with their directory. This took the form of a csv with 200*2736 rows and the probability that that trip was driven by the driver of interest.

Project Development

My primary goal for this project was to get experience managing a data science project. I wanted to apply an agile project development model to our problem which would eventually iterate through the development cycle multiple times until the project deadline.
Traditional Waterfall Develpment Method vs. Iterative Development Method
This is in contrast to the waterfall development method which I believe would not have appropriately utilized our team size and talent, and would not have lent itself to the competitive framework we were contrained by. The waterfall method would also have limited us to our initial vision of our final model without giving us ample room to revise our requirements based upon interim results.

Whereas, with the iterative model, we were able to create multiple working models and take advantage of many opportunities to test our models upon the public leaderboard (71 submissions to be exact). It allowed us to redefine basic assumptions late in the game which bumped our score tremendously in the final week of the competition.

Other Considerations


We were instructed on the Git framework in our first week of the bootcamp. This allowed us to immediately implement a distributed version control system and allowed us to get used to working with our code as a team.


Alongside with Git, the first two weeks of the bootcamp were an intense introduction to R and we used R exclusively for the competition. It was the ideal choice for the data manipulation, visualization, and statistical learning methods we needed to implement.

Student Goals

As project manager I had to keep in mind that this was indeed a bootcamp student project. We were not a professional Kaggle team, and as such, I couldn’t put demands on team members like I would in a purely professional context. My main goal was to make sure that this was an educational experience for every member of the team.

After that requirement was met, I had to take a laissez-faire approach when it came to dominating the available time of the team members (especially my own time). Being in the middle of an intensive bootcamp experience meant that free time was very hard to come by. Luckily, our team was blessed with some extrememly motivated and capable members who you will hear from shortly. They went above and beyond the call of duty and won us all a Kaggle finish we are be proud of.


From my own perspective, I knew that there would be a drastic difference between my old job and my future job. I wasn’t exactly sure how guiding a large team of document review attorneys would translate to managing a team of PhD’s, but I was sure I couldn’t pass up the opportunity to try it in a relatively low-stakes educational environment with a bunch of courageous boot campers.

And so, in the second week of the boot camp, I pitched my idea to the class and offered a position on the team to anyone that wanted to join. I couldn’t have ventured a guess as to who would want to join my team after only the second week, but the topic must have sounded interesting because everyone in the room wanted to get involved. What I thought would be a team of 2-5 turned out to be a team of 14.

In order to make things manageable I decided to split the team into two sub-groups. This allowed me to make our weekly team meetings more manageable and allowed multiple people to step into similar vital roles within each group to make sure that everyone was involved near the center of the project. Eventually we merged the teams back together to maximize our performance by utilizing the best techniques and code from both groups.


For the first few weekly meetings I placed myself in charge of guiding the conversation and delegating responsibilities for both sub-groups. Over the course of the next few weeks, I noticed that Jason (Jiayi) very naturally fell into a leadership position within his group. His dedication to the project and prior experience with machine learning algorithms made it a very easy decision for me to hand him a leadership role within his group.

This freed up a large portion of my time and it allowed Jason to more easily work on concepts I was not familiar with at the time. I was mostly excited to see what he could accomplish with his group when he was in charge. As you’ll see, Jason continued to serve as the lead architect of our final algorithm and managed to tweak the code to give us a finish in the top 9 percent of all the teams in the competition.

In Practice

Our workflow revolved around weekly meetings at which members of each sub-group would first go over the research or code they had been working on for the previous week. The second portion of the meetings involved an open table style brainstorming session to decide on ways to improve our model. The meetings concluded with task assignments for the next week, which was done mainly on a volunteer basis in order to be sensitive to our schedules and needs.

Meetings in the first two weeks consisted of brainstorming wild ideas as well as creating a framework for the simplest model we could come up with. In order to reap the benefits of an iterative project development model, we needed to create a working algorithm as soon as possible. Within a few weeks we were making submissions using the same basic framework that we ended up employing in our final submission.


The benefit of this model was that we could send people down possible rabbit holes without it holding up the whole group. As long as we were trying new models and evolving our skill set, we were making progress. We could afford to chase down ideas like Fourier Transformation Matrices and Dynamic Time Warping (no, I didn’t just make that up) with minimal risk to the overall success of the project.

In the end, between the multiple trip matching algorithms and Sundar’s work integrating Support Vector Machines into an unsupervised problem, I was sure we made the right choice by using the agile development model.


I am very happy to report that the team exceeded our own expectations and posted a very respectable score of .90926 landing us in position #134 out of 1528. We seemed to have overfit our model less than our immediate competitors since we jumped up 8 places once we processed our score using the true (private) test data. WOOT!


I’ll get the code section of our blog posts started with my modest buildData.R script. One problem I wanted to avoid early on was a lack of interoperability. If everyone had their own idea about how to structure their data it would make it difficult to incorporate everyone’s code in the end. In order to keep everyone as consistent as possible, I created a script for the team to use to read in the 547,000 csv’s as easily loadable binaries saved on our individual machines.

It was based upon Lauri Koobas’ rebuild-data.R code in the Kaggle Forum. I figured that if we all started using the same foundation it would simplify the process of working with each others’ code later on down the line.

# Set WD to directory containing the 'drivers' folder.


# Use fread from the data.table package to read in x and y coords
# Apply trip ID to new third column in data frame
fread.and.modify <- function(file.number, driver) {
tmp <- fread(paste0("drivers/",driver,"/",file.number,".csv"), header=T, sep=",")
tmp[, tripID:=file.number]

# Pull down list of driver directories and create a home for binaries
driverlist <- list.files("./drivers/")
dir.create("./data/", showWarnings = TRUE, recursive = FALSE, mode = "0777")

# Loop through the driver list and use rbindlist to bind data from
# x, and y columns to the specific driver data frame
for (i in 1:length(driverlist)) {
onedriver <- driverlist[i]
drives <- rbindlist(lapply(1:200, fread.and.modify, onedriver))
save(drives, file = paste('./data/DriverData',onedriver, sep=''))

With the preliminaries out of the way, I’d like to guide you to our next blog post where Timothy Schmeier will tell you about his trip visualization algorithm when it is ready.

About Author

Related Articles

Leave a Comment

No comments found.

View Posts by Categories

Our Recent Popular Posts

View Posts by Tags

#python #trainwithnycdsa 2019 2020 Revenue 3-points agriculture air quality airbnb airline alcohol Alex Baransky algorithm alumni Alumni Interview Alumni Reviews Alumni Spotlight alumni story Alumnus ames dataset ames housing dataset apartment rent API Application artist aws bank loans beautiful soup Best Bootcamp Best Data Science 2019 Best Data Science Bootcamp Best Data Science Bootcamp 2020 Best Ranked Big Data Book Launch Book-Signing bootcamp Bootcamp Alumni Bootcamp Prep boston safety Bundles cake recipe California Cancer Research capstone car price Career Career Day citibike classic cars classpass clustering Coding Course Demo Course Report covid 19 credit credit card crime frequency crops D3.js data data analysis Data Analyst data analytics data for tripadvisor reviews data science Data Science Academy Data Science Bootcamp Data science jobs Data Science Reviews Data Scientist Data Scientist Jobs data visualization database Deep Learning Demo Day Discount disney dplyr drug data e-commerce economy employee employee burnout employer networking environment feature engineering Finance Financial Data Science fitness studio Flask flight delay gbm Get Hired ggplot2 googleVis H20 Hadoop hallmark holiday movie happiness healthcare frauds higgs boson Hiring hiring partner events Hiring Partners hotels housing housing data housing predictions housing price hy-vee Income Industry Experts Injuries Instructor Blog Instructor Interview insurance italki Job Job Placement Jobs Jon Krohn JP Morgan Chase Kaggle Kickstarter las vegas airport lasso regression Lead Data Scienctist Lead Data Scientist leaflet league linear regression Logistic Regression machine learning Maps market matplotlib Medical Research Meet the team meetup methal health miami beach movie music Napoli NBA netflix Networking neural network Neural networks New Courses NHL nlp NYC NYC Data Science nyc data science academy NYC Open Data nyc property NYCDSA NYCDSA Alumni Online Online Bootcamp Online Training Open Data painter pandas Part-time performance phoenix pollutants Portfolio Development precision measurement prediction Prework Programming public safety PwC python Python Data Analysis python machine learning python scrapy python web scraping python webscraping Python Workshop R R Data Analysis R language R Programming R Shiny r studio R Visualization R Workshop R-bloggers random forest Ranking recommendation recommendation system regression Remote remote data science bootcamp Scrapy scrapy visualization seaborn seafood type Selenium sentiment analysis sentiment classification Shiny Shiny Dashboard Spark Special Special Summer Sports statistics streaming Student Interview Student Showcase SVM Switchup Tableau teachers team team performance TensorFlow Testimonial tf-idf Top Data Science Bootcamp Top manufacturing companies Transfers tweets twitter videos visualization wallstreet wallstreetbets web scraping Weekend Course What to expect whiskey whiskeyadvocate wildfire word cloud word2vec XGBoost yelp youtube trending ZORI