You should be familiar with these machine and deep learning algorithms.
Foto: ArtHead – shutterstock.com
With all the hysteria surrounding ChatGPT, Gemini, Claude and Co., it’s worth taking a step back to understand the full range of AI algorithms and their use cases. After all, many “traditional” machine learning algorithms have been solving various important problems for decades – and successfully. So why should only Large Language Models (LLMs) be in the spotlight?
Machine learning (ML) is a class of methods for automatically creating forecast models from data. ML algorithms are the engine here: they “transform” a data set into a model. Which type of algorithm is best depends on
-
what problem you want to solve,
-
how many computing resources are available, and
-
what type of data is available.
Below we will introduce you to 14 of the most commonly used algorithms for machine and deep learning – and explain how they are related to predictive models, classification, image and language processing, and generative AI, among other things. The following compilation does not claim to be complete – the algorithms are (roughly) arranged in ascending order of complexity.
Popular machine learning algorithms
Linear regression
Linear regression is the simplest (supervised) machine learning algorithm for predicting numerical values. In some cases, linear regression does not even require an optimizer because it is solvable in closed form. Otherwise, it can be easily optimized using gradient descent (more on this later). The starting point in linear regression: The objective function correlates linearly with the independent variables. This may or may not apply to your data.
To the despair of data scientists, business analysts often naively apply linear regression to prediction problems and then stop without creating scatterplots or calculating correlations. Thus, they do not check whether the underlying assumption is even reasonable. Don’t fall into this trap. It’s not that hard to do exploratory data analysis and then let the computer try out all the sensible machine learning algorithms to see which ones work best. By all means try linear regression, but consider the result as a baseline rather than a final answer.
Gradient descent
Machine learning optimization methods – including neural networks – typically use some form of gradient descent algorithm to control back propagation.
This often involves a mechanism to prevent getting stuck in local minima, such as optimizing randomly selected mini-batches and applying momentum corrections to the gradient. Some optimization algorithms also adjust the learning rates of the model parameters by looking at the progression of the gradient (AdaGrad, RMSProp or Adam).
Logistic regression
Classification algorithms can find solutions to supervised learning problems that require selection (or probabilistic determination) between two or more classes.
Logistic regression is a method for solving categorical classification problems that uses linear regression within a sigmoid or logit function. This compresses the values to a range of 0 to 1 and outputs a probability. Similar to linear regression for numerical predictions, logistic regression provides a good starting point for categorical predictions.
Support vector machines
Support vector machines (SVMs) are a type of parametric classification model – a geometric method to separate and classify two label classes. In the simplest case (well-separated classes with two variables), SVMs find the straight line that best separates the two groups on a level. In more complicated cases, the points can be projected into a higher dimensional space and the SVM finds the plane or hyperplane that best separates the classes. The projection is called a kernel – the process is called a kernel trick. After reversing the projection, the resulting boundary is often nonlinear.
If there are more than two classes, SVMs are applied to the classes in pairs. If the classes overlap, you can add a penalty factor for misclassified points (“soft margin”).
Decision tree
Decision trees (DTs) are a non-parametric, supervised learning method suitable for both classification and regression. The goal: To build a model that predicts the value of a target variable by learning simple decision rules derived from the data characteristics. A DT can be viewed as a piecewise constant approximation.
Decision trees are easy to interpret and inexpensive to use. However, they involve computationally intensive training processes and are susceptible to overfitting.
Random forest
The random forest model produces an ensemble of random DTs and is also used for both classification and regression purposes. The aggregated ensemble either combines the votes modally or averages the probabilities of the decision trees. Random Forest is a type of bagging ensemble.
XGBoost
eXtreme Gradient Boosting is a scalable, end-to-end tree boosting system that has already achieved excellent results in various ML challenges.
Bagging and boosting are often mentioned in the same breath. The difference is that gradient tree boosting starts with a single decision or regression tree, optimizes it, and then creates the next tree from the remains of the first DT, rather than generating an ensemble of randomized trees.
K-means clustering
K-means clustering attempts n Observations using the Euclidean distance metric in k to divide clusters. The goal is to minimize the variance (sum of squares) within each cluster. It is an unsupervised vector quantization method that is useful for feature learning and is a good starting point for other algorithms.
Lloyd’s Algorithm is the most commonly used heuristic to solve the problem. It is relatively efficient, but offers no guarantee of global convergence. To optimize this, the algorithm is often run multiple times with random initial cluster centroids generated using Forgy or other random partitioning methods.
K-means assumes spherical clusters that are separable so that the mean converges to the cluster center. In addition, the algorithm assumes that the order of the data points does not matter. The background: It is assumed that the clusters have a similar size, so that the assignment to the nearest cluster center is correct.
Principal component analysis
Principal component analysis (PCA) is a statistical procedure that uses orthogonal transformation to convert a series of observations of potentially correlated numerical variables into a series of values of linearly uncorrelated variables.
PCA can be performed by eigenvalue decomposition of a data covariance matrix (or correlation matrix) or by singular value decomposition (SVD) of a data matrix – usually after a normalization step applied to the output data.
Popular deep learning algorithms
Convolutional neural networks
Convolutional Neural Networks (CNNs) are often used for machine vision and have the desirable property of being position-independent.
When a convolutional layer is applied to images, it “slides” over the image (in simple terms) and calculates dot products. Each unit in the layer shares a set of weights. A CNN typically uses multiple convolutional layers interspersed with activation functions. CNNs can also have layers that are linked or pooled.
Recurrent neural networks
While recurrent neural networks (RNNs) are good for image analysis, they don’t really have a mechanism that takes time series and sequences into account, as they are purely feed-forward networks. RNNs contain explicit feedback loops that give them “memory” and enable temporally dynamic action.
This does not mean that CNNs are useless for natural language processing, but rather that RNNs can model time-based information that CNNs miss. And it doesn’t mean that RNNs can only process sequences either: RNNs and their derivatives have a variety of applications, including:
-
translations,
-
Speech recognition and synthesis,
-
bot control,
-
Time Series Prediction,
-
Anomaly detection or
-
Handwriting recognition.
An ordinary RNN can theoretically transfer information over an indefinite number of steps. In practice this is generally not possible without losing context. One cause of this problem: the gradient of the network tends to disappear over many steps, which affects the convergence of a gradient-based optimizer such as stochastic gradient descent (SGD).
Long short-term memory
Long-short-term memory (LSTM) networks were developed to avoid the vanishing gradient problem and take long-term dependencies into account. The design of an LSTM is slightly more complex compared to the cell design of an RNN, but works much better for long sequences.
With LSTMs, the network can both forget (gating) and remember previous information – in both cases this works by changing the weights. This gives an LSTM both long-term and short-term memory and solves the vanishing gradient problem. LSTMs can handle sequences of hundreds of historical inputs.
Transformers
Transformers are neural networks that exclusively use attention mechanisms and completely forego recurrence and convolution. They were invented by Google.
Attention Units (and Transformers) are part of Google’s BERT (.pdf) and OpenAI’s GPT-2 (Transformer Model with Unsupervised Pre-Training) algorithm for natural language processing. Transformers continue to be an integral part of the neural architecture of the latest major language models such as ChatGPT and Gemini.
Attention units, unlike RNNs, are not very sensitive to how close two words are to each other in a sentence. That’s why they’re well suited to tasks that RNNs don’t do as well – such as identifying antecedents of pronouns that can be separated from the referent pronouns by several sentences. In other words, attention units are good at looking at a larger context – rather than just the last few words that precede the current word.
Q-learning
Q-learning is a model-free, value-based reinforcement learning algorithm that finds the best sequence of actions based on the current state. The “Q” in the nomenclature stands for quality. This indicates how valuable the promotion is for maximizing future rewards. So Q-Learning is essentially learning through experience.
Q-Learning is often combined with neural networks. For example, it is used with convolutional neural networks to extract specific features from video frames. In practice, this can help, for example, to teach a computer to play video games or control robots. AlphaGo and AlphaZero are famous successful programs from Google DeepMind trained with reinforcement learning and neural networks. (fm)
This article originally appeared at our sister publication Infoworld.com.
