We crunch(ed) Artificial Intelligence Meetup – part three

For our third Meetup about putting Artificial Intelligence (A.I.) to practice, we were very happy to welcome Thomas Stalman and Peter van Lith. They had two quite different, but very interesting stories. And despite the beautiful weather and the national strike at the regional public transport, they had a full room of people to share their stories with.

20180627 Meetup (7)

Thomas started the evening with his story about Have you ever found yourself in the situation that you were in a city which you didn’t know so well and were looking for a nice place to have some dinner? Fear no more, because now we have AI, in the form of, which can help you find a nice restaurant in the city you’re in, based on another restaurant you do know and like in any other Dutch city. During his presentation Thomas took us on the journey of building a recommender system using, amongst other information, text mining on the reviews people gave about a restaurant.

20180627 Meetup (22) 20180627 Meetup (4)


Peter started his talk by showing us some videos on (humanoid) robotics football, with his own humorous commentary in the voice-over. Which was a brilliant introduction into the subject of robotics football. Something the TU Eindhoven is really good at, seeing that they won the World Championship for the fourth time in the last seven years. Peter took us on a whole different journey than Thomas did, our second journey of the evening took us along the path of creating (distorted) images for training purposes, the training of neural networks combined with existing programmed behaviour of the robots and how this should work on the robots in the end.

20180627 Meetup (29) 20180627 Meetup (25a)

All in all we really enjoyed the evening and we want to thank our speakers, but also our audience! It was so great to see you all coming (again for some of you) to our headquarters in Amersfoort. Thank you for your attention and questions and we hope to see you at our next Meetup, which will be on Wednesday 17 October 2018. Please sign yourself up for our The Analytics Lab Meetup group, to make sure you will stay informed about our Meetups!

We definitely hope to see you there!


Let R/Python send messages when the algorithms are done training

As Data Scientists, we often train complex algorithms in order to tackle certain business problems and generate value. These algorithms, however, can take a while to train. Sometimes they take a couple of hours, hours which I’m not going to spend just sitting and waiting. But regularly checking whether the training is done, is also not the most efficient way.

Now I started to use Telegram to send me notifications from R and Python to let me know when training is done. Furthermore, I’m also using it for example to send me notifications when pipelines / ETLs fail, which allows me to repair them as soon as they fail.

It’s really easy, so I thought I’ll share my code!

First, after you’ve installed Telegram, search for the BotFather, which is a bot from the app itself. When you text /newbot, and follow the instructions, it will create your first bot and gives you a token. Copy this!

Next step is to find the id to send messages to. Find your bot in Telegram and say something. Then, go to your browser and go to<token>/getUpdates, where it should show you your chat id.

Finally install the necessary packages for R [install.packages(‘telegram’)] and / or Python [pip install telegram]. And you’re ready!

For R, use the following function:

send_telegram_message <- function(text, chat_id, bot_token){ require(telegram) bot <- TGBot$new(token = bot_token) bot$sendMessage(text = text, chat_id = chat_id) }

And this one for Python:

def send_telegram_message(text, chat_id, bot_token):
import telegram
bot = telegram.Bot(token=bot_token)
bot.send_message(chat_id=chat_id, text = text )

Cmotions (111 van 174)_bijgesneden

Education for the Next Generation: a Handsign recognition project in Python

“Could you create a handsign recognition model which we can use to teach High School students a bit more about A.I. in a fun way?”
This is the question a few colleagues asked a couple of weeks ago, and ofcourse, the only real response here could be YES! I was immediately enthusiastic and started working on this fun project.

After a lot of messing around with different models, among which xgboost and neural networks, I found a real goldmine. Which, in this case, was the GitHub page of loicmarie, where he created a script to not only train such a model using an Inception Model (convolutional neural network classifier), but also use it. So I combined my own script with the ones of loicmarie and we were ready to go!

The Inception Model V3 is a deep learning model created by Google based on images from ImageNet.


The Inception Model is capable of classifying images in 1.000 classes with an error rate like a human would have. An impressive model, which isn’t only cool on its own, but can also be used for Transfer Learning. Which means we can use the knowledge from this model and expand it with our own images. Which makes it quite “easy” and “fast” to create a good performing model on our own images, which, in this case, are different handsigns.

When we arrived at the High School, we first gave the students an introduction to what A.I. actually is and where they encounter A.I. in their world. After that we introduced them to our handsign recognition model and gave them the assignment to create their own handsigns.

Cmotions (41 van 174) Cmotions (58 van 174)

After which they used a script to take their own pictures for each handsign.

Cmotions (111 van 174)_bijgesneden

And then it was time for us to put our computers to work! It started with a script to generate 10.000 pictures for each handsign. As soon as this script was ready, the training of the model started.

WhatsApp Image 2018-05-17 at 07.29.20

After 23 hours (!) all the models were succesfully trained and it was battle time! The group who could write the most flawless text, using their own handsigns, within 5 minutes was the project-winner!

Cmotions (158 van 174) Cmotions (170 van 174)_bijgesneden


Check out this video to see how it works:


Are you interested in our code? Please feel free to take a look at our GitHub repo!


Project Friday 2.2: let’s fly!

A little while ago we started with our second Project Friday; once a month (or so) we’ll lock some colleagues in a room with a couple of beers and a fun project. This project: give a drone a brain and an eye, so we can call itand make it do stuff for us. Why do we do this? Well, because it’s fun. and we learn a lot.

During our first session we mostly discovered how difficult it was to maneuver the drone around inside our office building. This didn’t put us off even a tiny little bit, we love a good challenge!

We’ve spend most of this session on thinking of a way we can use the camera on the bottom of the drone to make it follow a path we’ve laid out for it. If we put it simply: we want to make the drone to be able to follow a line on the floor. The first thing we did was create a line made out of white adhesive tape on our dark carpet. After that we held the drone above this line to take pictures. And then the thinking started… We had to make sure we took every possible deviation into account and thought of the best way to correct the drone if that deviation occured. Believe it or not, but this drawing helped us do that.

deviationsWhile thinking of every possible deviation and the correction that had to be applied for that deviation, we immediately programmed it into our Python script for the drone. As soon as this script was done, it was time for our first test flight. Which you can see in this video:

Ok… Not succesful yet. Enough work left for some more friday afternoons. As far as we’re concerned: bring it on!


Read more about what we did before


Escape Room Hackathon – Bewakingsbeelden!

Ik, de wiskundige Piet A. Choras, zat tot voor kort onterecht vast voor overfitting en was mijn ontsnapping aan het plannen, ik kwam er iteratief achter dat ik het niet alleen kon en heb hulp ingeschakeld. Teams van analisten hadden een middag de tijd om mij te helpen te ontsnappen uit de Penitentiaire Inrichting (π) door (data) analyse vraagstukken op te lossen. De oplossingen van de (data) analyse vraagstukken onthulden puzzelstukjes die mijn ontsnapping zeker zouden stellen.

Via deze weg wil ik alle deelnemers ABN Amro, Aegon, ANWB, Marug, PGGM, RDC en Vivat bedanken voor hun overlevingsdrang, strijd, vechtlust en Brute Force om mij uit mijn cel te kunnen bevrijden. Ik ben er dan ook zeer trots op dat het gelukt is en ik nu kan genieten van vrijheidsgraden. Wel is mijn ontsnapping vast gelegd door de bewakingscamera’s, zie hier het resultaat:

Met vriendelijke groet,

Piet A. Choras



ANWB helpt Piet A. Choras bevrijden tijdens de Escape Room Hackathon 2018!

De jaarlijkse hackathon van The Analytics Lab en Cmotions is gewonnen door de ANWB. Voor de derde editie van dit evenement werd de Atoomclub in Utrecht omgedoopt tot een ware escaperoom.Tijdens deze escaperoom hackathon draaide het om het bevrijden van Piet A. Choras, die vast zit vanwege overfitting in ‘Penitentiaire inrichting (inderdaad, Pi) De Atoomclub’. De deelnemende teams kregen een aantal analytische vraagstukken voorgeschoteld, waarmee zij stap voor stap verder kwamen in het bewijzen van de onschuld van de wereldberoemde wiskundige.  Zo moest de locatie van een gestrand pakket worden achterhaald, een corrupte gevangenisbewaarder worden gevonden en middels een aantal visualisatietechnieken de periode dat Piet A. Choras vast zat, worden berekend.

Opmerkingen van de bewakers en het verhoor met de gevangenisdirecteur werden zorgvuldig aangehoord en opgeslagen, wetende dat in elk detail een hint verstopt kan zitten. Ook in de aankleding van de gevangenis gingen de deelnemers op zoek naar aanknopingspunten: van de beeltenissen van historische wiskundigen tot de boekenkast van de Atoomclub, alle attributen werden met chirurgische precisie bestudeerd.

Door subtiele en minder subtiele hints, werden de deelnemers gaandeweg op het juiste spoor gezet, waardoor alle teams zich tijdens de finaleronde konden vastbijten in een classificatiemodel om Piet A. Choras te bevrijden. Op een mooie tweede plaats, op gepaste afstand van de overige deelnemers, is Vivat geëindigd. Maar net als vorig jaar bleef ANWB de concurrentie ruimschoots voor. Zij prolongeerden hun titel en wonnen de felbegeerde snoeppot en een bezoekje aan een “echte” Escape Room.

Gefeliciteerd ANWB!


R Experience @ University of Groningen, Eneco, Delta and Cmotions Talent Academy

Last year we started with our R Experience at the University of Groningen. Where we taught Marketing and Marketing Intelligence students not only the basics of R and RStudio, but also how to perform data preparation and how to use different modeling techniques. At the beginning of the five courses none of the students ever saw the R language before. At the end they felt comfortable enough to not only perform the steps we showed them, but to also play around with R themselves. For us as teachers that was such a big reward. Which became even better after we saw the way the students evaluated the course; they graded us of a 8.5 out of 10 and everybody would recommend the course to others.

Because both we and them considered this course to be a big success, we went back for a second round this year. And also this time we consider it as a big success with a grade of 8 out of 10 and again everybody would recommend the course to others!

After the second round at the University of Groningen we also taught the R Experience at Eneco, Delta and our Cmotions Talent Academy. The employees of both Eneco and Delta are going to make a switch to R from SAS and SPSS and this is why they needed a kickstart in coding in R. This is exactly why we created the R Experience; it is intended to help people with analysis skills getting familiar and comfortable with the R language.

In a short time we gained a lot of knowledge about R. From the basics to useful tips and tricks. -Eneco

We consider it a job well done since Eneco rewarded our course with an 8.5 out of 10, and Delta with an 8 out of 10! And let’s not forget our Cmotions Talent Academy, these young and enthusiastic students rewarded our course with an 8,6 out of 10. And also in these three groups everybody would recommend our course to others.  We’re so happy to hear all these enthusiastic sounds!

This is now my favorite tool! – Student Talent Academy

Did we make you curious about our R Experience? The course consists of five modules, it starts with an easy introduction in writing R code. In the following modules we’ll go deeper and deeper, where we start with explaining the differences between R and Rstudio and touch topics like importing data and how to use functions. The next module consists of data manipulation and preparation, like outliers, highly correlated predictors, near zero variance and missing values. And in the last module we’ll use caret to show how you could train practically every algorithm you want for classification purposes.

Interested in the R Experience? Contact us!



Delete Facebook account? First get your friends’ birthdays

A few weeks back there was the Cambridge Analytica Scandal at Facebook, where the consultancy company collected data of around 87 million Facebook accounts in order to trying to convince them to vote for Trump. According to The Washington Post Cambridge Analytica was able to access the data because 270k users downloaded an app and thereby gave access to their friends data, without their knowledge. Since of April, 9th you can check on Facebook whether your account has been accessed by Cambridge Analytica.

We discussed this scandal with a couple of friends and were talking about deleting our Facebook accounts. One of the arguments to not delete their account was that without FB, they wouldn’t know the birthdays of their friends. So I created a simple Python script that scrapes the birthdays of all your friends. Check it here.

Quite ironic though, scraping Facebook because you want to delete Facebook because someone else scraped Facebook.





We crunch(ed) Artificial Intelligence Meetup – part two

For our second Meetup about putting Artificial Intelligence (A.I.) to practice, we were very happy to welcome Gerard Verbeek and Erwin Konink from Luminis and Matthijs van der Kroon from Primed.IO.Together they entertained the forty-man audience with their interesting stories.

Gerard and Erwin told us how they simulated a training environment for their self-driving cars. They use a genetic algorithm to train an entire population of vehicles, it was really fascinating to hear their story on how this works. We also got to see the end result when they let two of their cars drive around during the presentation. It was amazing to see these little vehicles driving around and avoiding all obstacles in the room using sonar.

DSC03774 DSC03784

After that Matthijs kept our attention with his story about, which is a platform that helps to easily put data science solutions into practice. He showed us how this platform is used at RTL Nederland. It was really nice to see how IT, data science and human knowledge and intelligence all come together in this platform.


All in all we really enjoyed the evening and we want to thank our speakers, but also our audience! It was so great to see you all coming (again for some of you) to our headquarters in Amersfoort. Thank you for your attention and questions and we hope to see you at our next Meetup, which will be on Wednesday 27 June 2018. Please sign yourself up for our The Analytics Lab Meetup group, to make sure you will stay informed about our Meetups!

We definitely hope to see you there!


Project Friday 2.1: let’s fly!

After all the fun we had, while also learning a lot, during our first Project Friday “Artificial Intelligence meets Coffee” project We felt it was time for a second project. So this time, instead of giving an eye and a brain to a coffeemachine, why not try to do the same to a drone?! What if we could make a drone come fly up to us when we call for it and tell it what to do after it recognizes who we are…

Our second Project Friday was born!

You might wonder what Project Friday actually is… Well, that’s an easy one; once a month(or so) we’ll lock some colleagues in a room with a couple of beers and a fun project. Why do we do this? Well, because it’s fun and we also learn a lot.

To get started with this Project Friday, we first needed a drone! We chose for the Parrot AR 2.0 Drone, because you can easily connect this drone to your computer to take over the command.


Most of this first afternoon was spend on trying to fly the drone inside. Which, we found out the hard way, isn’t so easy! A few walls were hit and we did see some people running for their lives, but in the end of the day everbody, including the drone, survived. All is good!

We even managed do give a few commands to the drone from the computer. Although the effect of the commands weren’t as succesful as we had hoped…


What we’ve learned so far:

  • flying a drone inside is difficult,
  • connecting to the drone from the computer is easy,
  • giving the right commands isn’t easy at all,
  • we love being pilots!