5 Things that I learned through the School of AI — And made me a better Machine Learning Engineer

Original article was published on Artificial Intelligence on Medium

5 Things that I learned through the School of AI — And made me a better Machine Learning Engineer

During the last two months of 2019, I was lucky to participate in the School of Artificial Intelligence. If you are not familiar with the School of AI, it is a first-class, hands-on training program on Artificial Intelligence hosted by Pi School, an educational project inside the startup district of Pi Campus, in Rome. The program aims at a multitude of profiles that have in common a great passion for Artificial Intelligence and at least basic stats and programming abilities. The program lasts two months, it is free for the students, and you also get a grant covering expenses such as flights and rent. There is a catch, though: it is extremely difficult to get in! Every time the program is hosted (twice per year), Pi School gets over 600 applications for roughly 20 spots. In my opinion, the program has two main strengths: first, you work on real AI projects assigned by top-companies; second, you get world-expert class mentoring.

My experience was very intense, and I got different lessons out of it. Here you can find what I feel are the five most important points that I learned at Pi School.

Credits: Pi School / Giuseppe Chiantera

1: The Ability to start without Data

There are many differences between working on a Machine Learning project for a Kaggle competition and working on a Machine Learning project for a company. For a start, the availability of data: in the real-word Machine Learning projects, companies rarely provide a dataset, and, even if you are lucky to have one, it can be anything but useful. It can be because data is expensive, both in time and money. Or, very often, who is in charge of collecting the data has no Machine Learning experience. Many times, the company is sure to have a gold mine, but the truth is that the data can bring little to no value.

It can be tough to find yourself in a situation where the client is pushing you to build the next state-of-the-art model out of a ten-rows messy-spreadsheet.

Even though your situation is not ideal, you are far from lost! Once you understand the real needs of the company, you can explore different roads. Collecting a dataset by scraping the web is an overlooked solution that can sound complicated, but it can be very effective and easy to implement. You can search for state-of-the-art models that target a problem similar to yours or generate a fake dataset to start building your data-preparation pipeline while waiting for the company to provide you with the actual data. An approach that I found very useful for my project, which was about NLP, was to download a pre-trained state-of-the-art model for a similar task and use it to generate a naive synthetic dataset. Then I adjusted some chunks of the dataset manually, and I managed to build an almost-ideal dataset incrementally without effort. Wrapping up, if you find yourself stuck without data, don’t waste your time waiting, but be proactive: your exploration will make you richer.

2: The Importance of Fast Prototyping

When someone hires you to work on a project, you have to provide updates on the progress. At the School of AI, we met our stakeholders once a week to do so. In my opinion, there is no better way to describe your advancement than illustrate it with a working prototype. Don’t get me wrong: in a week, you won’t have time to build a production web-server and some app equipped with a beautiful frontend. But you can code some basic HTML page in a couple of hours, and if you have a few more left, make it interactive and use it to show your model. An ugly-looking but working web page is far better than any verbal explanation of some complex mechanisms; moreover, it will show your boss that you spent your time producing something that works. Especially if you come from a background with no opportunity to learn the skills to build a basic desktop application or a simple Web app, I highly encourage you to invest some time in it.

Credits: Pi School / Giuseppe Chiantera

3: You don’t need to reinvent the Wheel

If you are working on a Machine Learning project for a company and you come from a Computer Science education like me, or if you are a programming enthusiast, you might get tempted to code everything by yourself: this is a big mistake. It is a big mistake for mainly two reasons: the first is that it will drain your time, and the second is that in 99% of the cases someone spent more time than you implementing the same component that you need, better than you would do, and made it available for free on the internet. It might seem obvious, but for me, it was useful, unexpected, and practical.

If you are new to Python, and you need some fancy components for your project, in my opinion, the first thing you should do is to look for some implementation on PyPi.org. Having a degree in computer science and as a teaching assistant in Algorithm Design, I find the process of importing and using libraries from PyPi easy, straightforward, and valuable. I now regret some of the nights spent studying so hard! Do you need some Python class that translates words in different languages? Or some component that detects hate speech? Or maybe you need some state-of-the-art cat detector? You can get all of these tools working in your code from PyPi with less than five lines, including your Google search.

4: You don’t need to understand every Detail

Once you managed to get your data and run some preprocessing, it is finally the time to try some models. Having a scientific background, I know that you will be tempted to learn about every variation of a model and understand all the nuances, to tweak every parameter to the utmost precision. A process that is often necessary if you are working for a Ph.D. and aim to push the current barriers of science. However, if you are in the industry, it might not be worthwhile to spend a week going through all the maths of a model to increase that 0.5% accuracy on the training data.

As of today, the many advancements in the field force us to go through various technical papers to understand how a model works inside, which might require weeks, depending on your background. When you are on a deadline, you learn that this is not feasible, and what matters is to know if you’re using a model properly, rather than understanding the subtle differences on the how. In these situations, the model validation needs special attention. An often overlooked way to find if you’re using a model correctly is to benchmark. Keep in mind that if there is some public benchmark for your task, it can provide you with valuable, reliable, and helpful insights.

5: The Importance of keeping Non-Technical

As we spend time on specialized websites on the field, following that page on Deep Learning memes and communicating amongst us, we often forget we are part of a niche. Even interacting with the programmer sitting next to us, which has to put our model in production, can be a difficult challenge. This barrier is especially true if our interlocutors don’t have a technical background, as it often happens with stakeholders. At Pi School, I saw myself in this situation many times, and I learned some tricks to do it successfully:

  • Be prepared with examples;
  • Do your best to validate them first;
  • Make a mindful effort to adapt your communication.

Follow these simple rules, and you will be 100% sure that you avoid misunderstandings and highlight the value of your work. I have realized it is fundamental to expose AI concepts in a clear, confident, and comfortable way to interact with different stakeholders and in different moments. Consider that, even when collecting data or buying some credit on AWS, your boss will need to know why it is fundamental. As I previously mentioned, prototyping can help to convey complex concepts easily, but it is not always possible to do so. In different moments of your path, your boss will determine some aspects of your career, and ineffective communication can preclude you from reaching your goals.