When and When Not to Use Machine Learning in Your Business Strategy
Last Updated on July 25, 2023 by Editorial Team
Author(s): Andrea D’Agostino
Originally published on Towards AI.
Going blindly for an ML-powered solution could lead to unseen perils. Explore the benefits and challenges of adopting machine learning models to make informed decisions
Itβs not an obvious question. For novice data scientists, pushing machine learning models right away can be a mistake.
In fact, simpler rule-based solutions can be efficient and easier to implement, saving large sums of money in the process.
As the adoption of machine learning in various industries increases, there is a growing trend toward wanting to use this approach wherever it can be applied.
Machine learning is certainly powerful, but it is not a magical spell that can solve all our problems.
In this article, Iβll talk about when to use machine learning, and the questions worth asking yourself before starting a project and exploring the various approaches available.
Before we begin, Iβll look at what a machine learning-based solution does in general.
Machine learning is an approach to learning complex patterns from existing data. It then uses these patterns to make predictions about unknown data.
What does it mean to learn patterns? I will start by talking about this part, and then touch on the topic of data and the creation of predictions.
All of this journey will culminate with an explanation of the different trade-offs to consider when we consider developing a project based on machine learning.
Letβs begin.
Pattern learning
A machine learning model is a system that attracts technologists and non-technologists alike for its ability to βlearnβ from the data it observes (hence the term supervised learning).
If you are interested in reading more about machine learning in general, read the article below U+1F447
In supervised learning, the system learns the relationships between input and output pairs and reconstructs a mathematical function that explains (as best as possible) the mentioned relationship.
For example, if we wanted to create a machine learning model to predict real estate prices in our region, we would have to train our model on the input (the features of the houses, such as the presence of a garden, a fireplace, or the number of square meters and so on) and on the output, the price.
The model in question will use the features of the various houses to which it is exposed to understand the price associated with these features. Once properly trained, the data scientist will only need to provide the model with the features of a property to receive a price.
All this is nice and interesting but introduces a constraint to consider:
ML systems are only really useful when there are patterns to learn from.
In fact, a sane person would never go and ask for funds and resources to develop a machine learning system to predict the next roll of the die β it would be random, and the model would learn nothing at all!
This poses another question before us: how do we know that patterns actually exist in our data at all?
It is often a completely overlooked question, and the responsibility of finding what is not there is delegated to the machine learning model. Sometimes the pattern might indeed exist, but the dataset could be incomplete or not rich enough for it to emerge.
If our solution can be expressed correctly by a pivot table in Excelβ¦there is nothing wrong. We donβt need a machine learning model.
Therefore, we donβt need a machine learning model if what we want to predict is the result of simple operations, which can be automated thanks to a script perhaps, or if we know that the patterns are absent or random.
However, if the patterns are complex and difficult for a human to process (like mapping hundreds of features of a property to a price), then machine learning will most likely be useful.
Constrained by data
Because machine learning depends on data, itβs important that that data exists in the first place.
I often come across customers who invest time and resources in designing machine learning systems based on low-quality and unreliable data.
This is a central theme: a machine learning system is to be contemplated when we have (or are able to retrieve) quality data that we know for sure contain information about the phenomenon we want to model.
There are cases where it is possible to use machine learning without data. This is the case with continual learning. In this case, the ML models are put into production and learned as real user data is passed through it. Such models will perform poorly at first, but then gradually improve.
When predictions are too βwrongβ
ML systems solve prediction problems. To predict translates as estimating the value of something in the future.
β¦but sometimes, we are not satisfied with these predictions.
Letβs think about the term βmodellingβ:
- a child βmodelsβ a castle with sand
- a pastry chef uses βmouldsβ to create sweets
- a blacksmith uses a mold to create a tool, such as a hammer or tongs
As data scientists we use the past to shape the future.
Data is our metal; machine learning is our mold.
Now, based on the quality of our data, our model will be able to generalize a βshapeβ such that it also fits other unknown data that will come in the future.
But a very large shape can accommodate our data wellβ¦.
The theme of the error of prediction comes into play.
When we evaluate the machine learning model, we do so using business and non-business metrics. Using valid and sensible evaluation metrics allows us to correctly manage and evaluate machine learning systems.
It is therefore important to understand how to evaluate a prediction system with a clear evaluation metric for the business.
For example, for the housing price prediction problem, using a metric like the MAE (mean absolute error) can be useful and is a metric that is easily understood even by non-tech guys.
Doing this allows us to implement an ML system sensibly because it will be easy to interpret its performance.
Just automate everything!
If we do the same task over and over again every day and itβs made up of patterns, then contemplating machine learning is the right thing to do.
As Iβve written several times before, a data scientist is an automation enabler.
In fact, good problem-framing can improve business economics significantly with ML.
If we can identify that there is recurring, structured data that follows a predictable logic, then machine learning can help us build models that automate those tasks. This saves us valuable time and resources, as well as reducing human errors.
Automation through machine learning not only simplifies day-to-day tasks, it can also reveal hidden insights in data and provide valuable insights for making strategic decisions.
Furthermore: we also need to think about how much we need to automate.
If we have to automate several operations a day (in the order of hundreds to tens of thousands), surely machine learning can help us!
The cost of prediction
Letβs talk about prediction again, but this time in monetary terms.
Letβs make it clear here, too: our model will ALWAYS make mistakes. Sometimes big, sometimes small, but it will always make them.
When the cost of a large prediction error is low, then machine learning is worth considering as a solution to our problem.
An example of recommendation engines:
- the model is trained on the behavior of the human
- the model offers a recommendation
- the user chooses whether to follow the recommendation or not
In case the user doesnβt choose the recommendation, what happens? Nothing! The cost of a wrong prediction is close to zero.
If, instead, the user buys something thanks to that recommendation, then both the user and the store owner are happy. Bingo.
The opposite is the case in the medical field: a bad prediction applied by a model on an X-ray for the diagnosis of a serious disease has a very high cost. In that case the consequences can be catastrophic. The same goes for autonomous driving.
Should these last two cases remove the use of machine learning as a diagnostic tool or as an autopilot? Certainly not. But it must be considered how much the human is included in the process (such as a doctor who is assisted during the diagnosis or a driver who takes control of the car, disengaging the autopilot) and the impact these mechanisms can have on the general progress of the world.
Conclusion
The adoption of machine learning requires careful and informed evaluation. A lot of money goes into it because setting up such a system is expensive and requires a lot of skills from multiple professionals.
We shouldnβt make the mistake of considering it as the solution to all our problems, but rather as a powerful tool to use in certain contexts.
If you are interested in implementing machine learning flows in your company but donβt know which solution to implement, letβs talk about it!
I can help you contextualize your choice and point you in the best direction (although this article should have already clarified many doubts!)
See you soon,
Andrea
Recommended Reads
For the interested, here are a list of books that I recommended for each ML-related topic. There are ESSENTIAL books in my opinion and have greatly impacted my professional career.
Disclaimer: these are Amazon affiliate links. I will receive a small commission from Amazon for referring you these items. Your experience wonβt change and you wonβt be charged more, but it will help me scale my business and produce even more content around AI.
- Intro to ML: Confident Data Skills: Master the Fundamentals of Working with Data and Supercharge Your Career by Kirill Eremenko
- Sklearn / TensorFlow: Hands-On Machine Learning with Scikit-Learn, Keras, and TensorFlow by Aurelien GΓ©ron
- NLP: Text as Data: A New Framework for Machine Learning and the Social Sciences by Justin Grimmer
- Sklearn / PyTorch: Machine Learning with PyTorch and Scikit-Learn: Develop machine learning and deep learning models with Python by Sebastian Raschka
- Data Viz: Storytelling with Data: A Data Visualization Guide for Business Professionals by Cole Knaflic
Useful Links (written by me)
- Learn how to perform a top-tier Exploratory Data Analysis in Python: Exploratory Data Analysis in Python β A Step-by-Step Process
- Learn the basics of PyTorch: Introduction to PyTorch: from training loop to prediction
- Learn the basics of TensorFlow: Get started with TensorFlow 2.0 β Introduction to deep learning
- Perform text clustering with TF-IDF in Python: Text Clustering with TF-IDF in Python
If you want to support my content creation activity, feel free to follow my referral link below and join Mediumβs membership program. I will receive a portion of your investment and youβll be able to access Mediumβs plethora of articles on data science and more in a seamless way.
Join Medium with my referral link – Andrea D'Agostino
As a Medium member, a portion of your membership fee goes to writers you read, and you get full access to every storyβ¦
medium.com
Join thousands of data leaders on the AI newsletter. Join over 80,000 subscribers and keep up to date with the latest developments in AI. From research to projects and ideas. If you are building an AI startup, an AI-related product, or a service, we invite you to consider becoming aΒ sponsor.
Published via Towards AI