The Machine Learning Landscape

Briqi
14 min readDec 29, 2022

--

Artificial Intelligence (AI) is the old dream of computer engineers and scientists. Different schools and a lot of tries has built an accumulative experience we are relying on it right now (e.g. Machine Learning (ML) prediction) as we are going in this article to show that.

The future is love AI and, we will see more in the coming days. So, what is the story of AI and how it can be utilized in software solutions?

The story starting by Math, the abstraction of logical relation between things in the form of calculation formula, so we can assess or get value of unknown variable using the formula and value(s) of the known variable(s).

Machine Learning is the Math of software engineering where the traditional coding procedures are abstracted in a “smart reusable algorithms” that can extract facts from data patterns.

Machine learning algorithms build a model based on sample data, known as training data, in order to make predictions or decisions without being explicitly programmed to do so — Wikipedia

It is a different programming methodology with amazing results, automate-able, and short development path. However, that does not mean it is going to replace the classic development approach, at least for nearest future.

ML Architecture Landscape

The following diagram is depicting ML landscape architecture. It is demystified as possible to be used as reference during ML development life cycle or for building strategy roadmap.

Diagram by Hisham Mohamed Al-Briqi

The diagram is showing five main areas that we have to consider when designing a solution with ML features.

To make it more organized, they are grouped under two main categories (Practicing and Science)

ML Practicing Components:

  1. ML Framework — provide tools and libraries which spin the life cycle of App-ML by learning (from data using ML algorithms) and then generating ML models to be used independently by the software applications.

The generated ML model by the framework is often a computer program with an optimized prediction algorithm and data structures

As much as the framework is mature as much as the AutoML process is efficient to accelerate ML.

2. Software Application — represent the business use-case (or the requirements) that demand ML feature(s). Application could be web app, mobile app, back-end service, device or bot. Application is relaying on the generated ML model by ML framework.

ML model is a file that has been trained to recognize certain types of patterns. You train a model over a set of data, providing it an algorithm that it can use to reason over and learn from those data. Once you have trained the model, you can use it to reason over data that it hasn’t seen before, and make predictions about those data.

ML frameworks save the time by proving AutoML (or other supportive tools) which generate the ML model and, code sample that can be integrated into the main application code for, the purpose of using the generated ML model or training it.

Take care of ML model size as it is loaded on machine RAM at runtime.

Model could be part of the application or hosted on a web service (e.g. cloud hosting, Azure NLP or AWS NLP).

At the end ML Model is a program.

3. Data — is the traditional business database used by the application, and used by ML framework for model learning. It could be relational SQL data or No-SQL.

In addition to that traditional data, is the new data structures packaged within the ML model which allow it to make decisions from unseen datasets.

ML Science Components:

Although this is the scientific part but, it is the core engine and the secret ingredient.

  1. ML Algorithms — the mathematical formula used for operation on data. And that may require data to be prepared in prior of running the algorithm which is almost done by the ML framework as a recurring task. ML Algorithms is a complete science which requires full time study by scientists. Architect (or App Developer) work on understanding algorithm capability to decide how it can be utilized in the way that support the application. More about algorithms in the algorithms section

2. Data Science — As shown in the landscape diagram, data science is depending on ML algorithms. Both ML and data science are in the same direction but with different scopes. Data since scope is to provide insight about data from huge and different sources, while ML is an interaction model used for applications AI. While Data Science has a direct relying on ML algorithms, ML may depend indirectly on data science for its operations on the learning data. Both are so close with mutual induction. please refer to this link for a moderated comparison between ML and Data science.

The following diagram is just to give idea about the legacy and the modern trends affected by Math.

Algorithms

Note: Most of this section content is quoted from Microsoft ML.NET documentation and Wikipedia. Please refer to references sesction.

Basic Concepts

  1. Algorithm

The math that executes to produce a model

example:

2. Label and Features

Label is the the attribute that you want to predict

Features are the attributes that are used as inputs to predict the label

Data Sample of Houses

Supervised algorithms are working on such labeled data to predict values e.g. house price

3. Tasks

A machine learning task is the type of prediction or inference being made, based on the problem or question that is being asked, and the available data. For example, the classification task assigns data to categories, and the clustering task groups data according to similarity.

For details, please refer to this link

4. Trainer

Trainer = Algorithm + Task

The process of training an ML model involves providing an ML algorithm (that is, the learning algorithm) with training data to learn from.

5. Data transformations

Used to:

  • prepare data for model training
  • apply an imported model in TensorFlow or ONNX format
  • post-process data after it has been passed through a model

6. AutoML

In a typical machine learning application, practitioners have a set of input data points to be used for training. The raw data may not be in a form that all algorithms can be applied to. To make the data amenable for machine learning, an expert may have to apply appropriate data pre-processing, feature engineering, feature extraction, and feature selection methods. After these steps, practitioners must then perform algorithm selection and hyperparameter optimization to maximize the predictive performance of their model. If deep learning is used, the architecture of the neural network must also be chosen by the machine learning expert.

Each of these steps may be challenging, resulting in significant hurdles to using machine learning. AutoML aims to simplify these steps for non-experts, and to make it easier for them to use machine learning techniques correctly and effectively.

Automated machine learning (AutoML) plays an important role within the broader approach of automating data science, which also includes challenging tasks such as data engineering, data exploration and model interpretation. AutoML potentially includes every stage from beginning with a raw dataset to building a machine learning model ready for deployment.

AutoML was proposed as an artificial intelligence-based solution to the growing challenge of applying machine learning. The high degree of automation in AutoML aims to allow non-experts to make use of machine learning models and techniques without requiring them to become experts in machine learning.

7. AI, ML, and Deep Learning

Artificial intelligence is the capability of a computer system to mimic human cognitive functions such as learning and problem-solving. Through AI, a computer system uses math and logic to simulate the reasoning that people use to learn from new information and make decisions.

Machine learning is an application of AI. It’s the process of using mathematical models of data to help a computer learn without direct instruction. This enables a computer system to continue learning and improving on its own, based on experience.

Deep learning (also known as deep structured learning) is part of a broader family of machine learning methods based on artificial neural networks with representation learning. Learning can be supervised, semi-supervised or unsupervised. The main purpose is to mimic human reasoning

Neural network is a series of algorithms that are modeled after the human brain.

Learning Approach

Machine learning approaches are traditionally divided into three broad categories, which correspond to learning paradigms, depending on the nature of the “signal” or “feedback” available to the learning system:

  1. Supervised learning

Is a machine learning paradigm for problems where the available data consists of labelled examples, meaning that each data point contains features (covariates) and an associated label. The goal of supervised learning algorithms is learning a function that maps feature vectors (inputs) to labels (output), based on example input-output pairs.

Algorithms:
The most widely used learning algorithms are:

  • Support-vector machines
  • Linear regression
  • Logistic regression
  • Naive Bayes
  • Linear discriminant analysis
  • Decision trees
  • K-nearest neighbor algorithm
  • Neural networks (Multilayer perceptron)
  • Similarity learning

2. Unsupervised learning

Take a set of data that contains only inputs, and find structure in the data, like grouping or clustering of data points. The algorithms, therefore, learn from test data that has not been labeled, classified or categorized. Instead of responding to feedback, unsupervised learning algorithms identify commonalities in the data and react based on the presence or absence of such commonalities in each new piece of data.

unsupervised methods exhibit self-organization that captures patterns as probability densities or a combination of neural feature preferences encoded in the machine’s weights and activations.

Algorithms:

  • K-means clustering
  • KNN (k-nearest neighbors)
  • Hierarchal clustering
  • Anomaly detection
  • Neural Networks
  • Principle Component Analysis
  • Independent Component Analysis
  • Apriori algorithm
  • Singular value decomposition

3. Semi-supervised learning

Semi-supervised learning falls between unsupervised learning (without any labeled training data) and supervised learning (with completely labeled training data). Some of the training examples are missing training labels, yet many machine-learning researchers have found that unlabeled data, when used in conjunction with a small amount of labeled data, can produce a considerable improvement in learning accuracy.

4. Reinforcement learning

Is an area of machine learning concerned with how intelligent agents ought to take actions in an environment in order to maximize the notion of cumulative reward. Reinforcement learning is one of three basic machine learning paradigms, alongside supervised learning and unsupervised learning.

Reinforcement learning differs from supervised learning in not needing labelled input/output pairs to be presented, and in not needing sub-optimal actions to be explicitly corrected. Instead the focus is on finding a balance between exploration (of uncharted territory) and exploitation (of current knowledge).

The environment is typically stated in the form of a Markov decision process (MDP), because many reinforcement learning algorithms for this context use dynamic programming techniques. The main difference between the classical dynamic programming methods and reinforcement learning algorithms is that the latter do not assume knowledge of an exact mathematical model of the MDP and they target large MDPs where exact methods become infeasible.

The typical framing of a Reinforcement Learning (RL) scenario: an agent takes actions in an environment, which is interpreted into a reward and a representation of the state, which are fed back into the agent.

Wikipedia, ML RL

ML Use Cases (Solutions)

You can check the practical use-cases from cloud service providers like Azure, Google, and AWS as they are advertising for their ML cloud solutions like in the following image from Microsoft Azure ML which depict Azure use-cases mapped to algorithms, for example:

  1. Generate Recommendation — predicts what someone will be interested.
  2. Classify images
  3. Extract information from text
  4. Predict between several categories to answer complex questions
  5. discover structure

etc…

To provide ML solution, think about the business problem, the best ML learning approach, Algorithms, and then check the framework you are using for its best practice.

How to select algorithms?

  1. Identify your business use-case (requirements) — as show in the previous image (e.g. extract information from text), predict category, classify image, predict values, generate recommendation, discover structure, etc.
  2. Identify ML model factors: Accuracy; Training Time; Linearity; Number of Parameters; and Number of features.

ML Model Factors

Accuracy in machine learning measures the effectiveness of a model as the proportion of true results to total cases. Evaluate against industry-standard metrics.

Training time in supervised learning, training means using historical data to build a machine learning model that minimizes errors. The number of minutes or hours necessary to train a model varies a great deal between algorithms. Training time is often closely tied to accuracy; one typically accompanies the other.

Linearity in statistics and machine learning means that there is a linear relationship between a variable and a constant in your dataset. Linear regression algorithms assume that data trends follow a straight line. This assumption isn’t bad for some problems, but for others it reduces accuracy. Despite their drawbacks, linear algorithms are popular as a first strategy. They tend to be algorithmically simple and fast to train.

image by Microsoft

Parameters are the knobs a data scientist gets to turn when setting up an algorithm. They are numbers that affect the algorithm’s behavior, such as error tolerance or number of iterations, or options between variants of how the algorithm behaves.

In machine learning, a feature is a quantifiable variable of the phenomenon you are trying to analyze. For certain types of data, the number of features can be very large compared to the number of data points.

Please refer to this article as reference for selecting ML Model algorithm

ML Continuous Delivery

Learning is a continuous process with ML to refresh the model with new learning data or to add an accumulative knowledge to the model.

The configuration of ML pipeline is depending on the learning approach (supervised, unsupervised, reinforcement, or hybrid approach).

The following diagram is depicting a logical example of ML pipeline

ML Life Cycle

  1. Repreparation

Has sub-three activities

Starting by design to decide which learning approach to go with, data format, and data processing operations have to be done in prior of loading it into learning database.

Design is an optional activity, and the same for ML development as both can be done once or as required then pipeline will learn model automatically as we have new data or periodically.

ML development is the required development to be done for model learning like data processing or agent in the case of reinforcement.

Data processing— In most cases, the data that you have available isn’t suitable to be used directly to train a machine learning model. The raw data needs to be prepared, or pre-processed, before it can be used to find the parameters of your model. Your data may need to be converted from string values to a numerical representation.

Data processing takes the responsibility to load the processed data into learning database. While for simple scenarios, your model could rely directly on the data source database (business DB).

2. Learn — The pipeline is continuing to learn from learning data with considering learning quality attributes e.g. learning time, data size, data quality, parameters/features, and algorithm linearity.

3. Generate ML Model — the AI program that can be integrated within applications.

4. Evaluate ML model for the required results. That could be done by ML framework tools.

5. Deploy ML model by integrating it in software application (web app, mobile app, and other apps), Web service e.g. chat-bot or NLP services, or in device like embeded ML. While future may unveil more deployment options, who know.

ML Frameworks

I cannot suggest specific framework to be used, as the idea here is to understand ML landscape then you can utilize different ML frameworks for your purposes.

Frameworks are saving a lot of time, so it is important to have skills with some ML framework. Just start with the ML framework which is good with your skills e.g. ML.NET for c# .NET fans, TensorFlow for Javascript fans, and Pytorch for python fans.

You can try different frameworks so you can get benefit from all of them.

AI and ML are growing fast to change the game of software programming so just start with the framework that support you and the organization you are working for.

Who am I?

It is important to know your scope in AI to reach to your goal, unless you will be lost.

As shown in the landscape diagram, there are five main areas, but I’ll short them to four as, application and data are two sides for one coin. The is means you can work with AI & ML in one of this four areas:

  1. Application — your scope here is to design or developing application AI solution, so your intrest here is how to consume/utilize an AI solution in your application. Your scope here is neither to develope ML algorithm, ML frameworks, nor data science but to use them in your software app.
  2. Algorithms — this scope is for math Scientists or ML Algorith researcher/developer
  3. Data Science — in case your intrest with data science so your scope is to understanded how to use ML frameworks and algorithms in your work.
  4. ML Frameworks — it is for the ML framework makers, who are creating the engines of AI, so they have to work on all areas with special intrest with algorithms and process automation.

Trending ML Solutoins

It worth to mention here the trending ML solutions to exicte your immagination for how ML is going to transform the digitl world

So here are some trending solutions for 2023:

  1. Content generation — generate content using user inputs by analyzing huge amount of texts, images and media and then generate the content e.g. document, image, or media.
  2. Adaptive AI systems support a decision-making framework centered around making faster decisions while remaining flexible to adjust as issues arise. These systems aim to continuously learn based on new data at runtime to adapt more quickly to changes in real-world circumstances. The AI engineering framework can help orchestrate and optimize applications to adapt to, resist or absorb disruptions, facilitating the management of adaptive systems. (Gartner Definition of Adaptive AI)
  3. Low-code/No-code development — allow non-technical experts to create applications from pre-defined components. It is a special type of content generation AI.
  4. Document processing — by extracting data from documents e.g. invocies and contracts
  5. Transformers — interpret an input of data sequence and transform it to another sequence. Transformers are widely used in translation and other natural language processing tasks.

Conclusion

The aim of this article was to have a clear ML landscape for well-understanding ML foundation, so we can imagine better ML solution for our business and selecting the right learning path of ML advanced solutions.

Artificial inelegant fruits are growing everywhere right now, and this is the time to be harvested by you. just start!

References

--

--

Briqi

Hisham Mohamed is an architect with passion to innovate practical solutions that add value into people life