What I’ve learnt building a Machine Learning project for a medium-sized enterprise
By: Jack Tan
Tags: Machine Learning, Data Science, Lessons Learned, Python, Motivation

5 Lessons I’ve Learnt building ML models for enterprise

Photo by Siora Photography on Unsplash

1. Understand your ultimate goal and intermediate milestones

Mistake #1: I was obsessed with the conventional CRISP-DM process and focused too much on the general data mining tasks and deviated from the actual business goal — which was to identify the potential customers.

Self-illustrated by the author.

It is important to have a clear definition of what you are trying to achieve from the get-go and have this goal in context when laying out specified tasks following the CRISP-DM process. For instance, the research question for my topic is to find out how many additional customers are there in the observed period who might still have at least 80% chance to convert. After knowing this ultimate goal, I can brainstorm backwards to derive intermediate milestones to help me march towards this goal. In this case, I first have to find out the probability estimation based on the models with good prediction results, and for that, I have to feed relevant features and good quality data into the models for optimised performance. By mapping out all these milestones while adhering to the CRISP-DM blueprint, you make sure that you are following the right approaches in a data mining process, but at the same time not losing sight of your ultimate goal.

2. Walk a mile in their shoes

Mistake #2: I have always presented the results in a way how I interpreted them, slides that were filled with confusion matrices, classification report, and cool buzz words. The truth is nobody really cares how good your data are or how accurate your model predicts, what matters to them are what did your work achieve and how will your work affect other people’s work?

Photo by Jaclyn Moy on Unsplash

When working for a Machine Learning (ML) project, chances are you are not working alone. Whether you are working with other data engineers, research analysts, marketers, salespeople, or executives, put yourself in their shoes and try to see the big picture from their perspectives. Storytelling rather than fact-telling. For example, your marketing colleagues might be frustrated by failed marketing campaigns for not being able to convert the targeted audience. You can offer them a solution to identify potential customers, by helping them to increase the chances of a successful campaign. But if you presented your results by highlighting the accuracy of your models, they might not be able to immediately relate them. Thus, don’t just speak your language but also theirs.

3. You don’t have to build everything from scratch

Mistake #3: There were times when I attempted to build an ML algorithm from scratch and only halfway thru it did I realize that there was already a Python library for it.

Photo by Max Duzij on Unsplash

Whenever you have an idea to implement an ML model, don’t rush to build it from ground zero. No matter what programming languages you are working on, it is highly unlikely that you are the first one to implement it. Github is always a good starting point to explore existing projects similar to yours and Stack Exchange would probably be able to answer most of your questions. As building an ML model is not just about doing the prediction, your codes would also include snippets for data pre-processing and post-prediction performance evaluation. Building the entire codebase from scratch would consume a lot of your time and resources which would otherwise be better-spent for other workflows. Take Python, for example, there are many established ML libraries like Scikit-learn, TensorFlow, and PyTorch.

4. The 80/20 rule

Mistake #4: At first I thought my model was really bad and kept on finetuning the algorithm, little did I know that the culprit was actually the data I fed into the model. I ended up spending 80% of the time cleaning and preparing the data.

Photo by Austin Distel on Unsplash

Every data analytics rookie will learn this the hard way and I wish I knew this earlier. Just as the conundrum “garbage in, garbage out”, sometimes the most obvious thing is also the most unnoticed. When you are trying to ETL the data from its unadulterated source, make sure the integrity and the data quality are preserved in the process. Besides, the features you select to train an ML model should also fulfil the common convention of feature selection for not being redundant and non-informative. In the end, you should not be surprised at how little time you spent on the actual task of “building an ML model” but how much time you would one step prior — i.e. on the data preparation and cleaning. 80:20 ratio is a good rule of thumb to gauge this highly disproportionate distribution.

5. Learn how to learn

Mistake #5: I was initially complacent with some of the habitual practice I have been comfortably doing for a long time and refused to step out of my comfort zone. For example, I used a chain of and and or operators to conditionally check a string(s). My colleague suggested me to use Regex but I thought the learning curve was too steep. However, after I finally ported over to Regex, I realized how much leaner my codes have become and it definitely improved the versatility of string search.

Photo by Ben White on Unsplash

Attitude, attitude, attitude!

And not just any attitude, but the attitude to learn with an open heart. We live in an era where technology evolves so rapidly that a programming language you’ve mastered during your college times can quickly become obsolete the moment you land your dream job. Therefore, my advice in data analytics is to constantly explore and read about new developments in the topics you are familiar with. And whenever you are confronted with an entirely new concept, try to understand and embrace it instead of riding against the wave. Data analytics is, after all, a novel industry with every aspect of it regularly being flooded with new innovations and methodologies, be it evolutionary or revolutionary. In a long run, learning how to learn is what that really differentiates you from your peers. Of course, the importance of learning extends well beyond building an ML model and can also be applied in improving your general well-being too.